:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --accent-interp: #eab308;
    /* Yellow for interpolation */
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    height: 3.2rem;
    width: auto;
}

.tagline {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 300;
}

/* Obsolete search-section styles removed */

.btn-primary {
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-accent {
    padding: 0.5rem 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

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

.search-filters {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.search-filters label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.results-panel,
.playlist-panel {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    /* Ensure height fits viewport better */
    height: calc(100vh - 140px);
    overflow: hidden;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    padding: 1rem 1rem 0;
    gap: 0.5rem;
    justify-content: center;
}

.mobile-tab {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* Search Controls inside Panel */
.search-controls {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

/* --- Search Controls Layout --- */
.search-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* --- Search Tabs --- */
.search-tabs {
    display: flex;
    gap: 0.5rem;
    /* margin-bottom removed as it is handled by header-row now */
}

.tab {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* --- Enhanced Query Toggle --- */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

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

.slider {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--bg-tertiary);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .4s;
    border-radius: 50%;
}

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

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

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

/* --- Enhanced Query Display --- */
.enhanced-query {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;

    /* Layout stability: reserve space */
    min-height: 42px;
    /* Sufficient height for content */
    box-sizing: border-box;
    display: flex;
    align-items: center;

    /* Transition for visibility/opacity */
    transition: opacity 0.3s ease;
    visibility: hidden;
    opacity: 0;
}

.enhanced-query strong {
    color: #a78bfa;
    /* Light purple for "Enhanced:" label */
    font-style: normal;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* @keyframes fadeIn removed */



.search-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

#search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #000000;
    /* Darker background as requested */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
    width: 100%;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#search-input::placeholder {
    color: var(--text-secondary);
}

/* Make results list scrollable within flex container */
.track-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    /* Custom scrollbar styling */
    padding-right: 4px;
    position: relative;
    /* Essential for offsetTop calculations */
}

.results-panel h2,
.playlist-panel h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

#result-count {
    color: var(--accent-primary);
}

.playlist-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Track List */
.track-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.track-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.track-item.playing {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
}

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

.track-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-title-link {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.track-title-link:hover { text-decoration: underline; }
.track-title-link-icon {
    display: inline-block;
    margin-left: 0.25em;
    font-size: 0.75em;
    color: var(--text-secondary);
    opacity: 0.6;
    transform: translateY(-1px);
}
.track-title-link:hover .track-title-link-icon { opacity: 1; }

.track-artist {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

/* 3-way label buttons (eval/training feedback) */
.label-group {
    display: inline-flex;
    gap: 2px;
    margin-left: 0.25rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-color);
}
.label-action {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
    border-radius: 6px;
    opacity: 0.55;
}
.label-action:hover { opacity: 1; }
.label-action.selected {
    opacity: 1;
    color: white;
    border-color: transparent;
}
.label-action.label-relevant.selected   { background: #2e8b57; }
.label-action.label-borderline.selected { background: #c79a2c; }
.label-action.label-wrong.selected      { background: #b04545; }
.label-action.label-relevant:hover   { background: #2e8b57; color: white; border-color: transparent; }
.label-action.label-borderline:hover { background: #c79a2c; color: white; border-color: transparent; }
.label-action.label-wrong:hover      { background: #b04545; color: white; border-color: transparent; }

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
    z-index: 100;
}

.now-playing {
    width: 250px;
}

#now-playing-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#now-playing-artist {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.player-controls {
    display: flex;
    gap: 1rem;
}

.player-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (hover: hover) {
    .player-btn:hover {
        background: var(--accent-gradient);
        border-color: transparent;
    }
}

#play-btn {
    background: var(--accent-gradient);
    border-color: transparent;
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#progress-bar {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

#current-time,
#duration {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

/* Responsive */

/* Pinned Track */
.pinned-track-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    /* Make it distinct */
    border: 1px solid var(--accent-primary);
    /* Highlight it */
    border-radius: 12px;
}

.pinned-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.results-separator {
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-separator h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Interpolation Builder */
.builder-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    /* Important for nested flex scroll */
    overflow: hidden;
}

.builder-slots {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 4px;
    /* Scrollbar spacing */
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    position: relative;
    /* Context for absolute insert buttons */
}

.slot-container label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.track-slot {
    min-height: 60px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.track-slot.empty {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

.track-slot.filled {
    background: var(--glass-bg);
    border-style: solid;
    border-color: var(--border-color);
    /* Default subtle border */
    justify-content: flex-start;
    transition: border-color 0.2s ease;
}

/* Slot Border Updates based on Child State */
.track-slot.filled:has(.track-item:hover) {
    border-color: rgba(99, 102, 241, 0.3);
}

.track-slot.filled:has(.track-item.playing) {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    /* Subtle overall tint */
}

/* Interpolated Slot Specific Styles */
.interpolated-slot .track-slot.filled {
    border-color: rgba(234, 179, 8, 0.15);
    /* Very subdued yellow border for interpolated */
}

.interpolated-slot .track-slot.filled:has(.track-item:hover) {
    border-color: #facc15;
    /* Lighter yellow */
}

/* Keep standard background fill (blue tint) but use yellow border */
.interpolated-slot .track-slot.filled:has(.track-item.playing) {
    border-color: var(--accent-interp);
}


.track-slot .track-item {
    width: calc(100% + 1rem);
    border: none;
    background: transparent;
    padding: 0.5rem;
    margin: -0.5rem;
    flex-wrap: wrap;
    border-radius: 7px;
    transition: background-color 0.2s ease;
}

.track-slot .track-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.track-slot .track-item.playing {
    background: rgba(99, 102, 241, 0.15) !important;
    box-shadow: none;
    /* Match left side exactly */
}

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

.track-slot .track-item .track-actions {
    flex: 0 0 auto;
}

/* Footer takes full width */
.track-card-footer {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-enhanced-text {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.footer-nav-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.footer-nav-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0;
}

.footer-nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.track-slot.drag-over {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    border-style: solid;
}

.track-drag-ghost {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: max-content;
    position: absolute;
    top: -9999px;
    z-index: 10000;
    pointer-events: none;
}

.edit-action-btn {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
}

.edit-action-btn:hover {
    color: white;
    background: var(--bg-primary);
    border-color: var(--border-color);
}

.clear-slot-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 10;
}

.clear-slot-btn:hover {
    background: #ef4444;
    color: white;
    border-color: transparent;
}

.full-width {
    width: 100%;
}

.separator {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* Generated Playlist Styles */
.track-card.is-start {
    border-left: 3px solid #6366f1;
    /* Indigo */
}

.track-card.is-steering {
    border-left: 3px solid #b794f4;
    /* Purple */
}

/* Insert button group (small "+" and "≈" between slots) */
.insert-btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* Use absolute positioning to float exactly between slots without affecting flow */
    position: absolute;
    left: 0;
    right: 0;
    /* Slots have 0.5rem (8px) margin-bottom. We want to be in the middle of that gap. */
    margin-top: -14px;
    /* Pull up to overlap the gap */
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through container */
}

.insert-steer-btn,
.insert-interp-btn {
    pointer-events: auto;
    /* Re-enable clicks on buttons */
}

/* Ensure tracks don't clip the buttons if they have overflow:hidden */
.track-slot,
.slot-container {
    overflow: visible;
}

.insert-steer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--bg-secondary);
    /* Match bg to hide line if needed */
    border: 1px dashed var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.insert-steer-btn:hover:not(:disabled) {
    opacity: 1;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    border-style: solid;
}

.insert-steer-btn:disabled {
    opacity: 0.15;
    cursor: default;
}

.insert-interp-btn {
    font-size: 0.9rem;
}

.insert-interp-btn svg {
    width: 16px;
    height: 16px;
    fill: #fbbf24;
    /* Gold color */
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.5));
}

.insert-interp-btn:hover svg {
    fill: #f59e0b;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Interpolated Slot Styling */
.interpolated-slot .track-slot.filled {
    border-color: #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.1);
}

.interpolated-slot .track-card-footer .footer-enhanced-text {
    color: #fbbf24;
}

.insert-interp-btn.loading {
    cursor: wait;
    opacity: 0.8;
}

.insert-interp-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Slot Entry Animation */
/* Slot Entry Animation */
.slot-container {
    position: relative;
    /* Context for absolute positioning if needed */
}

.slot-container.entering {
    animation: slideDown 0.4s ease-out forwards;
    transform-origin: top center;
}

.slot-container.entering {
    animation: slideDown 0.4s ease-out forwards;
    transform-origin: top center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
        max-height: 0;
        margin-bottom: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 200px;
        /* Arbitrary large enough height */
        margin-bottom: 1rem;
        /* Match .slot-container margin if any, though it's usually inside containers */
    }
}

/* Slot Header & Nav */
.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    height: 16px;
}

.header-nav-controls {
    display: flex;
    gap: 4px;
}

.header-nav-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0;
    transition: all 0.2s ease;
}

.header-nav-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Inline slot controls: hidden on desktop, shown on mobile */
.slot-controls-inline {
    display: none;
}

.header-nav-btn.edit-control-btn {
    font-size: 0.85rem;
}

.header-nav-btn.remove-control-btn:hover {
    background: #ef4444;
    color: white;
    border-color: transparent;
}

/* Footer Tools */
.footer-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.footer-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.footer-icon-btn:hover {
    color: var(--accent-primary);
}

/* Edit-mode action buttons (cancel / remove) */
.edit-mode-actions {
    display: none;
    gap: 4px;
    margin-left: 4px;
    flex-shrink: 0;
}

.edit-mode-action-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.edit-mode-action-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

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

/* Remove Steer Btn */
/* Edit mode remove button override */
.slot-input-wrapper .remove-steer-btn-edit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    opacity: 0.6;
}

.slot-input-wrapper .remove-steer-btn-edit:hover {
    opacity: 1;
}

/* Remove button inside steer slot */
.remove-steer-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: all 0.2s ease;
}

.track-slot:hover .remove-steer-btn {
    opacity: 1;
}

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

/* Steer slot container — no label, tighter spacing */
.steer-slot-container {
    margin-top: 0;
    margin-bottom: 0.5rem;
    /* Ensure consistent bottom margin for all steer slots */
}

/* Interpolated slot — compact, no search input */
.interpolated-slot {
    margin-top: 0;
    margin-bottom: 0.5rem;
    /* Match steer-slot margin */
}

.interpolated-slot .track-slot {
    min-height: 48px;
}

.interpolated-slot {
    margin-top: 0;
    margin-bottom: 0.5rem;
    /* Reduced bottom margin */
}

.interpolated-slot .track-slot {
    min-height: 48px;
}


/* Builder Slot Inputs & Navigation */
.slot-input-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.slot-search-input {
    flex: 1;
    width: 100%;
    padding: 0.5rem 0.75rem;
    padding-right: 90px;
    /* Space for nav controls */
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: all 0.2s ease;
    height: 34px;
}

.slot-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.slot-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.slot-randomize-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 34px;
    width: 38px;
}

.slot-search-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 34px;
    width: 38px;
}

