:root {
  --bg: #f4f6f8; --card: #ffffff; --text: #14181d; --muted: #5d6773; --line: #dde2e8;
  --accent: #0b8f5a; --accent-text: #ffffff; --link: #0a6bb5;
  --ok: #0b8f5a; --bad: #c62828; --warn: #b26a00; --run: #1f5fbf; --idle: #6b7480;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215; --card: #171b20; --text: #e8ecf0; --muted: #9aa5b1; --line: #2a3139;
    --accent: #19b373; --accent-text: #04140c; --link: #6cb6ff;
    --ok: #3ccf8e; --bad: #ff6b6b; --warn: #ffb547; --run: #79a9ff; --idle: #9aa5b1;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); }
header.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px;
  border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.who form { margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 420px; margin: 60px auto; }
h1 { font-size: 22px; margin: 0 0 8px; } h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: var(--bad); }
.mono { font-family: var(--mono); } .wrap { overflow-wrap: anywhere; }
.stack { display: grid; gap: 12px; } .stack label { display: grid; gap: 4px; font-weight: 600; }
input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
button { font: inherit; cursor: pointer; border-radius: 6px; padding: 8px 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
button.big { padding: 11px 18px; font-size: 16px; }
button.link { border: 0; background: none; color: var(--link); padding: 0; }
button:disabled { opacity: .6; cursor: default; }
.row { display: flex; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; gap: 10px; } .gap { gap: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
/* History table: a cell that may break anywhere has a one-letter minimum width, so give the file name a real one
   (and keep IDs and times on one line) — otherwise long names become a one-letter column down the page. */
table.history td.file { min-width: 15rem; overflow-wrap: anywhere; }
table.history td.when, table.history td.id a { white-space: nowrap; }
td.cmd { min-width: 16rem; }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.status.big { font-size: 15px; padding: 4px 12px; }
.s-passed { color: var(--ok); } .s-failed { color: var(--bad); } .s-needs_attention, .s-duplicate { color: var(--warn); }
.s-compiled { color: var(--warn); }
fieldset.modes { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0; display: grid; gap: 8px; }
fieldset.modes legend { font-weight: 600; padding: 0 4px; }
label.choice { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.choice input { margin-top: 4px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 4px 14px; padding-left: 24px; }
.pages[hidden] { display: none; }
.s-running, .s-fixing { color: var(--run); } .s-queued, .s-uploading, .s-cancelled { color: var(--idle); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--warn); color: var(--warn); }
.banner { border-left: 4px solid var(--warn); padding: 8px 12px; background: var(--bg); }
dl.facts { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 10px 0; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; }
.summary { font-weight: 600; }
.archive-latest, .archive-older { font: 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.archive-latest { color: var(--ok); } .archive-older { color: var(--warn); }
.progress-line { display: flex; align-items: center; gap: 10px; margin: 8px 0; } progress { width: 260px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12.5px/1.5 var(--mono); }
pre.log { max-height: 420px; overflow: auto; }
.report-text { max-height: 70vh; overflow: auto; font-size: 13px; }
ul.checks, ul.artifacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
img.thumb { max-width: 180px; border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; }
@media (max-width: 640px) {
  /* Phone: each build becomes a stacked card instead of a 7-column table. */
  table.history thead { display: none; }
  table.history, table.history tbody, table.history tr, table.history td { display: block; width: 100%; }
  table.history tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.history td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; }
  table.history td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-transform: uppercase;
    letter-spacing: .04em; padding-top: 2px; }
  table.history td.file { min-width: 0; font-weight: 600; }
  table.history td.when { white-space: normal; }
  dl.facts { grid-template-columns: 1fr; } dl.facts dt { margin-top: 6px; }
  main { padding: 12px 16px 40px; } progress { width: 160px; }
}
