/* The status pages. Colours measured for contrast (docs/status.md): text at
   least 4.5:1 on its background, state colours too, in both modes. A state
   is always a shape and a word; the colour only repeats them, and the state
   colours differ in lightness as well as hue. */
:root {
  color-scheme: light dark;
  --page: #f3f4f6;
  --panel: #ffffff;
  --head: #eef0f3;
  --text: #1f2328;
  --secondary: #59636e;
  --link: #0a55c2;
  --rule: #d8dce2;
  --control: #6e7781;
  --ok: #187236;
  --high: #724200;
  --down: #660f0f;
  --neutral: #697480;
  --warn-edge: #724200;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1116;
    --panel: #161b22;
    --head: #1d232c;
    --text: #e6edf3;
    --secondary: #a3adb9;
    --link: #7cb2ff;
    --rule: #2d343e;
    --control: #8b949e;
    --ok: #6ad48d;
    --high: #f9da86;
    --down: #ff5144;
    --neutral: #97a3b1;
    --warn-edge: #f9da86;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

h1 { font-size: 18px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 6px; }

.top {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}

.bar { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; }

nav a {
  margin-right: 14px;
  text-decoration: none;
  padding-bottom: 2px;
}
nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid currentColor;
}

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tools form { margin: 0; }

button, .button {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--control);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:disabled { cursor: default; opacity: 0.6; }

main { max-width: 1120px; margin: 0 auto; padding: 12px 16px 4px; }

.banner {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--link);
  padding: 8px 12px;
  margin: 0 0 12px;
}
.banner.warn { border-left-color: var(--warn-edge); }

.overall {
  font-size: 17px;
  margin: 0 0 12px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px 6px;
  margin: 0 0 12px;
}

.note, .empty { color: var(--secondary); margin: 0 0 6px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 5px 10px 5px 0; border-top: 1px solid var(--rule); }
thead th { color: var(--secondary); font-weight: 600; border-top: 0; padding-top: 0; }
/* Tables whose rows are named share one width for the names, so the state
   columns line up from panel to panel. */
thead th:empty { width: 24%; }
tbody th { font-weight: 600; }

.badge { font-weight: 600; white-space: nowrap; }
/* The overall line is one long badge: it wraps, so a phone never scrolls
   sideways. */
.overall .badge { white-space: normal; overflow-wrap: anywhere; }
.s-ok { color: var(--ok); }
.s-high { color: var(--high); }
.s-down { color: var(--down); }
.s-stale, .s-unknown { color: var(--neutral); }

/* The shapes: a filled circle for OK, a triangle for High, a square for
   Down, a half-filled circle for Stale, an empty circle for Unknown. */
.shape {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-right: 0.4em;
  background: currentColor;
  vertical-align: -0.05em;
}
.s-ok .shape { border-radius: 50%; }
.s-high .shape { width: 0.85em; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.s-down .shape { border-radius: 1px; }
.s-stale .shape {
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  box-shadow: inset 0 0 0 2px currentColor;
}
.s-unknown .shape { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 2px currentColor; }

footer { max-width: 1120px; margin: 0 auto; padding: 0 16px 24px; color: var(--secondary); font-size: 13px; }

/* Sign-in and short messages. */
.plain main.card {
  max-width: 420px;
  margin: 15vh auto 0;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px;
}
.plain h1 { margin-bottom: 8px; }

/* Phone width: each table row becomes a small block, each cell labelled by
   its column, so nothing scrolls sideways. */
@media (max-width: 700px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { border-top: 1px solid var(--rule); padding: 6px 0; }
  th, td { border: 0; padding: 1px 0; overflow-wrap: anywhere; }
  td[data-label]:not([data-label=""])::before {
    content: attr(data-label) ": ";
    color: var(--secondary);
    font-weight: 400;
  }
  tbody th { font-size: 15px; }
}
