:root {
    --bg: #090812;
    --panel: rgba(20, 19, 30, 0.9);
    --panel-strong: rgba(28, 26, 42, 0.96);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --text: #fbf7ff;
    --muted: #bdb6cc;
    --faint: #858093;
    --pink: #ff5fae;
    --cyan: #5ee7ff;
    --lime: #b7f769;
    --amber: #ffc861;
    --red: #ff7777;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, "Trebuchet MS", Arial, sans-serif;
    background:
        linear-gradient(135deg, rgba(255, 95, 174, 0.08) 0%, transparent 28%),
        linear-gradient(225deg, rgba(94, 231, 255, 0.07) 0%, transparent 30%),
        linear-gradient(180deg, #090812 0%, #12101c 48%, #08070d 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.music-app {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 16px 0 42px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 8, 18, 0.86);
    backdrop-filter: blur(18px);
}

.brand,
.topnav,
.capture-main,
.panel-head,
.footer {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 95, 174, 0.24), rgba(94, 231, 255, 0.18));
    font-weight: 800;
}

.brand strong,
.brand em {
    display: block;
}

.brand em {
    color: var(--faint);
    font-size: 0.84rem;
    font-style: normal;
}

.topnav {
    gap: 8px;
}

.topnav a,
.track-link,
.rating-button,
.reprocess-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
}

.rating-button {
    cursor: pointer;
}

.reprocess-button {
    cursor: pointer;
    color: var(--text);
    border-color: rgba(94, 231, 255, 0.34);
    background: rgba(94, 231, 255, 0.12);
}

.content {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.stat-card,
.empty-state,
.notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow: var(--shadow);
}

.hero {
    padding: 28px 4px 10px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.2rem, 8vw, 5.2rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.lede {
    max-width: 700px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
}

.stat-card {
    padding: 16px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
}

.stat-card span {
    color: var(--muted);
    text-transform: capitalize;
}

.capture-panel {
    overflow: hidden;
}

.panel-head {
    justify-content: space-between;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-size: 1.45rem;
}

.count {
    color: var(--faint);
    white-space: nowrap;
}

.capture-list {
    display: grid;
    gap: 10px;
    padding-top: 10px;
}

.event-list {
    display: grid;
    gap: 10px;
    padding-top: 10px;
}

.notice {
    padding: 14px 16px;
    color: var(--lime);
}

.notice--error {
    color: var(--red);
}

.capture-row {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(20, 19, 30, 0.72);
}

.event-row {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(20, 19, 30, 0.72);
}

.event-row--locked {
    opacity: 0.84;
}

.capture-main {
    justify-content: space-between;
    gap: 16px;
}

.event-form,
.event-edit,
.event-summary {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.event-form {
    padding: 18px 0 0;
}

.event-form label,
.event-edit label {
    display: grid;
    gap: 6px;
    min-width: min(260px, 100%);
}

.event-form span,
.event-edit span {
    color: var(--faint);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.event-form input,
.event-edit input {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
}

.event-form button,
.event-edit button {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid rgba(255, 95, 174, 0.34);
    border-radius: 8px;
    background: rgba(255, 95, 174, 0.12);
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.event-summary {
    justify-content: space-between;
}

.event-summary h3,
.event-summary p {
    margin: 0;
}

.event-summary p {
    margin-top: 4px;
    color: var(--muted);
}

.capture-title {
    min-width: 0;
}

.capture-title h3 {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.capture-title p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.status {
    flex: 0 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-transform: capitalize;
}

.status--identified {
    color: var(--lime);
    border-color: rgba(183, 247, 105, 0.38);
}

.status--unidentified {
    color: var(--amber);
    border-color: rgba(255, 200, 97, 0.38);
}

.status--failed,
.status--wrong {
    color: var(--red);
    border-color: rgba(255, 119, 119, 0.38);
}

.status--identifying {
    color: var(--cyan);
    border-color: rgba(94, 231, 255, 0.38);
}

.capture-meta {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.capture-meta div {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.capture-meta dt {
    margin-bottom: 5px;
    color: var(--faint);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.capture-meta dd {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.track-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rating-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-label {
    color: var(--muted);
}

.rating-label strong {
    color: var(--text);
}

.rating-button {
    color: var(--muted);
}

.rating-button.is-active {
    color: var(--text);
    border-color: rgba(94, 231, 255, 0.44);
    background: rgba(94, 231, 255, 0.13);
}

.rating-button.is-saving {
    opacity: 0.6;
}

.reprocess-button.is-saving {
    opacity: 0.7;
}

.track-link {
    justify-self: start;
    color: var(--text);
    border-color: rgba(255, 95, 174, 0.34);
    background: rgba(255, 95, 174, 0.12);
}

.empty-state {
    margin: 18px;
    padding: 24px;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    margin-top: 8px;
    color: var(--muted);
}

.footer {
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    color: var(--faint);
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .music-app {
        width: min(100% - 18px, 1180px);
        padding-top: 9px;
    }

    .topbar,
    .capture-main,
    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .topnav {
        width: 100%;
    }

    .topnav a {
        flex: 1;
        justify-content: center;
    }

    .hero {
        padding: 22px 0 8px;
    }

    .capture-meta {
        grid-template-columns: 1fr;
    }

    .event-form,
    .event-edit,
    .event-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .event-form button,
    .event-edit button {
        width: 100%;
    }
}
