:root {
  --ink: #1f2328; --quiet: #656d76; --rule: #d8dee4; --tint: #f3f5f7; --bg: #ffffff;
  --accent: #c00000; --good: #2da44e; --good-tint: #dafbe1; --wip-tint: #fff8c5;
  --line-1: #2f6fde; --line-2: #e0712b; --line-3: #2a9d8f; --line-4: #8e44ad;
  --line-5: #c9a227; --line-6: #d64570; --line-7: #5b8c5a;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; padding: 32px 16px 64px; color: var(--ink); font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
article, main { max-width: 880px; margin: 0 auto; }
nav.crumbs { max-width: 880px; margin: 0 auto 20px; color: var(--quiet); font-size: 13px; }
nav.crumbs a { color: var(--quiet); text-decoration: none; }
nav.crumbs a:hover { color: var(--accent); }
nav.crumbs span { margin: 0 6px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 36px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); font-weight: 650; }
p { margin: 0 0 12px; }
.byline { color: var(--quiet); font-size: 14px; margin-bottom: 28px; }
.byline time, .byline .who { color: var(--ink); }
.status { padding: 1px 8px; border-radius: 10px; background: var(--tint); font-size: 12.5px; }
.status.done, .meta .done { color: #1a7f37; font-weight: 600; }
.status.notdoing, .meta .notdoing { color: #bc4c00; font-weight: 600; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--tint); padding: 1px 5px; border-radius: 4px; }
ol, ul { padding-left: 24px; margin: 0 0 14px; }
li { margin: 4px 0; }
table { border-collapse: collapse; width: 100%; margin: 10px 0 18px; font-size: 13.5px; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px; border: 1px solid var(--rule); }
th { background: var(--tint); font-weight: 650; white-space: nowrap; }
td.st-done { background: var(--good-tint); }
td.st-wip { background: var(--wip-tint); }
figure { margin: 10px 0 20px; }
figure svg { width: 100%; height: auto; display: block; }
figcaption { color: var(--quiet); font-size: 13px; margin-top: 6px; }
.overflow { overflow-x: auto; }

/* index */
.index h1 { margin-bottom: 4px; }
.index .lead { color: var(--quiet); margin-bottom: 28px; }
details.module { border: 1px solid var(--rule); border-radius: 8px; margin: 0 0 10px; background: var(--bg); }
details.module summary { cursor: pointer; padding: 12px 16px; font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 10px; list-style: none; }
details.module summary::-webkit-details-marker { display: none; }
details.module summary::before { content: "▸"; color: var(--quiet); font-size: 13px; width: 12px; }
details.module[open] summary::before { content: "▾"; }
details.module summary .count { margin-left: auto; color: var(--quiet); font-weight: 400; font-size: 13px; background: var(--tint); padding: 1px 10px; border-radius: 10px; }
details.module ul { list-style: none; margin: 0; padding: 0 16px 10px 38px; }
details.module li { margin: 0; padding: 8px 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
details.module li a { color: var(--ink); text-decoration: none; font-weight: 550; }
details.module li a:hover { color: var(--accent); text-decoration: underline; }
details.module li .meta { color: var(--quiet); font-size: 13px; }
details.build ul { list-style: disc; padding: 0 16px 12px 52px; }
details.build li { display: list-item; border-top: 0; padding: 3px 0; }
@media (max-width: 640px) { h1 { font-size: 24px; } th, td { padding: 5px 7px; } }

/* app chrome */
nav.bar { max-width: 880px; margin: 0 auto 28px; display: flex; align-items: center; gap: 18px; font-size: 13.5px; color: var(--quiet); border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
nav.bar .brand a { color: var(--accent); font-weight: 700; text-decoration: none; }
nav.bar .links { margin-left: auto; display: flex; gap: 16px; }
nav.bar a { color: var(--quiet); text-decoration: none; }
nav.bar a:hover { color: var(--accent); }
nav.bar details.user { position: relative; color: var(--ink); }
nav.bar details.user summary { cursor: pointer; list-style: none; }
nav.bar details.user summary::-webkit-details-marker { display: none; }
nav.bar details.user summary::after { content: "\25BE"; margin-left: 4px; color: var(--quiet); }
nav.bar details.user .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 0; min-width: 160px; box-shadow: 0 4px 12px rgba(0,0,0,.08); z-index: 10; }
nav.bar details.user .menu a { display: block; padding: 6px 12px; white-space: nowrap; }
nav.bar details.user .menu a:hover { background: var(--tint); }
nav.bar details.user .menu hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; }
body.login main { max-width: 380px; margin-top: 10vh; }
.card { border: 1px solid var(--rule); border-radius: 8px; padding: 18px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.card.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--quiet); }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); padding-bottom: 8px; }
input[type=text], input[type=password], input:not([type]) { font: inherit; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); min-width: 160px; }
select { font: inherit; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); background: var(--bg); }
form.inline select { padding: 3px 6px; font-size: 13px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button { font: inherit; font-weight: 600; padding: 8px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; }
button.link { background: none; color: var(--accent); padding: 2px 4px; font-weight: 500; }
button.link.danger { color: #a40e26; }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline input { min-width: 0; width: 140px; padding: 4px 7px; font-size: 13px; }
.error { color: #a40e26; background: #ffebe9; border: 1px solid #ffb3ad; padding: 8px 12px; border-radius: 6px; font-size: 13.5px; }
.ok { color: #1a7f37; background: var(--good-tint); border: 1px solid #aceebb; padding: 8px 12px; border-radius: 6px; font-size: 13.5px; }
table.users td.actions { white-space: nowrap; }
table.users td.actions form { display: inline; }
.tag { font-size: 11px; color: var(--quiet); background: var(--tint); padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
