:root {
  --ground: #eef1f5;  --surface: #fff;      --surface-2: #f3f6fa;
  --ink: #121721;     --muted: #5d6775;     --rule: #d5dbe4;
  --accent: #23407a;  --accent-soft: #dde5f3;
  --ok: #2c6b48;      --ok-soft: #dcebe2;
  --warn: #8a5d0b;    --warn-soft: #f6e9cd;
  --crit: #a3302c;    --crit-soft: #f6dedd;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1219; --surface: #161b25;  --surface-2: #1d2430;
    --ink: #e7ebf2;    --muted: #8e98a8;    --rule: #262e3b;
    --accent: #7fa3e6; --accent-soft: #1b2740;
    --ok: #5fb183;     --ok-soft: #16281f;
    --warn: #d7a83f;   --warn-soft: #2c2313;
    --crit: #e3796f;   --crit-soft: #2e1917;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 22px 64px; }

header.bar {
  background: var(--surface); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
}
/* Three columns with equal-weight outer tracks, so the middle one is centred
   on the PAGE rather than in the space the logo and nav happen to leave. A flex
   row with margin-left:auto cannot do that - the title drifts as the nav grows. */
header.bar .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 10px; padding-bottom: 10px;
  min-height: 56px;
}
.brand {
  grid-column: 1; justify-self: start;
  display: inline-flex; align-items: center;
  text-decoration: none; line-height: 0;   /* kill the inline-image gap */
}
.app-name {
  grid-column: 2; justify-self: center;
  font-size: 15px; font-weight: 650; letter-spacing: -0.005em;
  color: var(--ink); white-space: nowrap;
}
.bar nav {
  grid-column: 3; justify-self: end;
  display: flex; align-items: center; gap: 20px; font-size: 14px;
}
.bar nav form { margin: 0; display: flex; }
.bar nav a {
  text-decoration: none; color: var(--muted); font-weight: 550;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.bar nav a:hover, .bar nav a:focus-visible {
  color: var(--ink); border-bottom-color: var(--accent);
}
/* Matches the links' optical weight instead of shouting like a primary action. */
button.ghost {
  padding: 6px 13px; font-size: 13.5px; font-weight: 550;
  color: var(--muted); background: transparent; border: 1px solid var(--rule);
}
button.ghost:hover { color: var(--ink); border-color: var(--muted); }

/* Narrow screens: the centred name would collide with the nav. */
@media (max-width: 640px) {
  header.bar .wrap { grid-template-columns: auto 1fr; row-gap: 4px; }
  .app-name { grid-column: 1 / -1; grid-row: 2; justify-self: start; font-size: 14px; }
  .bar nav { grid-column: 2; grid-row: 1; gap: 14px; }
}

h1 { font-size: 1.5rem; margin: 22px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 30px 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; }
.tile .n { font-size: 1.5rem; font-weight: 640; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.card + .card { margin-top: 14px; }
.card .pad { padding: 16px 18px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--rule); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
/* The header has to share its column's alignment, or a right-aligned number
   sits under a left-aligned label and the whole column reads as broken. */
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; }
td.nowrap, th.nowrap { white-space: nowrap; }
/* A long file name was stretching its row and shoving every later column
   sideways, so rows no longer lined up with each other. Cap and ellipsize. */
td.vid { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 3px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--rule);
}
.pill.run  { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.ok   { background: var(--ok-soft);     color: var(--ok);     border-color: transparent; }
.pill.warn { background: var(--warn-soft);   color: var(--warn);   border-color: transparent; }
.pill.crit { background: var(--crit-soft);   color: var(--crit);   border-color: transparent; }

form.stack { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
label.field b { color: var(--ink); font-size: 14px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--rule); border-radius: 5px;
  background: var(--surface); color: var(--ink); width: 100%;
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.hint { font-size: 12.5px; color: var(--muted); }

.choice { display: grid; gap: 10px; }
.choice label {
  display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); cursor: pointer;
}
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice .t { font-weight: 600; }
.choice .d { font-size: 13px; color: var(--muted); }

button, .btn {
  font: inherit; font-weight: 550; padding: 9px 16px; border-radius: 5px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--crit); border-color: var(--crit); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.note { border-left: 3px solid var(--warn); background: var(--surface); padding: 13px 16px;
        border-radius: 0 5px 5px 0; border-top: 1px solid var(--rule);
        border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.note.bad { border-left-color: var(--crit); }
.note.good { border-left-color: var(--ok); }

pre.log {
  font-family: var(--mono); font-size: 12px; line-height: 1.6; margin: 0;
  padding: 14px 16px; background: var(--surface-2); border-radius: 5px;
  max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  /* Keeps the view anchored to the bottom as content grows, so new lines push
     upward instead of shifting what you are reading. */
  overflow-anchor: auto;
  scrollbar-gutter: stable;
}
.empty { color: var(--muted); padding: 26px 18px; text-align: center; }
.scroll { overflow-x: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---- brand ---- */
/* The mark is dark navy, which disappears on a dark ground - lift it there
   rather than shipping a second asset. */
.logo { height: 28px; width: auto; display: block; }
.logo-lg { height: 44px; width: auto; display: block; margin-bottom: 18px; }
@media (prefers-color-scheme: dark) {
  .logo, .logo-lg { filter: brightness(0) invert(1) opacity(0.92); }
}

/* ---- the advanced panel, reachable but not advertised ----
   Clients should not see tuning controls; testers still need them. So the
   trigger is a low-contrast dot in the corner rather than a labelled control:
   discoverable if you know it is there, invisible if you don't. Still a real
   button, so it stays keyboard reachable. */
.adv-dot {
  /* Deliberately NOT in the corner. Bottom-right at 0,0 is where every UI puts
     a help or chat launcher, so that is the first place a curious client
     clicks. Inset from both edges it reads as a rendering artefact. */
  position: fixed; right: 246px; bottom: 262px;
  width: 11px; height: 11px; padding: 0; border-radius: 50%;
  background: var(--rule); border: none; cursor: pointer;
  opacity: .45; transition: opacity .15s, transform .15s;
}
.adv-dot:hover, .adv-dot:focus-visible { opacity: 1; transform: scale(1.25); }
.adv-dot[aria-expanded="true"] { background: var(--accent); opacity: 1; }
/* On a narrow window that inset would sit in the middle of the content, so
   pull it back toward the corner where there is empty space. */
@media (max-width: 900px) {
  .adv-dot { right: 24px; bottom: 90px; }
}
.adv-panel { display: none; }
.adv-panel.open { display: block; }
.adv-panel > .inner {
  border: 1px dashed var(--rule); border-radius: 6px;
  padding: 16px 18px; margin-top: 4px; background: var(--surface-2);
}
.adv-panel .tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 12px;
}
