/*
 * One page, one stylesheet, with the tokens of the Engelmann bench next door.
 * A machine-produced fact (an address, a device id, a telegram) is set in the
 * mono face. This file is downloaded by whoever opens the page, comments included.
 */

:root {
  --ink: #17191c;
  --ink-quiet: #4a4f57;
  --ink-faint: #767c86;
  --page: #f7f8fa;
  --card: #ffffff;
  --edge: #dfe3e8;
  --accent: #1a5fb4;
  --bad: #b3261e;
  --good: #1c7c48;
  --waiting: #8a5a00;

  --text-caption: 0.75rem;
  --text-small: 0.85rem;
  --text-body: 0.95rem;
  --text-lead: 1.1rem;
  --text-title: 1.5rem;

  --control: 34px;

  --gap-xs: 4px;
  --gap-s: 8px;
  --gap-m: 12px;
  --gap-l: 20px;
  --gap-xl: 32px;

  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: var(--gap-xl) var(--gap-l);
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: 1.5;
}

main, .masthead { max-width: 1400px; margin: 0 auto; }
.masthead h1 { font-size: var(--text-title); margin: 0 0 var(--gap-xs); font-weight: 600; }
.lede { margin: 0 0 var(--gap-l); color: var(--ink-quiet); max-width: 70ch; }

h2 { font-size: var(--text-lead); margin: 0; font-weight: 600; }
h3 { font-size: var(--text-body); margin: 0 0 var(--gap-s); font-weight: 600; }

.panel {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: var(--gap-l);
  margin-bottom: var(--gap-l);
  min-width: 0;
}
.narrow-panel { max-width: 420px; }
.table-panel { padding: 0; overflow-x: auto; }

.field { display: block; margin-bottom: var(--gap-m); }
.label { display: block; font-size: var(--text-small); color: var(--ink-quiet); margin-bottom: var(--gap-xs); }
.hint { color: var(--ink-faint); font-weight: 400; }

input[type=text], input[type=password], input[type=search] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: var(--gap-s) var(--gap-m);
  height: var(--control);
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  font: inherit;
  font-size: var(--text-small);
  height: var(--control);
  padding: 0 var(--gap-m);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { filter: brightness(1.08); }
button[disabled] { opacity: 0.6; cursor: default; }
button.quiet { background: var(--card); color: var(--ink); border-color: var(--edge); }
button.quiet:hover { filter: none; border-color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.wide { width: 100%; }

.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--gap-m); }
.row .grow { flex: 1 1 240px; margin-bottom: 0; }
.row.end { justify-content: flex-end; }
.row.head { align-items: center; margin-bottom: var(--gap-s); }
.spacer { flex: 1 1 auto; }
.check { display: flex; align-items: center; gap: var(--gap-xs); height: var(--control); font-size: var(--text-small); }

.privacy, .note { color: var(--ink-faint); font-size: var(--text-small); margin: var(--gap-s) 0 0; }
.refusal { color: var(--bad); }
.warning { color: var(--waiting); margin: var(--gap-s) 0 0; }

code { font-family: var(--font-mono); font-size: var(--text-small); overflow-wrap: anywhere; }

table { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
th, td { text-align: left; padding: var(--gap-s) var(--gap-m); border-bottom: 1px solid var(--edge); vertical-align: top; }
th { color: var(--ink-quiet); font-weight: 500; }

.facts { display: flex; flex-wrap: wrap; gap: var(--gap-s) var(--gap-xl); color: var(--ink-quiet); margin: 0 0 var(--gap-l); }



dialog { border: 1px solid var(--edge); border-radius: 8px; padding: var(--gap-l); max-width: min(520px, 92vw); }
dialog::backdrop { background: rgb(0 0 0 / 30%); }
dialog p { margin: var(--gap-s) 0; }

@media (max-width: 600px) {
  body { padding: var(--gap-l) var(--gap-m); }
  .panel { padding: var(--gap-m); }
}

/* The title's row: who is signed in, and their buttons. */
.row.top { align-items: center; margin-bottom: var(--gap-xs); }
.row.top h1 { margin: 0; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-s); font-size: var(--text-small); }
.who .role { color: var(--ink-faint); margin-right: var(--gap-s); }

select {
  font: inherit;
  font-size: var(--text-small);
  height: var(--control);
  padding: 0 var(--gap-s);
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
}
.row .narrow { flex: 0 0 auto; margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: var(--gap-s); justify-content: flex-end; }
.link { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-s); margin: var(--gap-m) 0 0; }
.link code { background: var(--page); border: 1px solid var(--edge); border-radius: 6px; padding: var(--gap-xs) var(--gap-s); }
#users td { vertical-align: middle; }


textarea {
  width: 100%;
  font: inherit;
  font-size: var(--text-small);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: var(--gap-s) var(--gap-m);
  resize: vertical;
}

/* The list of readouts, and one readout's meters. */
#readouts tr { cursor: pointer; }
#readouts tr:hover { background: var(--page); }
td.mono, .meters .slave { font-family: var(--font-mono); }
.state-waiting { color: var(--waiting); }
.state-answered { color: var(--good); }
.state-refused, .state-unreachable, .state-lost { color: var(--bad); }
.meters .ok { color: var(--good); }
.meters .not { color: var(--bad); }
.meters .when { color: var(--ink-faint); font-size: var(--text-caption); }
.meters .values { margin: 0; padding: 0; list-style: none; }
.meters .values li { display: flex; gap: var(--gap-s); justify-content: space-between; }
.meters .values .name { color: var(--ink-quiet); }
.meters .values .number { font-family: var(--font-mono); white-space: nowrap; }
.meters details { margin-top: var(--gap-xs); }
.meters summary { cursor: pointer; color: var(--ink-faint); font-size: var(--text-caption); }
.meters .hex { display: block; max-width: 60ch; }
