:root {
  color-scheme: light;
  --canvas: #f2f5f2;
  --ink: #172d2b;
  --muted: #526663;
  --paper: #fff;
  --line: #dbe5df;
  --field: #f5f8f5;
  --teal: #146358;
  --teal-ink: #15564d;
  --teal-bg: #e6f3eb;
  --rose: #9d343a;
  --rose-bg: #fbe9eb;
  --amber: #81550c;
  --amber-bg: #fbf0d7;
  font: 400 16px/1.55 Lexend, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #151f1e;
    --ink: #e2eeea;
    --muted: #aec0bb;
    --paper: #1e2b29;
    --line: #354945;
    --field: #243532;
    --teal: #187568;
    --teal-ink: #9de3cd;
    --teal-bg: #25433a;
    --rose: #ffb9be;
    --rose-bg: #472c34;
    --amber: #f3d098;
    --amber-bg: #403727;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--teal-ink); }
:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: 3px; }
.wrap { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 12px; }
.back { font-weight: 650; text-decoration: none; }
.back:hover { text-decoration: underline; }
main { padding-block: clamp(26px, 6vw, 58px) 56px; }
.page-title { margin-bottom: 24px; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 710; letter-spacing: -.045em; line-height: 1.15; }
h2 { font-size: 1.15rem; font-weight: 660; }
.page-title p, .sign-in p, #history-caption { margin-top: 7px; color: var(--muted); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.sign-in { max-width: 600px; padding: 22px; }
.login-fields { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
#login { margin-top: 16px; }
label { font-size: .84rem; font-weight: 610; color: var(--muted); }
input, select, .button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; background: var(--paper); }
input { flex: 1; min-width: 140px; }
.button { font-weight: 630; font-size: .88rem; }
.button:hover, select:hover { background: var(--field); }
.button.primary { background: var(--teal); border-color: var(--teal); color: white; }
.button.primary:hover { filter: brightness(1.12); }
#feedback { color: var(--muted); margin-block: 12px; font-size: .9rem; }
#feedback:empty { display: none; }
#feedback[data-error="true"], .note { color: var(--rose); background: var(--rose-bg); border-radius: 8px; padding: 10px 12px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; margin-bottom: 16px; }
.job { display: grid; justify-items: start; gap: 7px; text-align: left; padding: 14px 16px; min-width: 0; }
.job strong { font-size: .95rem; font-weight: 650; }
.job small { color: var(--muted); }
.job-today {
  display: flex; flex-wrap: wrap; gap: 3px 10px; width: 100%; padding-top: 7px; border-top: 1px solid var(--line);
  font-size: .78rem; font-variant-numeric: tabular-nums;
}
.job-today-ok { color: var(--teal-ink); }
.job-today-error { color: var(--rose); }
.job[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-bg); color: var(--teal-ink); }
.job:hover { border-color: var(--teal); }
.history { overflow: hidden; }
.history-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 16px 20px; }
#history-caption { font-size: .84rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.filters label { display: grid; gap: 3px; }
.note { margin: 0 20px 12px; font-size: .84rem; overflow-wrap: anywhere; }
.runs { border-top: 1px solid var(--line); }
.run { border-bottom: 1px solid var(--line); }
.run:last-child { border-bottom: 0; }
.run > summary {
  padding: 12px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(9em, auto) minmax(4.8em, auto) 1em;
  gap: 8px 14px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.run > summary::-webkit-details-marker { display: none; }
.run > summary:hover, .run[open] > summary { background: var(--field); }
.run-title { overflow-wrap: anywhere; font-size: .92rem; font-weight: 630; }
.run-meta, .run-time, .duration { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.run-time { justify-self: start; }
.duration { justify-self: end; }
.toggle-icon { color: var(--muted); justify-self: end; }
.toggle-icon::before { content: '+'; }
.run[open] .toggle-icon::before { content: '−'; }
.badge { width: fit-content; border-radius: 6px; background: var(--field); padding: 2px 7px; font-weight: 580; font-size: .76rem; white-space: nowrap; }
.badge[data-status="ok"] { background: var(--teal-bg); color: var(--teal-ink); }
.badge[data-status="error"] { background: var(--rose-bg); color: var(--rose); }
.badge[data-status="skipped"], .badge[data-status="incomplete"] { background: var(--amber-bg); color: var(--amber); }
.run-details { padding: 12px 20px 16px; font-size: .86rem; }
.event-list { margin: 8px 0 0; padding: 0; list-style: none; }
.event { display: grid; grid-template-columns: 5.6em 1fr; gap: 8px; padding-block: 6px; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.event:last-child { border-bottom: 0; }
.event time { color: var(--muted); font-variant-numeric: tabular-nums; }
.event[data-error="true"] > span { color: var(--rose); }
.empty { color: var(--muted); padding: 24px 20px; }
.pagination {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--line);
}
.pagination .button:disabled { cursor: default; }
#page-label { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; text-align: center; }
@media (max-width: 670px) {
  .run > summary { grid-template-columns: minmax(0, 1fr) auto 1em; padding: 11px 14px; }
  .run-title { grid-column: 1; }
  .badge { grid-column: 2; }
  .toggle-icon { grid-column: 3; grid-row: 1; }
  .run-time { grid-column: 1; }
  .duration { grid-column: 2; }
  .history-header, .run-details, .pagination { padding-inline: 14px; }
  .pagination { justify-content: center; }
  .pagination .button { padding-inline: 8px; font-size: .78rem; }
}
