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

body {
    font-family: sans-serif;
    background-color: #FAF9F5;
    color: #2B2A26;
    padding: 2.5rem 3rem;
    line-height: 1.5;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

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

.upload-btn {
    display: inline-block;
    background: #fff;
    color: #2B2A26;
    border: 1px solid #E9E6DD;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 3px 0 #E9E6DD;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    font-family: inherit;
}

.upload-btn:hover { background: #FAF9F5; }
.upload-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #E9E6DD; }

#export-btn:disabled {
    opacity: 0.38;
    cursor: default;
    box-shadow: none;
}

.export-msg {
    font-size: 0.8rem;
    color: #5BA0FF;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
}

.export-msg.visible { opacity: 1; }

#app-title {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.tagline {
    font-size: 0.9rem;
    color: #8C887E;
    margin-top: 4px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(360px, 460px) 1fr;
    gap: 2.5rem;
    align-items: start;
}

.panel-label {
    font-size: 0.75rem;
    color: #8C887E;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

#track-counter {
    font-size: 0.8rem;
    color: #8C887E;
}

.progress-bar {
    height: 6px;
    background: #E9E6DD;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, #5BA0FF, #3FDBC6, #FFC83D, #FF5BA6);
    transition: width 0.35s ease;
}

.track-card {
    background-color: #FFFFFF;
    border: 1px solid #EFEDE5;
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.track-card.animate {
    animation: cardIn 0.3s ease;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.track-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.track-name-row > div {
    flex: 1;
    min-width: 0;
}

#track-name {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 4px;
}

#track-artist {
    font-size: 1rem;
    color: #8C887E;
}

#preview-btn {
    flex-shrink: 0;
    background: #fff;
    color: #2B2A26;
    border: 1px solid #E9E6DD;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 0 #E9E6DD;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#preview-btn:hover:not(:disabled) { background: #FAF9F5; }

#preview-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 0 0 #E9E6DD;
}

#preview-btn:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

.no-preview-msg {
    font-size: 0.75rem;
    color: #B5B1A6;
    margin-top: 8px;
}

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

.preset-pills {
    display: flex;
    gap: 6px;
}

.preset-pill {
    background: transparent;
    border: 1px solid #E9E6DD;
    border-radius: 99px;
    padding: 4px 10px;
    font-size: 0.72rem;
    color: #8C887E;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.preset-pill:hover {
    border-color: #C8C4BA;
    color: #2B2A26;
}

.preset-pill.active {
    background: #2B2A26;
    border-color: #2B2A26;
    color: #fff;
}

#mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #E9E6DD;
    border-radius: 99px;
    padding: 5px 10px;
    font-size: 0.75rem;
    color: #8C887E;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

#mode-toggle:hover {
    border-color: #C8C4BA;
    color: #2B2A26;
}

#mode-toggle.active {
    border-color: #5BA0FF;
    color: #2B2A26;
}

.mode-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C8C4BA;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

#mode-toggle.active .mode-dot {
    background: #5BA0FF;
}

.bin-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 1.25rem;
}

.bin-buttons button {
    border: none;
    border-radius: 14px;
    padding: 16px 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    background: var(--bg);
    box-shadow: 0 5px 0 var(--sh);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.bin-buttons button:hover { filter: brightness(1.06); }

.bin-buttons button:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 var(--sh);
}

.bin-buttons button.bin-selected {
    outline: 2.5px solid rgba(255, 255, 255, 0.8);
    outline-offset: -4px;
    filter: brightness(1.1);
}

.next-btn {
    width: 100%;
    background: #2B2A26;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1.25rem;
    transition: background 0.12s ease;
}

.next-btn:hover { background: #44423c; }

.add-bin {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.add-bin input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #E9E6DD;
    border-radius: 10px;
    background: #fff;
    color: #2B2A26;
    font-size: 0.9rem;
}

.add-bin input::placeholder { color: #B5B1A6; }

.add-bin button {
    background: #2B2A26;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
}

.add-bin button:hover { background: #44423c; }

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.action-buttons button {
    flex: 1;
    background: #fff;
    color: #8C887E;
    border: 1px solid #E9E6DD;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 3px 0 #E9E6DD;
    transition: transform 0.08s ease, box-shadow 0.08s ease, color 0.12s ease;
}

.action-buttons button:hover { color: #2B2A26; }

.action-buttons button:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #E9E6DD;
}

#sorting-ui.hidden {
    display: none;
}

#finished-state {
    display: none;
}

#finished-state.visible {
    display: block;
    animation: finishedIn 0.4s ease;
}

@keyframes finishedIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.finished-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: #8C887E;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

.finished-subtitle {
    font-size: 0.9rem;
    color: #B5B1A6;
}

.finished-actions {
    margin-top: 1.5rem;
}

.crate-panel {
    border-left: 1px solid #EFEDE5;
    padding-left: 2.5rem;
}

#crate-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.crate-card {
    background: #fff;
    border: 1px solid #EFEDE5;
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.crate-card h3 {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 99px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.crate-card p {
    font-size: 0.85rem;
    color: #8C887E;
    padding: 5px 0;
    border-bottom: 1px solid #F4F2EA;
}

.crate-card p:last-child { border-bottom: none; }

.crate-empty {
    color: #B5B1A6;
    font-size: 0.9rem;
    margin-top: 1rem;
}

@media (max-width: 800px) {
    body { padding: 1.5rem; }
    .layout { grid-template-columns: 1fr; gap: 2rem; }
    .crate-panel {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #EFEDE5;
        padding-top: 1.5rem;
    }
}

/* ── Landing screen ── */

#landing {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #FAF9F5;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem;
    transition: opacity 0.4s ease;
}

#landing.fade-out {
    opacity: 0;
    pointer-events: none;
}

.landing-logo {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #2B2A26;
}

.landing-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

.landing-steps {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: #C0BCB4;
}

.landing-arrow {
    color: #C0BCB4;
    font-size: 1rem;
}

.landing-import-btn {
    display: inline-block;
    background: #fff;
    color: #2B2A26;
    border: 1px solid #E9E6DD;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 5px 0 #E9E6DD;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.landing-import-btn:hover { background: #FAF9F5; }

.landing-import-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #E9E6DD;
}


/* ── Help button ── */

#help-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #E9E6DD;
    color: #8C887E;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 0 #E9E6DD;
    transition: transform 0.08s ease, box-shadow 0.08s ease, color 0.12s ease;
    z-index: 50;
}

#help-btn:hover { color: #2B2A26; }

#help-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #E9E6DD;
}