:root {
    color-scheme: light dark;
    --bg: #0f1115;
    --surface: #181b22;
    --surface-soft: #20242d;
    --text: #f5f7fb;
    --muted: #9aa3b2;
    --line: #303643;
    --accent: #15b8a6;
    --danger: #f87171;
    --success: #34d399;
}

* {
    box-sizing: border-box;
}

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

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

button,
.button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #031413;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    min-height: 42px;
    padding: 10px 16px;
    align-items: center;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    padding: 12px;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px;
    text-align: left;
    vertical-align: top;
}

code {
    color: var(--accent);
}

.topbar {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 24px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
}

.nav,
.actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.nav form,
.actions form {
    margin: 0;
}

.nav button,
.actions button {
    background: transparent;
    color: var(--text);
    min-height: auto;
    padding: 0;
}

.page {
    margin: 0 auto;
    max-width: 1120px;
    padding: 32px 20px 64px;
}

.hero {
    align-items: center;
    display: grid;
    min-height: 52vh;
}

.hero h1 {
    font-size: clamp(3rem, 12vw, 7rem);
    line-height: .9;
    margin: 0 0 18px;
}

.hero p {
    color: var(--muted);
    max-width: 640px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.secondary {
    background: var(--surface-soft);
    color: var(--text);
}

.eyebrow {
    color: var(--accent);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1,
.panel h1 {
    margin: 0;
}

.page-header p {
    color: var(--muted);
}

.with-action {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

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

.content-grid,
.feed,
.comments,
.search-results {
    display: grid;
    gap: 16px;
}

.content-card,
.post-card,
.composer,
.comment,
.repertoire-card,
.profile-hero,
.article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.post-card.pinned {
    border-color: var(--accent);
}

.post-header {
    align-items: center;
    display: flex;
    gap: 12px;
}

.avatar,
.profile-avatar {
    background: var(--surface-soft);
    border-radius: 50%;
    height: 48px;
    object-fit: cover;
    width: 48px;
}

.post-image,
.article-image,
.content-card img,
.repertoire-card img {
    border-radius: 8px;
    display: block;
    height: auto;
    margin-top: 14px;
    max-width: 100%;
}

.post-actions,
.toolbar,
.composer-grid,
.stats,
.footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.post-actions {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 12px;
}

.post-actions form {
    margin: 0;
}

.post-actions button {
    background: transparent;
    color: var(--muted);
    min-height: auto;
    padding: 0;
}

.toolbar {
    margin-bottom: 20px;
}

.toolbar input {
    max-width: 360px;
}

.toolbar select {
    max-width: 180px;
}

.composer-grid > * {
    flex: 1 1 220px;
}

.link-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--accent);
    display: block;
    margin-top: 12px;
    padding: 12px;
}

.profile-banner {
    background: var(--surface-soft);
    background-position: center;
    background-size: cover;
    border-radius: 8px;
    height: 180px;
    margin: -18px -18px 0;
}

.profile-avatar {
    border: 4px solid var(--surface);
    height: 96px;
    margin-top: -48px;
    width: 96px;
}

.repertoire-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.repertoire-card {
    display: grid;
    gap: 12px;
}

.article {
    max-width: 780px;
}

.article h1 {
    font-size: clamp(2rem, 7vw, 4.5rem);
    line-height: 1;
}

.article-body {
    margin-top: 24px;
}

.inline-check {
    align-items: center;
    display: flex !important;
    flex-direction: row;
}

.inline-check input {
    width: auto;
}

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

.muted-link a {
    color: var(--accent);
}

.footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    justify-content: center;
    padding: 24px;
}

.tile,
.panel,
.table-wrap,
.permission-group {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.tile {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.tile span,
small {
    color: var(--muted);
}

.panel {
    padding: 24px;
}

.narrow {
    max-width: 520px;
}

.form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.form label {
    color: var(--muted);
    display: grid;
    gap: 8px;
}

.table-wrap {
    overflow-x: auto;
}

.permission-form {
    display: grid;
    gap: 16px;
}

.permission-group {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.permission-group legend {
    color: var(--accent);
    font-weight: 800;
    padding: 0 8px;
}

.check-row {
    align-items: flex-start;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    padding: 10px;
}

.check-row:hover {
    background: var(--surface-soft);
}

.check-row input {
    margin-top: 5px;
    width: auto;
}

.check-row span {
    display: grid;
}

.notice {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.notice.success {
    background: color-mix(in srgb, var(--success), transparent 82%);
}

.notice.error {
    background: color-mix(in srgb, var(--danger), transparent 82%);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f7f8fb;
        --surface: #ffffff;
        --surface-soft: #f1f4f8;
        --text: #12141a;
        --muted: #5f6978;
        --line: #dfe4ec;
    }
}

@media (max-width: 720px) {
    .topbar,
    .with-action,
    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 16px 20px;
    }

    .actions {
        align-items: flex-start;
        flex-direction: column;
    }
}