.slot-search-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.slot-search-btn.loading {
    cursor: wait;
    opacity: 0.5;
    animation: spin 0.6s linear infinite;
}

.slot-search-input.loading {
    border-color: var(--accent-primary);
    animation: searchPulse 1.2s ease-in-out infinite;
}

@keyframes searchPulse {

    0%,
    100% {
        border-color: var(--accent-primary);
        opacity: 0.7;
    }

    50% {
        border-color: var(--accent-secondary, #818cf8);
        opacity: 1;
    }
}

.slot-randomize-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: rotate(15deg);
}

.slot-randomize-btn:active {
    transform: rotate(90deg);
}

.slot-randomize-btn.loading {
    cursor: wait;
    opacity: 0.5;
    animation: spin 0.6s linear infinite;
}

.slot-nav-controls {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 2px 4px;
    border: 1px solid var(--border-color);
}

.slot-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-nav-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
}

.slot-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.slot-nav-count {
    font-size: 0.65rem;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.slot-enhanced-query {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.1);
    border-left: 2px solid var(--accent-primary);
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: max-height 0.3s ease;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Adjust label margin because we have label-row now */
.slot-container .label-row label {
    margin-bottom: 0;
}

.clear-slot-btn-main {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.clear-slot-btn-main:hover {
    color: #ef4444;
}

/* Responsive - Mobile Styles (Moved to end to override defaults) */
@media (max-width: 900px) {
    body {
        height: 100dvh;
        height: 100vh; /* fallback for older browsers */
        height: 100dvh;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    .app-container {
        height: 100dvh;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        padding-bottom: 0;
        overflow: hidden;
    }

    .header {
        flex-shrink: 0;
        padding: 1rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        padding: 1rem;
        /* Reduce padding on mobile */
        gap: 1rem;
        min-height: 0;
        overflow: hidden;
    }

    /* Mobile Navigation Visibility */
    .mobile-nav {
        display: flex;
        flex-shrink: 0;
    }

    /* Hide panels by default on mobile, javascript will toggle 'active' class */
    .results-panel,
    .playlist-panel {
        display: none;
        height: auto;
        flex: 1;
        min-height: 0;
        padding: 0.5rem 0.25rem !important;
    }

    .results-panel.active,
    .playlist-panel.active {
        display: flex;
    }

    /* Bigger Touch Targets */
    .footer-nav-btn,
    .action-btn,
    .player-btn {
        width: 44px;
        height: 44px;
    }

    .clear-slot-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
        top: -12px;
        right: -12px;
    }

    /* Enhanced Touch Targets for Slot Controls */
    .header-nav-btn {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin-left: 8px;
        /* Spacing */
    }

    /* Bigger Slot Search Input */
    .slot-search-input {
        height: 48px !important;
        font-size: 16px !important;
        padding-right: 0.75rem !important;
        /* Reset nav-controls padding since they won't be here in edit mode */
    }

    /* Randomize & Search Buttons: match control button size, in-flow next to search box */
    .slot-randomize-btn,
    .slot-search-btn {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.3rem !important;
        margin-left: 8px !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }

    /* Insert buttons: visible unless disabled */
    .insert-steer-btn {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
        opacity: 0.7;
    }

    .insert-steer-btn:disabled {
        opacity: 0.15;
    }

    .insert-steer-btn.loading:disabled {
        opacity: 1;
    }

    /* Player Bar Rearrangement */
    .player-bar {
        position: relative;
        flex-shrink: 0;
        height: auto;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        align-items: stretch;
    }

    .progress-container {
        width: 100%;
        order: -1;
        /* Move to top */
        margin-bottom: 0.5rem;
    }

    .now-playing {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .player-controls {
        justify-content: center;
        width: 100%;
    }
}

/* Mobile Layout - Consolidated (replaces V2-V6) */
@media (max-width: 900px) {

    /* Hide Track Labels */
    .slot-container label {
        display: none !important;
    }

    /* Push panel headers in from edges */
    .playlist-panel .panel-header,
    .results-panel .playlist-controls {
        padding: 0 1rem !important;
    }

    /* Builder slots: kill gap, no horizontal padding (slots handle their own inset) */
    .builder-slots {
        padding: 0 !important;
        gap: 0 !important;
    }

    /* Slot containers: inset from edges to leave room for buttons, tiny vertical gap */
    .slot-container,
    .steer-slot-container {
        position: relative;
        margin: 0 30px 2px 30px !important;
        padding-top: 0 !important;
        border: none !important;
    }

    #steer-slots-container {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Slot header: collapse but allow overflow for absolute controls */
    .slot-header {
        position: static !important;
        height: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Slot controls in header: hidden on mobile (replaced by inline controls) */
    .slot-controls {
        display: none !important;
    }

    /* Insert buttons (+✨): full width, buttons sit in the 30px margins outside slots */
    .insert-btn-group {
        position: relative !important;
        height: 0 !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 25 !important;
        display: flex !important;
        justify-content: space-between !important;
        top: 0 !important;
    }

    .insert-btn-group .insert-steer-btn {
        transform: translateY(calc(-50% - 1px));
    }

    .insert-interp-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Ensure slot content isn't clipped */
    .track-slot {
        overflow: visible !important;
    }

    .slot-mode-view,
    .slot-mode-edit {
        margin-top: 0 !important;
    }

    .slot-input-wrapper {
        margin-bottom: 0 !important;
    }

    /* --- Inline Slot Controls (mobile) --- */

    /* Track items in slots: wrap so actions go below info */
    .track-slot .track-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .track-slot .track-info {
        width: 100%;
        flex: none;
        order: 1;
    }

    .track-slot .track-actions {
        flex: none;
        order: 2;
    }

    /* Show inline slot controls */
    .slot-controls-inline {
        display: flex !important;
        gap: 0.5rem;
        margin-left: auto;
        order: 3;
    }

    .slot-controls-inline .action-btn {
        width: 44px;
        height: 44px;
    }

    .slot-controls-inline .remove-inline-btn:hover {
        background: #ef4444;
        color: white;
        border-color: transparent;
    }

    /* Show edit-mode action buttons on mobile */
    .edit-mode-actions {
        display: flex !important;
    }

    .edit-mode-action-btn {
        width: 44px;
        height: 44px;
    }

    .track-slot .track-card-footer {
        order: 4;
    }

    /* --- Search Panel: Make entire panel scroll on mobile --- */
    .results-panel.active,
    .playlist-panel.active {
        display: block !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .results-panel .search-controls {
        flex-shrink: unset;
    }

    .results-panel .track-list {
        overflow-y: visible !important;
        flex: unset !important;
        max-height: none !important;
    }

    /* Hide alignment spacer on mobile */
    .results-spacer {
        display: none !important;
    }

    /* --- Tighten search UI on mobile --- */
    .results-panel > h2 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .search-header-row {
        margin-bottom: 0.5rem;
    }

    .search-container {
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }

    .search-container #search-input {
        flex: 1 1 100%;
        padding: 0.6rem 0.75rem;
        font-size: 16px; /* prevent iOS zoom */
    }

    .search-container .btn-primary,
    .search-container .btn-secondary {
        flex: 1;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .search-filters {
        margin-top: 0.5rem;
        gap: 1rem;
        font-size: 0.85rem;
    }

    .enhanced-query {
        min-height: 36px;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .results-panel .playlist-controls {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* --- Search result track items: buttons below info on mobile --- */
    .results-panel .track-item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }

    .results-panel .track-info {
        width: 100%;
        flex: none;
    }

    .results-panel .track-actions {
        flex: none;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
}

/* Hamburger menu button */
.hamburger-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* About modal overlay */
.about-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.about-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow);
}

.about-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.about-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.about-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.about-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.about-links {
    margin-bottom: 1.5rem;
}

.about-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.about-github-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.about-footer {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.7;
    font-style: italic;
}



/* ============================================================
   Track action row — clustered actions + Match pill (variant F)
   Overrides the old single-row of identical .action-btn squares.
   ============================================================ */

/* Container for the three queue actions (Add / Similar / Dissimilar). */
.actions-cluster {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

/* Individual button inside the cluster. Higher specificity beats the
   generic .action-btn hover styles further up in this file. */
.actions-cluster .cluster-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}
.actions-cluster .cluster-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: transparent;
}
.actions-cluster .cluster-btn.primary {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.32);
    color: #c7c9ff;
}
.actions-cluster .cluster-btn.primary:hover {
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

/* Match rating pill — segmented yes / maybe / no. */
.match-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.25);
    height: 34px;
    margin-left: 0.5rem;
}
.match-pill .mp-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.7;
    padding: 0 8px 0 10px;
    user-select: none;
}
.match-pill .mp-btn {
    width: 30px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    opacity: 0.7;
}
.match-pill .mp-btn:hover {
    color: var(--text-primary);
    opacity: 1;
    background: transparent;
    border-color: transparent;
}

/* Selected states — bright tone + dark text. Override the older muted
   .label-action.*.selected colors further up in this file. */
.match-pill .mp-btn.mp-yes.selected,
.match-pill .label-action.label-relevant.selected {
    background: #22c55e;
    color: #07140a;
    border-color: transparent;
    opacity: 1;
}
.match-pill .mp-btn.mp-mid.selected,
.match-pill .label-action.label-borderline.selected {
    background: #eab308;
    color: #14110a;
    border-color: transparent;
    opacity: 1;
}
.match-pill .mp-btn.mp-no.selected,
.match-pill .label-action.label-wrong.selected {
    background: #ef4444;
    color: white;
    border-color: transparent;
    opacity: 1;
}

/* The old border-left divider on .label-group conflicts visually with
   the new pill — strip it when .match-pill is also present. */
.match-pill.label-group {
    margin-left: 0.5rem;
    padding-left: 2px;
    border-left: none;
}


/* ─── Inline note row (replaces window.prompt for Borderline / Wrong) ─── */

/* Make the track card wrap so the note row can flow to a new line. */
.track-item.has-note {
    flex-wrap: wrap;
}

.note-row {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
    animation: noteRowSlide 0.22s ease-out;
}
@keyframes noteRowSlide {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

.note-prompt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    padding-left: 4px;
    white-space: nowrap;
}
.note-prompt .note-optional {
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.7;
}
.note-row.mid .note-prompt { color: #eab308; }
.note-row.no  .note-prompt { color: #ef4444; }

.note-input {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.note-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
}
.note-input.mid:focus {
    border-color: rgba(234, 179, 8, 0.55);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.12);
}
.note-input.no:focus {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.note-input::placeholder { color: var(--text-secondary); opacity: 0.6; }

.note-save,
.note-skip {
    height: 32px;
    padding: 0 12px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    flex-shrink: 0;
}
.note-save.mid { background: #eab308; border-color: #eab308; color: #14110a; }
.note-save.no  { background: #ef4444; border-color: #ef4444; color: white; }
.note-save:hover { filter: brightness(1.1); }
.note-save.is-saved,
.note-save:disabled {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: default;
    opacity: 0.7;
    filter: none;
}
.note-save.is-saved:hover,
.note-save:disabled:hover { filter: none; }
.note-skip { color: var(--text-secondary); background: transparent; }
.note-skip:hover { color: var(--text-primary); border-color: rgba(255, 255, 255, 0.14); }

.note-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.18s ease;
}
.note-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
}

/* ─── Mobile adjustments for the new action row ─── */
@media (max-width: 900px) {
    /* On mobile, the right-side rate group lives on its own line below the
       track info (the existing .results-panel .track-item rules wrap it).
       Make sure the cluster + pill don't get stretched / wrapped weirdly. */
    .results-panel .actions-cluster,
    .results-panel .match-pill {
        height: 42px;
    }
    .results-panel .actions-cluster .cluster-btn {
        width: 36px;
        height: 36px;
    }
    .results-panel .match-pill .mp-btn {
        width: 38px;
        height: 32px;
    }

    /* Note row: input gets its own line; prompt above, buttons below. */
    .note-row {
        flex-wrap: wrap;
        gap: 6px;
        row-gap: 8px;
    }
    .note-row .note-prompt {
        flex: 1 1 100%;
        order: 1;
    }
    .note-row .note-input {
        flex: 1 1 100%;
        order: 2;
        height: 40px;
        font-size: 16px; /* prevent iOS zoom */
    }
    .note-row .note-save,
    .note-row .note-skip {
        flex: 1 1 auto;
        order: 3;
        height: 38px;
    }
    .note-row .note-close {
        order: 3;
        width: 44px;
        height: 38px;
        flex: 0 0 auto;
    }
}

