:root {
    --bg: #f7f4ed;
    --surface: #fffdf8;
    --ink: #1d242b;
    --muted: #596574;
    --line: #e7dece;
    --accent: #c9772d;
    --accent-strong: #a45b1b;
    --danger: #b42424;
    --ok: #1d7f44;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #fff8ea 0%, var(--bg) 60%);
    color: var(--ink);
}

.container {
    width: min(1000px, 92%);
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: #fff9ef;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 64px;
}

.brand {
    color: var(--ink);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
}

nav a {
    margin-left: 14px;
    text-decoration: none;
    color: var(--ink);
}

nav a:hover {
    color: var(--accent-strong);
}

.inline-logout-form {
    display: inline;
    margin-left: 14px;
}

.nav-link-button {
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.nav-link-button:hover {
    color: var(--accent-strong);
}

.main-content {
    padding: 22px 0 40px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

h1,
h2 {
    margin-top: 0;
}

.search-form,
.form-grid {
    display: grid;
    gap: 10px;
}

label {
    display: grid;
    gap: 6px;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    border: 1px solid #d6ccb9;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

textarea {
    resize: vertical;
}

button,
.button-link {
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    width: fit-content;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.button-link:hover {
    background: var(--accent-strong);
}

.song-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.song-list li {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.song-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.song-list li:last-child {
    border-bottom: none;
}

.song-list a {
    color: #2f3c4b;
    text-decoration: none;
}

.song-list a:hover {
    text-decoration: underline;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d5c7af;
    border-radius: 999px;
    background: #fff5e8;
    color: #5d4426;
    font-size: 0.8rem;
    padding: 2px 10px;
}

.content-block {
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    font-family: "Courier New", monospace;
}

.musica-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr);
}

.musica-sidebar {
    min-width: 0;
}

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

.musician-tools {
    position: sticky;
    top: 76px;
    z-index: 15;
}

.musician-controls {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.musician-controls label {
    background: #fff;
    border: 1px dashed #d9cfba;
    border-radius: 10px;
    padding: 8px;
}

.musician-toggle {
    min-height: 44px;
    font-weight: 700;
}

.musician-alt {
    min-height: 44px;
    border: 1px solid var(--accent);
    background: #fff7eb;
    color: #7d4617;
}

.musician-alt:hover {
    background: #ffefd7;
}

.view-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.view-option {
    border: 1px solid #d5c7af;
    background: #fff;
    color: #4a3a2a;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
}

.view-option:hover {
    background: #fff4e3;
}

.view-option.is-active {
    background: #f0c99a;
    border-color: #b77329;
    color: #4a2a09;
    font-weight: 700;
}

.is-hidden {
    display: none;
}

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

.error {
    color: var(--danger);
    font-weight: 700;
}

.success {
    color: var(--ok);
    font-weight: 700;
}

.danger-button {
    background: #b42424;
}

.danger-button:hover {
    background: #941b1b;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 16px 0 26px;
    color: var(--muted);
}

@media (min-width: 980px) {
    .musica-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: start;
    }

    .musica-sidebar {
        grid-column: 2;
        grid-row: 1;
    }

    .musica-main {
        grid-column: 1;
        grid-row: 1;
    }
}

@media (max-width: 700px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0 10px;
    }

    nav a {
        margin: 0 12px 0 0;
    }

    .musician-tools {
        position: static;
    }

    .content-block {
        padding: 10px;
    }
}
