/* Copyright 2026 LeadTestKit Authors */
/* SPDX-License-Identifier: Apache-2.0 */

:root {
  --fg: #1f2328; --muted: #656d76; --bg: #ffffff; --line: #d0d7de; --row: #f6f8fa;
  --success: #1a7f37; --fail: #cf222e; --warning: #9a6700; --pending: #0969da; --other: #6e7781;
  /* --warning is dark enough for text; areas look cleaner brighter. */
  --warning-area: #d4a72c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6edf3; --muted: #8d96a0; --bg: #0d1117; --line: #30363d; --row: #161b22;
    --success: #3fb950; --fail: #f85149; --warning: #d29922; --pending: #58a6ff; --other: #8b949e;
    --warning-area: var(--warning);
  }
}
body { font: 14px/1.45 system-ui, sans-serif; color: var(--fg); background: var(--bg);
  margin: 0 auto; max-width: 1200px; padding: 0 16px; }
a { color: var(--pending); text-decoration: none; }
a:hover { text-decoration: underline; }
header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
header h1 { margin: 16px 0 4px; font-size: 22px; }
.actions { display: flex; gap: 6px; margin-top: 16px; }
.actions button { background: var(--row); color: var(--fg); display: inline-flex;
  align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.actions button.active { border-color: var(--pending); font-weight: 600; }
#refresh:disabled { cursor: progress; opacity: 0.6; }
.alert { width: 16px; height: 16px; flex: none; }
.alert .frame { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.alert.outage .frame { fill: color-mix(in srgb, currentColor 10%, transparent); }
.alert .mark { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.alert .dot { fill: currentColor; }
.alert.outage { color: var(--fail); }
.alert.short { color: var(--warning); }
#meta, .muted, footer { color: var(--muted); }
#outage { font-size: 14px; margin-top: 4px; }
footer { margin: 24px 0; font-size: 12px; }
nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
nav button { border: 1px solid var(--line); background: var(--row); color: var(--fg);
  padding: 4px 10px; border-radius: 6px; cursor: pointer; }
nav button.active { border-color: var(--pending); font-weight: 600; }
#controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
#controls[hidden] { display: none; }
#controls input { flex: 1; min-width: 200px; padding: 4px 8px; }
#controls input, #controls select, #pager button, .pager button {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.series { border: 1px solid var(--line); border-radius: 6px; margin: 6px 0; }
.series > .head { display: flex; gap: 8px; align-items: baseline; padding: 4px 10px;
  background: var(--row); cursor: pointer; flex-wrap: wrap; }
.series .name { flex: 1 1 300px; font-weight: normal; }
.head .right { display: flex; gap: 8px; align-items: baseline; margin-left: auto; }
/* Topics shared by the patches end at the author column. */
.topics { font-size: 12px; white-space: nowrap; }
.series .who { width: 150px; border-left: 1px solid var(--line); padding-left: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; font-size: 12px; min-width: 3.5em; }
.ver { font-size: 12px; min-width: 1.7em; }
.pid { font: 12px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.when { font-size: 12px; width: 4.5em; flex: none; text-align: right; }
.links { font-size: 11px; font-weight: normal; font-family: system-ui, sans-serif;
  line-height: 1; }
.links a { color: var(--muted); }
.links a:hover { color: var(--pending); }
.counts { display: inline-flex; gap: 2px; font-variant-numeric: tabular-nums; }
.count { display: inline-block; min-width: 1.7em; text-align: center; font-size: 12px;
  border-radius: 3px; color: #fff; }
.count.zero { color: var(--muted); }
.count.success { background: var(--success); }
.count.warning { background: var(--warning); }
.count.fail { background: var(--fail); }
.count.pending { background: var(--pending); }
.state { font-size: 12px; line-height: 18px; border: 1px solid var(--line);
  border-radius: 10px; padding: 0 8px; white-space: nowrap; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.head .state { font-weight: normal; display: inline-block; vertical-align: middle; }
.detail .state { max-width: none; }
.state.active, .state.pushed { color: var(--pending); border-color: var(--pending); }
.state.done { color: var(--success); border-color: var(--success); }
.state.error { color: var(--fail); border-color: var(--fail); }
/* The last patch gets the same space below as every patch above. */
.body { display: none; padding: 0 10px; }
.series.open .body { display: block; }
.info { color: var(--muted); font-size: 12px; padding: 4px 0; }
.info:empty { display: none; }
.patch { border-top: 1px solid var(--line); padding: 3px 0; }
.patch .row { display: flex; gap: 4px 12px; align-items: center; flex-wrap: wrap; }
/* Laid out like the badges next to it: 18px lines plus 1px above and
   below, where badges have their border. */
.patch .pname { font-family: ui-monospace, monospace; font-size: 12px; line-height: 18px;
  padding: 1px 0; flex: 1 1 300px; }
.patch .detail { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center;
  justify-content: flex-end; margin-left: auto; font-size: 12px; }
.patch .detail:empty { display: none; }
/* Check badges look like the state pills, with a light tint of their
   color; the link around a badge must not add a taller line box. */
.detail > a { display: inline-flex; text-decoration: none; }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 8px; font-size: 12px; line-height: 18px; white-space: nowrap;
  color: var(--muted); }
.badge.success { color: var(--success); border-color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent); }
.badge.fail { color: var(--fail); border-color: var(--fail);
  background: color-mix(in srgb, var(--fail) 10%, transparent); }
.badge.warning { color: var(--warning); border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, transparent); }
.badge.pending { color: var(--pending); border-color: var(--pending);
  background: color-mix(in srgb, var(--pending) 10%, transparent); }
a:hover .badge { background: color-mix(in srgb, currentColor 20%, transparent); }
.error { color: var(--fail); font-size: 12px; }
.toggle { font: 11px/16px system-ui, sans-serif; color: var(--muted); background: none;
  border: 1px solid var(--line);
  border-radius: 10px; padding: 0 6px; cursor: pointer; margin-left: 4px; }
.toggle.on { color: var(--fg); border-color: var(--muted); }
.decisions { margin: 2px 0 6px; padding-left: 24px; font-size: 12px; }
.decisions li { margin: 2px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.wide { overflow-x: auto; }
.avail { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.avail th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; }
.avail th, .avail td { padding: 4px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap; }
.avail .num { text-align: right; font-variant-numeric: tabular-nums; }
.avail .up { color: var(--success); }
.avail .down { color: var(--fail); }
.avail .reason { white-space: normal; overflow-wrap: anywhere; }
.avail .timeline { width: 40%; min-width: 200px; }
.days { position: relative; height: 16px; border-radius: 3px; overflow: hidden;
  background: var(--row); }
.days span { position: absolute; bottom: 0; }
.days .recorded { top: 0; background: color-mix(in srgb, var(--success) 22%, transparent); }
.days .short { background: var(--warning-area); }
.days .outage { background: var(--fail); }
.periods td { vertical-align: top; }
.pager { margin: 6px 0; font-size: 13px; }
