/* Internet Snapshots admin. Chart-paper palette: cool paper, survey-ink navy, three signal colours.
   The run strip (a seismograph of each job's recent runs) is the one expressive element. */
:root {
  --paper: #eef2f4;
  --sheet: #f8fafb;
  --ink: #14212b;
  --ink-2: #4a5b68;
  --ink-3: #7a8a96;
  --rule: #c9d3d9;
  --rule-2: #dde4e8;
  --link: #1f5f8b;
  --ok: #2e7d6b;
  --warn: #b7791f;
  --fail: #b23a3a;
  --idle: #9fb0bb;
  --focus: #1f5f8b;
  --sel: #dcebf5;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a21; --sheet: #15232c; --ink: #d6e1e7; --ink-2: #9db0bc; --ink-3: #6f8593;
    --rule: #2a3c48; --rule-2: #20313b; --link: #7fb6dc; --ok: #5fb39c; --warn: #d9a54a; --fail: #e07a72;
    --idle: #4b5f6c; --focus: #7fb6dc; --sel: #1d3646; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--sans);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 650; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 650; margin: 2rem 0 .6rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 1.2rem 0 .4rem; }
p { margin: .4rem 0 .8rem; max-width: 72ch; }
code, pre, .mono { font-family: var(--mono); font-size: .87em; }
small, .quiet { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* layout */
.shell { display: grid; grid-template-columns: 13.5rem 1fr; min-height: 100vh; }
.nav { border-right: 1px solid var(--rule); padding: 1.2rem 0; position: sticky; top: 0; height: 100vh; background: var(--paper); }
.brand { display: flex; align-items: center; gap: .6rem; padding: 0 1.2rem 1.2rem; font-weight: 650; }
.brand svg { flex: none; }
.nav a { display: block; padding: .38rem 1.2rem; color: var(--ink-2); border-left: 3px solid transparent; }
.nav a:hover { color: var(--ink); text-decoration: none; background: var(--rule-2); }
.nav a.on { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }
.nav form { padding: 1rem 1.2rem; }
.nav .who { padding: 0 1.2rem; color: var(--ink-3); font-size: .85rem; margin-top: 1.5rem; }
main { padding: 1.6rem 2rem 4rem; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lede { color: var(--ink-2); margin: 0; }

/* figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 1rem 0 0; }
.figure { padding: .9rem 1rem .8rem 0; }
.figure + .figure { padding-left: 1rem; border-left: 1px solid var(--rule-2); }
.figure b { display: block; font-size: 1.55rem; font-weight: 600; line-height: 1.15; }
.figure span { color: var(--ink-2); font-size: .88rem; }
.figure.bad b { color: var(--fail); }
.figure.warn b { color: var(--warn); }

/* tables */
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .85rem; padding: .55rem .7rem;
  border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--sheet); position: sticky; top: 0; }
td { padding: .5rem .7rem; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.selected td { background: var(--sel); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; word-break: break-word; max-width: 40ch; }
.nowrap { white-space: nowrap; }

/* status */
.st { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.st::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--idle); }
.st.ok::before { background: var(--ok); }
.st.partial::before, .st.paused::before { background: var(--warn); }
.st.error::before, .st.timeout::before { background: var(--fail); }
.st.disabled { color: var(--ink-3); }

/* the run strip: recent runs, oldest left */
.strip { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.1rem; vertical-align: middle; }
.strip i { display: block; width: 3px; height: 45%; background: var(--idle); border-radius: 1px; }
.strip i.ok { background: var(--ok); height: 55%; }
.strip i.partial { background: var(--warn); height: 80%; }
.strip i.error, .strip i.timeout { background: var(--fail); height: 100%; }
.strip i.running { background: var(--link); height: 70%; }

/* forms */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 5px; padding: .42rem .55rem; min-width: 0; }
textarea { width: 100%; font-family: var(--mono); font-size: .85rem; min-height: 7rem; }
label { display: block; font-size: .88rem; color: var(--ink-2); margin: .6rem 0 .2rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--ink); }
.btn { display: inline-block; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 5px;
  padding: .42rem .85rem; cursor: pointer; font-weight: 550; }
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.quiet:hover { border-color: var(--ink-2); }
.btn.danger { background: transparent; color: var(--fail); border-color: var(--fail); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 2rem; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: .4rem 1.1rem 1.1rem; margin-bottom: 1.2rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.2rem; margin: .6rem 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* bulk bar appears when jobs are selected */
.bulk { position: sticky; bottom: 0; margin-top: 1rem; background: var(--ink); color: var(--paper); border-radius: 6px;
  padding: .7rem 1rem; display: none; gap: .6rem; align-items: center; flex-wrap: wrap; }
.bulk.on { display: flex; }
.bulk select, .bulk input { background: var(--paper); color: var(--ink); border-color: transparent; }
.bulk .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.bulk [data-for] { display: none; }
.bulk [data-for].on { display: inline-flex; gap: .4rem; align-items: center; }

.flash { background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--link); padding: .6rem .9rem;
  border-radius: 5px; margin-bottom: 1rem; }
