/* Plumbline interface.
 *
 * Calm when nothing is wrong: an overview with no problems should look
 * mostly empty. Colour is spent only where it carries meaning, and it is
 * never the only carrier — every state is also named in words, because
 * roughly one man in twelve cannot reliably tell our red from our green.
 */

:root {
  color-scheme: light dark;

  --bg: #fbfbfa;
  --surface: #ffffff;
  --border: #e4e2dd;
  --text: #1c1b19;
  --muted: #6b6862;

  --ok: #1a6b3c;
  --ok-bg: #eef7f1;
  --bad: #9c2a1e;
  --bad-bg: #fdf0ee;
  --ours: #6b5a1a;
  --ours-bg: #fbf6e7;
  --accent: #1f4b8f;

  --radius: 8px;
  --gap: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --surface: #1e1e23;
    --border: #32323a;
    --text: #ececf0;
    --muted: #9c9ca6;

    --ok: #6fd39b;
    --ok-bg: #12261b;
    --bad: #ff9c8d;
    --bad-bg: #2a1512;
    --ours: #e0c76a;
    --ours-bg: #262010;
    --accent: #8fb4ee;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

header.bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.bar .inner {
  max-width: 68rem; margin: 0 auto; padding: 0.85rem 1.25rem;
  display: flex; align-items: center; gap: var(--gap);
}
header.bar strong { font-size: 1.05rem; letter-spacing: -0.01em; }
header.bar nav { margin-left: auto; display: flex; gap: 1.1rem; font-size: 0.93rem; }

main { max-width: 68rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

h1 { font-size: 1.45rem; margin: 0 0 0.35rem; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; margin: 2rem 0 0.75rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.7rem;
}

/* State. Colour plus a word, never colour alone. */
.state {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  white-space: nowrap;
}
.state-ok   { color: var(--ok);   background: var(--ok-bg); }
.state-bad  { color: var(--bad);  background: var(--bad-bg); }
.state-ours { color: var(--ours); background: var(--ours-bg); }
.state-idle { color: var(--muted); background: transparent; border: 1px solid var(--border); }

.site-row { display: flex; align-items: flex-start; gap: var(--gap); }
.site-row .grow { flex: 1; min-width: 0; }
.site-row .url {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.87rem; color: var(--muted);
  overflow-wrap: anywhere;
}
.reason { margin: 0.55rem 0 0; }
.evidence { color: var(--muted); font-size: 0.88rem; margin: 0.3rem 0 0; }

.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 2.5rem 1.25rem; text-align: center; color: var(--muted);
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
td.when { color: var(--muted); white-space: nowrap; }

form.stack { display: flex; flex-direction: column; gap: 0.85rem; max-width: 26rem; }
label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
input, select {
  width: 100%; padding: 0.55rem 0.7rem; font: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
button, .button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.55rem 1rem; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  text-decoration: none; display: inline-block;
}
button.quiet, .button.quiet {
  background: transparent; color: var(--accent);
}

.notice { border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 1.1rem; }
.notice-bad { background: var(--bad-bg); color: var(--bad); }
.notice-ok  { background: var(--ok-bg);  color: var(--ok); }

.steps { padding-left: 1.1rem; }
.steps li { margin-bottom: 0.9rem; }
code.token {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem;
  background: var(--bg); border: 1px solid var(--border);
  padding: 0.15rem 0.4rem; border-radius: 4px; overflow-wrap: anywhere;
}

.auth { max-width: 24rem; margin: 4rem auto; }
footer { color: var(--muted); font-size: 0.85rem; margin-top: 3rem; }

@media (max-width: 40rem) {
  main { padding: 1.25rem 1rem 3rem; }
  header.bar .inner { padding: 0.75rem 1rem; }
  .site-row { flex-direction: column; gap: 0.5rem; }
}
