:root {
    --bg: #14110f;
    --bg-2: #1c1916;
    --ink: #f4efe6;
    --muted: #a3988c;
    --line: #3a342e;
    --accent: #e07a3d;
    --accent-ink: #1a110c;
    --ok: #7dba6a;
    --dead: #c45c4a;
    --maybe: #c9a227;
    --danger: #c45c4a;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    background: radial-gradient(1200px 500px at 10% -10%, #2a2018 0%, var(--bg) 45%);
    color: var(--ink);
    line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: 0.92em; background: #0003; padding: 0.1em 0.35em; border-radius: 4px; }

.top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1.25rem;
    background: #0e0c0b;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
    flex-wrap: wrap;
}
.brand {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    font-size: 0.95rem;
}
.nav { display: flex; gap: 0.85rem; flex-wrap: wrap; }
.nav a { color: var(--muted); }
.nav a.is-active { color: var(--ink); }
.top-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.who { color: var(--muted); font-size: 0.9rem; }
.band-switch label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}
.band-switch select { width: auto; min-width: 10rem; }
.band-switch select, select, input, textarea {
    background: var(--bg-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font: inherit;
}
textarea { width: 100%; resize: vertical; }
input, select { width: 100%; }

.wrap { padding: 1.25rem 1.5rem; }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
h1 { font-size: 1.55rem; margin: 0 0 0.25rem; }
.muted { color: var(--muted); margin: 0; font-size: 0.95rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.linkish {
    background: none;
    border: 0;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    padding: 0;
}
.linkish:hover { text-decoration: underline; }

.flash {
    background: #2a3a24;
    border: 1px solid #3d5a34;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    margin: 0 0 1rem;
}
.flash-err { background: #3a221f; border-color: #6a3a34; list-style: none; }

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filters input, .filters select { width: auto; min-width: 10rem; }

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.table-wrap th:first-child,
.table-wrap td:first-child { width: 100%; }
.table-wrap th:not(:first-child),
.table-wrap td:not(:first-child) { width: 0; white-space: nowrap; }
.table-wrap .col-note,
.table-wrap .row-actions { min-width: max-content; }
.col-note { white-space: normal; }
.note-clip { display: inline-block; width: 12rem; max-width: 12rem; white-space: normal; vertical-align: top; }
.cell-sub {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cell-missing { color: var(--muted); font-style: italic; }
.row-actions { vertical-align: middle; white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions > * + * { margin-left: 0.7rem; }

.pill {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: #0003;
}
.pill-ok { color: var(--ok); }
.pill-dead { color: var(--dead); }
.pill-maybe { color: var(--maybe); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}
.span-2 { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.form-actions { display: flex; gap: 0.6rem; }
fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 1rem 1rem;
}
legend { color: var(--ink); padding: 0 0.3rem; }
.band-box { background: #241910; }
.check { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--ink); }
.check input { width: auto; }
.check-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }

.comments {
    margin: 0 0 1.25rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}
.comments h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.comment-form { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.comment-form label { width: 100%; }
.comment-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.comment { border-top: 1px solid var(--line); padding: 0.75rem 0 0; margin-top: 0.75rem; }
.comment-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.comment-meta { color: var(--muted); font-size: 0.82rem; }
.comment-body { white-space: pre-wrap; margin-top: 0.25rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; color: var(--muted); }
.pager .is-disabled { opacity: 0.4; }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}
.login-card {
    width: min(24rem, 92vw);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.login-card .brand { font-size: 1.1rem; }

@media (max-width: 800px) {
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .page-head { flex-direction: column; }
}
