* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
}

a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1050px, 94vw);
    margin: 32px auto;
}

.container.small {
    width: min(440px, 94vw);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgb(0 0 0 / 8%);
}

.header-title h1 {
    margin: 0;
    font-size: 1.7rem;
}

.header-title p,
.muted {
    margin: 6px 0 0;
    color: #6b7280;
}

.nav-actions,
.track-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card,
form,
.panel,
.track {
    background: white;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 25px rgb(0 0 0 / 8%);
}

.login-card {
    margin-top: 80px;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
}

input:focus {
    border-color: #2563eb;
    outline: 3px solid #bfdbfe;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    background: #2563eb;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: #1d4ed8;
    text-decoration: none;
}

.button.secondary {
    background: #e5e7eb;
    color: #111827;
}

.button.secondary:hover {
    background: #d1d5db;
}

button.danger {
    background: #dc2626;
}

button.danger:hover {
    background: #b91c1c;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-weight: 600;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

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

.search-form {
    display: flex;
    align-items: end;
    gap: 12px;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.search-form label {
    flex: 1;
    margin: 0;
}

.tracks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.track-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.track h2 {
    margin: 0;
    font-size: 1.1rem;
}

.track-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

.badge {
    height: fit-content;
    border-radius: 999px;
    padding: 7px 11px;
    background: #dbeafe;
    color: #1e40af;
    font-weight: 700;
    white-space: nowrap;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}

.metadata-grid div {
    border-radius: 12px;
    padding: 12px;
    background: #f9fafb;
}

.metadata-grid dt {
    margin-bottom: 4px;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 700;
}

.metadata-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

audio {
    width: 100%;
    margin-bottom: 16px;
}

.empty-state {
    padding: 32px;
    text-align: center;
    color: #6b7280;
}

.panel {
    margin-bottom: 22px;
}

.panel h2 {
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 10px;
    text-align: left;
}

th {
    color: #6b7280;
    font-size: 0.9rem;
}

.inline {
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
}

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

.checkbox input {
    width: auto;
}

@media (max-width: 700px) {
    .header,
    .search-form,
    .track-header {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-actions,
    .track-actions {
        width: 100%;
    }

    .button,
    button {
        width: 100%;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    td {
        border-bottom: 0;
        padding: 8px 0;
    }

    tr {
        border-bottom: 1px solid #e5e7eb;
        padding: 12px 0;
    }
}
