
:root {
    color-scheme: light dark;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --line: #d9dee5;
    --text: #16191d;
    --muted: #5d6672;
    --accent: #b26a00;
    --accent-ink: #ffffff;
    --ok: #1f7a3d;
    --warn: #9a6400;
    --bad: #a32020;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --panel: #161b22;
        --line: #2a323d;
        --text: #e6edf3;
        --muted: #9aa4b2;
        --accent: #ffcc33;
        --accent-ink: #12161c;
        --ok: #57d78a;
        --warn: #ffcc33;
        --bad: #ff7b72;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

header.bar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 14px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

header.bar .brand {
    font-weight: 700;
    margin-right: auto;
}

header.bar, nav.tabs, .row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 14px calc(48px + env(safe-area-inset-bottom, 0px));
    display: grid;
    gap: 16px;
}

h1, h2, h3 {
    margin: 0 0 8px;
    line-height: 1.25;
}

h1 {
    font-size: 1.35rem;
}

h2 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 10px;
}

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

.card, .notice, .event, a.thread {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.muted, summary, th {
    color: var(--muted);
    font-size: 0.85rem;
}

.grow {
    flex: 1 1 160px;
    min-width: 0;
}

button, .tab {
    font: inherit;
    padding: 9px 13px;
    min-height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

button.primary, .tab.active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    font-weight: 600;
}

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

textarea {
    min-height: 110px;
    resize: vertical;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.field {
    margin-bottom: 12px;
}

ul.list, div.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

a.thread {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.thread .subject {
    font-weight: 600;
    word-break: break-word;
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--line);
    color: var(--muted);
}

.pill.running, .pill.idle {
    color: var(--accent);
    border-color: var(--accent);
}

.pill.waiting {
    color: var(--warn);
    border-color: var(--warn);
}

.event {
    border-left: 3px solid var(--accent);
}

.event .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.event .body {
    white-space: pre-wrap;
    word-break: break-word;
}

details {
    margin-top: 6px;
}

summary {
    cursor: pointer;
}

pre {
    margin: 6px 0 0;
    padding: 8px;
    overflow-x: auto;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.8rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.scroller {
    overflow-x: auto;
}

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

th {
    font-weight: 600;
    white-space: nowrap;
}

.bars {
    width: 100%;
    height: auto;
}

.bars rect {
    fill: var(--accent);
}

.bars text {
    fill: var(--muted);
    font-size: 9px;
}

.notice.bad {
    color: var(--bad);
    border-color: var(--bad);
}

.center {
    max-width: 420px;
    margin: 40px auto;
}
