/* app.css — one stylesheet, no build step, no framework.
   Dark by default because this is a data tool people stare at for long stretches. */

:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c232c;
  --line: #2a323d;
  --text: #e6edf3;
  --dim: #8b98a8;
  --accent: #4b9fff;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fa; --panel: #fff; --panel-2: #f0f3f6; --line: #d8dee4;
    --text: #1f2328; --dim: #636c76; --accent: #0969da;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 1.2rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; letter-spacing: -0.01em; }
h3 { font-size: .92rem; margin: 1.2rem 0 .5rem; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }

/* header */
.top {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem; height: 52px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 650; color: var(--text); letter-spacing: -0.02em; }
.top nav { display: flex; gap: .35rem; flex: 1; }
.top nav a {
  padding: .35rem .7rem; border-radius: 6px; color: var(--dim); font-size: .9rem;
}
.top nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.top nav a.on { background: var(--panel-2); color: var(--text); font-weight: 550; }
.who { display: flex; align-items: center; gap: .8rem; font-size: .85rem; color: var(--dim); }

main { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.5rem 4rem; }

/* cards */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin-bottom: 1.1rem;
}
.note { color: var(--dim); font-size: .85rem; margin: -.4rem 0 .9rem; }
.empty { color: var(--dim); font-style: italic; margin: .3rem 0; }
.crumb { font-size: .85rem; color: var(--dim); margin-bottom: .9rem; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .v { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.stat .l { color: var(--dim); font-size: .82rem; margin-top: .15rem; }
.stat .n { color: var(--dim); font-size: .75rem; margin-top: .3rem; }

/* tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 550; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
td.mono, code { font-family: var(--mono); font-size: .85em; }

/* badges — the stability vocabulary, coloured consistently everywhere */
.badge {
  display: inline-block; padding: .1rem .45rem; border-radius: 4px;
  font-size: .74rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.b-core, .b-locked, .b-ok, .b-exact { background: rgba(63,185,80,.16); color: var(--ok); }
.b-strong, .b-stable, .b-nearverbatim { background: rgba(75,159,255,.16); color: var(--accent); }
.b-volatile, .b-moving, .b-paraphrased, .b-warn, .b-partial { background: rgba(210,153,34,.16); color: var(--warn); }
.b-noise, .b-intermittent, .b-inferred, .b-failed, .b-bad { background: rgba(248,81,73,.16); color: var(--bad); }
.b-running { background: rgba(139,152,168,.16); color: var(--dim); }

/* forms */
label { display: block; font-size: .85rem; color: var(--dim); margin: .8rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: .5rem .65rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
button {
  padding: .5rem .95rem; border-radius: 6px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 550; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button.sec { background: var(--panel-2); color: var(--text); border-color: var(--line); }
button.link { background: none; border: none; color: var(--dim); padding: 0; font-weight: 400; }
button.link:hover { color: var(--text); text-decoration: underline; }
.row { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.row > button { flex: 0 0 auto; }

/* flash */
.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1.1rem; font-size: .9rem; border: 1px solid; }
.flash.info { background: rgba(75,159,255,.1); border-color: rgba(75,159,255,.3); }
.flash.ok { background: rgba(63,185,80,.1); border-color: rgba(63,185,80,.3); }
.flash.error { background: rgba(248,81,73,.1); border-color: rgba(248,81,73,.3); }

/* login */
.login { max-width: 340px; margin: 12vh auto; }
.login .card { padding: 1.5rem; }
.login h1 { font-size: 1.2rem; text-align: center; }
.login button { width: 100%; margin-top: 1.1rem; }

/* warning banner — used when a sample is too thin or diversity too low to trust */
.caveat {
  border-left: 3px solid var(--warn); background: rgba(210,153,34,.08);
  padding: .6rem .9rem; margin: .8rem 0; font-size: .87rem; border-radius: 0 6px 6px 0;
}
.caveat strong { color: var(--warn); }

/* simple inline bar for rates, drawn with a gradient rather than a chart library */
.bar { display: block; height: 4px; border-radius: 2px; background: var(--panel-2); margin-top: .25rem; }
.bar > i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width .4s ease; }

/* key/value block — run parameters, so a finished run still says what it was asked to do */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .1rem .9rem; margin: 0; }
.kv > div { display: flex; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.kv dt { color: var(--dim); min-width: 8.5rem; }
.kv dd { margin: 0; }

/* a form inside a table cell must not inherit the block layout the forms elsewhere rely on */
td form { display: inline; margin: 0; }
textarea { resize: vertical; font-family: inherit; }
