:root {
  --bg: #f6f7f9; --surface: #fff; --fg: #1f2328; --muted: #656d76; --border: #d8dee4;
  --accent: #0b5cd5; --accent-fg: #fff; --ok: #1a7f37; --ok-bg: #dafbe1; --err: #cf222e; --err-bg: #ffebe9;
  --warn-bg: #fff8c5; --warn: #7d4e00; --code-bg: #eff2f5;
  --c-issued: #8fb8f4; --c-verified: #1a7f37; --c-blocked: #cf222e;
  --radius: 8px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --surface: #161b22; --fg: #e6edf3; --muted: #8d96a0; --border: #30363d;
    --accent: #4493f8; --accent-fg: #0d1117; --ok: #3fb950; --ok-bg: #12261e; --err: #f85149; --err-bg: #2d1214;
    --warn-bg: #2e2a12; --warn: #e3b341; --code-bg: #21262d;
    --c-issued: #2f5d9e; --c-verified: #3fb950; --c-blocked: #f85149; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
pre { background: var(--code-bg); padding: 12px; border-radius: var(--radius); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
small, .hint, .muted { color: var(--muted); }
.hint { font-size: 13px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--fg); font-size: 17px; }
.orgs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.orgs a, .tabs a { padding: 4px 10px; border-radius: 6px; color: var(--fg); }
.orgs a[aria-current], .tabs a[aria-current] { background: var(--code-bg); font-weight: 600; }
.me { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 6px 16px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs .role { margin-left: auto; color: var(--muted); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 20px; }
.card.narrow { max-width: 400px; margin: 48px auto; }
figure.card { margin: 0 0 20px; }
.heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.heading h1 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.right { text-align: right; white-space: nowrap; }
table.dense td { padding: 5px 10px; font-size: 13px; }
td.small { font-size: 12px; max-width: 360px; overflow-wrap: anywhere; }
.empty { color: var(--muted); text-align: center; padding: 20px; }

form.stack, .stack { display: flex; flex-direction: column; gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
form.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.inline { display: inline; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 6px; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; min-width: 0; }
textarea { width: 100%; resize: vertical; }
textarea.mono { font-size: 13px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.narrow-form { max-width: 360px; }
form.card.stack label input, form.card.stack label textarea { width: 100%; }

button, .button { display: inline-block; font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); cursor: pointer; text-align: center; }
button:hover, .button:hover { border-color: var(--muted); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.danger { color: var(--err); }
button.small { padding: 3px 8px; font-size: 13px; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 400; }
.card.narrow .button { width: 100%; }
.or { text-align: center; color: var(--muted); margin: 12px 0; }
.card.narrow form { margin-bottom: 4px; }
.card.narrow button.primary { width: 100%; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.badge.on { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--err-bg); color: var(--err); }
.danger-zone { border-color: var(--err); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; }
.tile span { color: var(--muted); font-size: 13px; }
.tile strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg a { padding: 6px 12px; color: var(--fg); font-size: 14px; }
.seg a[aria-current] { background: var(--code-bg); font-weight: 600; }

.chart { width: 100%; height: auto; display: block; }
.chart .issued { fill: var(--c-issued); }
.chart .verified { fill: var(--c-verified); }
.chart .blocked { fill: var(--c-blocked); }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .base { stroke: var(--border); }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.sw.issued { background: var(--c-issued); }
.sw.verified { background: var(--c-verified); }
.sw.blocked { background: var(--c-blocked); }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; }
details summary { cursor: pointer; font-weight: 600; margin: 4px 0; }

@media (max-width: 760px) {
  table { display: block; overflow-x: auto; }
}
@media (max-width: 600px) {
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dd { margin-bottom: 8px; }
  form.row { flex-direction: column; align-items: stretch; }
  .tabs .role { display: none; }
}
.list-row { padding-top: 12px; border-top: 1px solid var(--border); }
.list-actions { margin: 6px 0 12px; }
.presets { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
