:root {
  --bg: #fbfbf9; --fg: #1d1d1b; --muted: #6b6b66; --line: #e3e2dc; --card: #fff;
  --accent: #2456c9; --ok: #1c7c43; --warn: #a15c00; --bad: #b42318; --bot: #f3f5fb;
}
:root { color-scheme: light dark; }
/* "only light" stops Chrome's auto dark mode from darkening a page the member set to light. */
:root[data-theme=light] { color-scheme: only light; }
/* Dark palette: the system preference unless the member chose light, or their explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #161615; --fg: #e9e8e3; --muted: #9b9a94; --line: #2e2e2b; --card: #1e1e1c;
    --accent: #7ea2ff; --ok: #5fc58a; --warn: #e2a14a; --bad: #ff7b6e; --bot: #1d2130;
  }
  :root:not([data-theme=light]) .theme .to-dark { display: none; }
  :root:not([data-theme=light]) .theme .to-light { display: inline; }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #161615; --fg: #e9e8e3; --muted: #9b9a94; --line: #2e2e2b; --card: #1e1e1c;
  --accent: #7ea2ff; --ok: #5fc58a; --warn: #e2a14a; --bad: #ff7b6e; --bot: #1d2130;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { border-bottom: 1px solid var(--line); background: var(--card); }
nav, main, footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
nav { display: flex; gap: 16px; align-items: center; height: 52px; overflow-x: auto; white-space: nowrap; }
nav .brand { font-weight: 700; color: var(--fg); }
nav .version { font-weight: 400; font-size: 13px; color: var(--muted); }
nav .theme { margin-left: auto; }
nav .theme button { font-size: 18px; line-height: 1; }
.theme .to-light, :root[data-theme=dark] .theme .to-dark { display: none; }
:root[data-theme=dark] .theme .to-light { display: inline; }
main { padding-top: 20px; padding-bottom: 40px; }
footer { color: var(--muted); font-size: 12px; padding-bottom: 24px; }
footer a { color: inherit; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; margin: 16px 0; }
label { display: grid; gap: 4px; font-weight: 600; }
.hint, .muted { color: var(--muted); font-weight: 400; font-size: 14px; }
input, textarea, select, button { font: inherit; color: inherit; }
input:not([type=file]), textarea, select { width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--card); }
.row input:not([type=file]) { width: auto; flex: 1; min-width: 140px; }
button, .button { padding: 7px 14px; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--accent); color: #fff; cursor: pointer; display: inline-block; }
button.secondary { background: transparent; color: var(--accent); }
button.link { border: 0; background: none; color: var(--muted); padding: 0; }
.items { list-style: none; padding: 0; margin: 0; }
.items li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.items .title { font-weight: 600; }
.items li.unread .title::before { content: "● "; color: var(--accent); }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.status, .badge { font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.s-building, .r-running, .r-requested { color: var(--warn); border-color: currentColor; }
.s-merged, .s-shipped, .r-done, .approved { color: var(--ok); border-color: currentColor; }
.r-failed { color: var(--bad); border-color: currentColor; }
.count { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 12px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.post.bot { background: var(--bot); }
.post .by { font-size: 14px; color: var(--muted); }
.post .by b { color: var(--fg); }
.body { overflow-wrap: anywhere; }
.body img { max-width: 100%; }
.body pre, pre { overflow-x: auto; background: var(--bg); padding: 10px; border-radius: 6px; font-size: 13px; }
.attachments { padding-left: 18px; }
.actions { margin-top: 18px; }
.flash { background: var(--card); border-left: 3px solid var(--accent); padding: 8px 12px; }
.note { color: var(--muted); font-style: italic; }
.empty { color: var(--muted); }
.avatar { width: 24px; height: 24px; border-radius: 50%; }
.signin { max-width: 440px; margin: 48px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.signin h1 { font-size: 28px; margin: 0; }
.signin .button { padding: 10px 20px; font-weight: 600; }
.run-items { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; display: grid; gap: 2px; }
.tag { font-size: 13px; color: var(--accent); }
/* progress ring: --p is the percent of the run's stages done */
.ring { width: 18px; height: 18px; border-radius: 50%; flex: none; color: var(--muted);
  background: conic-gradient(currentColor calc(var(--p) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }
.ring.r-running, .ring.r-requested { color: var(--warn); }
.ring.r-done { color: var(--ok); }
.ring.r-failed { color: var(--bad); }
.stages { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.stages span { padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.stages .st-done { color: var(--fg); }
.stages .st-active { color: var(--warn); border-color: currentColor; }
.stages .st-pending, .stages .st-skipped { opacity: .6; }
.stages .st-skipped { text-decoration: line-through; }
.items .version { font-size: 13px; color: var(--muted); }
