:root {
    color-scheme: light;
    --bg: #f7f8f5;
    --ink: #171717;
    --muted: #62645f;
    --line: #dcdfd6;
    --panel: #ffffff;
    --accent: #007f73;
    --accent-strong: #005f57;
    --warm: #bc6c25;
    --danger: #b42318;
    --shadow: 0 12px 32px rgba(28, 31, 30, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: rgba(247, 248, 245, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.app-header h1,
.drawer-header h2,
.dialog-header h2,
.section-head h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--warm);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.setlist-pill,
.primary-button,
.secondary-button,
.add-button,
.preview-button,
.icon-button {
    border: 0;
    cursor: pointer;
}

.setlist-pill {
    min-width: 112px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.setlist-pill span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 24px;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--accent);
}

.app-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 18px 14px 96px;
}

.search-panel {
    margin-bottom: 22px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 127, 115, 0.16);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.section-head span,
.status,
.empty-state {
    color: var(--muted);
    font-size: 14px;
}

.results {
    display: grid;
    gap: 10px;
}

.track-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.track-image {
    width: 72px;
    height: 72px;
    display: block;
    object-fit: cover;
    border-radius: 6px;
    background: var(--line);
}

.track-main {
    min-width: 0;
}

.track-main h3 {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: 0;
}

.track-main p,
.setlist-title p,
.review-list p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.track-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}



.preview-button,
.add-button,
.primary-button,
.secondary-button {
    min-height: 42px;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 800;
}

.preview-button {
    background: #e8f3f1;
    color: var(--accent-strong);
}

.preview-button[disabled] {
    background: #eceee8;
    color: #797d74;
    cursor: default;
}

.add-button,
.primary-button {
    background: var(--accent);
    color: #fff;
}

.add-button.added {
    background: #d9efe5;
    color: var(--accent-strong);
}

.secondary-button {
    width: 100%;
    margin-top: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.tomplay-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.36);
}

.setlist-drawer {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 11;
    max-height: 86vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    padding: 18px 14px;
    border-radius: 8px 8px 0 0;
    background: #fff;
    box-shadow: var(--shadow);
    transform: translateY(110%);
    transition: transform 180ms ease;
}

.setlist-drawer.open {
    transform: translateY(0);
}

.drawer-header,
.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #eff1eb;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
}

.setlist-items {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    overflow: auto;
    list-style: none;
}

.setlist-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.setlist-number {
    color: var(--warm);
    font-weight: 900;
}

.setlist-controls {
    display: grid;
    grid-template-columns: 36px 36px 36px;
    gap: 4px;
}

.setlist-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.setlist-controls button:last-child {
    color: var(--danger);
}

.drawer-actions {
    padding-top: 4px;
}

.drawer-actions .primary-button,
.submit-dialog .primary-button {
    width: 100%;
}


.submit-dialog {
    width: min(calc(100% - 24px), 560px);
    max-height: calc(100dvh - 24px);
    margin: 12px auto;
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.submit-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.submit-dialog form {
    display: grid;
    gap: 14px;
    padding: 18px 14px;
}

.review-list {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcf8;
    max-height: 30vh;
    overflow-y: auto;
}

.review-list strong {
    display: block;
    font-size: 14px;
}

.submit-dialog .primary-button {
    width: 100%;
}

@media (max-width: 759px) {
    .submit-dialog {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 24px);
        margin: 12px auto;
        overflow-y: auto;
    }
}


@media (min-width: 760px) {
    .app-header {
        padding-inline: calc((100vw - 760px) / 2 + 14px);
    }

    .setlist-drawer {
        inset: 0 0 0 auto;
        width: 430px;
        max-height: none;
        border-radius: 8px 0 0 8px;
        transform: translateX(110%);
    }

    .setlist-drawer.open {
        transform: translateX(0);
    }
}