.error-box { border-left-color: var(--fail); }
pre.body { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem; overflow: auto;
  max-height: 70vh; white-space: pre-wrap; word-break: break-word; }
.tag { display: inline-block; font-size: .8rem; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px; padding: 0 .35rem; margin: 0 .2rem .15rem 0; }

/* login */
.login { max-width: 23rem; margin: 12vh auto; padding: 0 1.2rem; }
.login .brand { padding: 0 0 1.4rem; font-size: 1.1rem; }
.login input { width: 100%; }
.login .btn { width: 100%; margin-top: 1.1rem; padding: .6rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; padding: .6rem; }
  .nav .brand { width: 100%; padding: .2rem .6rem .6rem; }
  .nav a { border-left: 0; padding: .3rem .6rem; }
  .nav .who, .nav form { display: none; }
  main { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* utility classes (inline styles are blocked by the CSP) */
.full { width: 100%; }
textarea.short { min-height: 4rem; }
.err { color: var(--fail); }
.foot { margin-top: 3rem; }
.narrow { width: 6rem; }

/* captured-data charts */
.chartbox { margin: .4rem 0 1.4rem; max-width: 760px; }
.chartbox figcaption { font-size: .88rem; color: var(--ink-2); margin-bottom: .2rem; }
.chart { width: 100%; height: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; }
.chart .grid { stroke: var(--rule-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--sans); }
.chart .line { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.chart .s1 { stroke: var(--link); fill: var(--link); }
.chart .s2 { stroke: var(--ok); fill: var(--ok); }
.chart .s3 { stroke: var(--warn); fill: var(--warn); }
.chart .line.s1, .chart .line.s2, .chart .line.s3 { fill: none; }
.key { margin-left: .8rem; white-space: nowrap; }
.key::before { content: ""; display: inline-block; width: .9rem; height: 3px; margin-right: .3rem; vertical-align: middle; background: var(--link); }
.key.s2::before { background: var(--ok); }
.key.s3::before { background: var(--warn); }

/* coverage grid: one cell per day */
.cov td.cell { padding: 0; width: 1.05rem; min-width: 1.05rem; border: 1px solid var(--paper); text-align: center; }
.cov td.cell a, .cov td.cell span { display: block; height: 1.3rem; }
.cov td.cell.none span { background: var(--rule-2); }
.cov td.cell.ok a { background: var(--ok); }
.cov td.cell.partial a { background: var(--warn); }
.cov td.cell.error a { background: var(--fail); }
.cov th.day { padding: .3rem 0; font-size: .7rem; font-weight: 500; text-align: center; color: var(--ink-3); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); margin: .4rem 0 1rem; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.legend .ok { background: var(--ok); } .legend .partial { background: var(--warn); }
.legend .error { background: var(--fail); } .legend .none { background: var(--rule-2); }
.st.deferred::before { background: var(--link); }
.strip i.deferred { background: var(--link); height: 35%; }
.st.interrupted::before { background: var(--ink-3); }
.strip i.interrupted { background: var(--ink-3); height: 35%; }
