/* Layout: one centered column; a login card first, then the results in quiet panels.
   Color: cool paper neutrals with a deep green accent; status colors stay separate from the accent. */
:root {
  --bg: #f4f6f5;
  --panel: #ffffff;
  --sunk: #eaeeec;
  --fg: #16201c;
  --muted: #5c6a64;
  --line: #d9e0dc;
  --accent: #1f6b52;
  --accent-soft: #d8ebe3;
  --ok: #1d7a46;
  --ok-soft: #dcf1e4;
  --warn: #9a5b00;
  --warn-soft: #fbecd2;
  --bad: #b3261e;
  --bad-soft: #f9dedb;
  --none: #6f7b76;
  --none-soft: #e8ecea;
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 10px;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-3: 2.25rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412;
    --panel: #151d1a;
    --sunk: #1c2622;
    --fg: #e4ebe7;
    --muted: #93a39b;
    --line: #27332e;
    --accent: #5cc49b;
    --accent-soft: #183a2e;
    --ok: #5fd08f;
    --ok-soft: #173525;
    --warn: #f0b552;
    --warn-soft: #3a2c12;
    --bad: #f28b82;
    --bad-soft: #3d1c1a;
    --none: #8d9a94;
    --none-soft: #222c28;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: var(--step-2); font-weight: 600; }
h2 { font-size: var(--step-1); font-weight: 600; }
.wrap { max-width: 64rem; margin-inline: auto; display: grid; gap: 20px; }
.wrap > * { min-width: 0; }
.narrow { max-width: 44rem; }
.eyebrow { font-size: var(--step--1); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.panel-head { display: grid; gap: 2px; }

/* Login */
.login { max-width: 24rem; margin: 8vh auto 0; display: grid; gap: 20px; }
.login form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--step--1); font-weight: 500; }
input[type="text"], input[type="password"], input[type="search"], select {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0;
}
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer;
  background: var(--accent); color: var(--panel);
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-quiet { font: inherit; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn-quiet:hover { background: var(--sunk); }
.login-error { color: var(--bad); font-size: var(--step--1); min-height: 1.5em; margin: 0; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.topbar > div:first-child { display: grid; gap: 4px; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--step--1); font-weight: 500; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-ok { color: var(--ok); background: var(--ok-soft); }
.tone-warn { color: var(--warn); background: var(--warn-soft); }
.tone-bad { color: var(--bad); background: var(--bad-soft); }
.tone-none { color: var(--none); background: var(--none-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: var(--step--1); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; color: var(--muted); }

/* Horizontal bars */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr auto; gap: 12px; align-items: center; }
.bar-row .label { font-size: var(--step--1); overflow-wrap: anywhere; }
.bar-track { height: 12px; border-radius: 999px; background: var(--sunk); overflow: hidden; display: flex; }
.bar-track span { display: block; height: 100%; }
.bar-row .value { font-size: var(--step--1); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 4.5rem; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--step--1); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

.foot { font-size: var(--step--1); color: var(--muted); max-width: 70ch; }

@media (max-width: 520px) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  body { padding-top: max(16px, env(safe-area-inset-top)); }
}
