/*
 * One stylesheet, no framework, no web font.
 *
 * The Content-Security-Policy on this page allows nothing from another origin,
 * which rules out a CDN stylesheet or a Google font by construction. That is
 * the right trade for an ops page that sits behind a credential: it loads on a
 * bad connection, it cannot leak a referrer to a third party, and there is
 * nothing to break when someone else's CDN has an outage.
 */

:root {
  color-scheme: dark;

  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b232d;
  --line: #263140;
  --line-soft: #1e2733;

  --text: #e6edf3;
  --muted: #8b98a5;
  --dim: #63707e;

  --accent: #4c8dff;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --idle: #6e7681;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.updated {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.toggle input { accent-color: var(--accent); cursor: pointer; }

button {
  font: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; border-color: var(--line); }

/* -------------------------------------------------------------- identity */

/*
 * Who is looking, in the top-right. Monospace because it is a GitHub login and
 * reads as an identifier, not as prose — the same treatment every other
 * identifier on this page gets.
 */
.who {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* "auth disabled" is not a status to notice in passing. */
.who.warn { color: var(--warn); }

/* ----------------------------------------------------------------- pills */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.pill b { color: var(--text); font-weight: 500; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
  flex: none;
}

.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.info { background: var(--accent); }

/* ------------------------------------------------------------------ main */

main { padding: 18px 24px 48px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.card.wide { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
}

.card-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-note { font-size: 11px; color: var(--dim); text-align: right; }

/* -------------------------------------------------------------- kv rows */

.kv { display: block; padding: 4px 0; }

.row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.row:last-child { border-bottom: none; }

.row > .k { color: var(--muted); font-size: 12px; flex: none; }

.row > .v {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.v.mono, .addr { font-family: var(--mono); font-size: 12px; }
.v.big { font-size: 16px; font-weight: 600; }
.v.ok { color: var(--ok); }
.v.warn { color: var(--warn); }
.v.bad { color: var(--bad); }
.v.dim { color: var(--dim); }

.sub { display: block; font-size: 11px; color: var(--dim); font-weight: 400; }

/* ------------------------------------------------------------- addresses */

.addr-wrap { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }

a.addr, a.hash {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
}

a.addr:hover, a.hash:hover { text-decoration: underline; }

.copy {
  border: none;
  background: none;
  color: var(--dim);
  padding: 0 2px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.copy:hover { color: var(--text); }
.copy.done { color: var(--ok); }

.tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.tag.active { color: var(--ok); border-color: rgba(63, 185, 80, 0.4); }

/* ------------------------------------------------------------------- bar */

.bar {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin: 2px 16px 10px;
}

.bar > span { display: block; height: 100%; background: var(--accent); }
.bar > span.full { background: var(--ok); }

/* -------------------------------------------------------------- banners */

.banner {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  background: var(--panel);
}

.banner b { display: block; margin-bottom: 2px; font-weight: 600; }
.banner.bad { border-left-color: var(--bad); }
.banner.warn { border-left-color: var(--warn); }
.banner.info { border-left-color: var(--accent); }
.banner code { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* -------------------------------------------------------------- history */

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }

th, td {
  text-align: right;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--panel-2);
  position: sticky;
  top: 0;
}

th:first-child, td:first-child { text-align: left; }

tbody tr:hover { background: var(--panel-2); }

tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: none;
  color: var(--text);
}

td.num { font-variant-numeric: tabular-nums; }

.status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status.applied { color: var(--ok); }
.status.other { color: var(--bad); }

.empty { padding: 24px 16px; color: var(--dim); font-size: 13px; }

.foot {
  margin-top: 22px;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.7;
}

@media (max-width: 640px) {
  .topbar, .pills, main { padding-left: 14px; padding-right: 14px; }
  .row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .row > .v { text-align: left; }
  .addr-wrap { justify-content: flex-start; }
}

/* ------------------------------------------------------------- sign-in */

/*
 * The sign-in page shares this stylesheet rather than carrying its own. It is
 * the one asset served without a credential, which is also why it holds nothing
 * but layout: a stylesheet that leaked a hostname or an address would be doing
 * so to anyone who asked.
 */
.login-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login { width: 100%; max-width: 420px; }

.login-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 28px 26px 22px;
  text-align: center;
}

.login-card h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.login-sub {
  margin: 4px 0 22px;
  font-size: 12px;
  color: var(--muted);
}

.gh-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.gh-button:hover { border-color: var(--accent); }

.login-foot {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.45;
}

/*
 * Left-aligned inside a centred card, and deliberately so: these are two or
 * three sentences of instruction, and centred prose is markedly harder to read
 * than centred labels.
 */
.login-error {
  text-align: left;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-left-color: var(--warn);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 11px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}

.login-error b { display: block; margin-bottom: 4px; font-weight: 600; }
.login-error p { margin: 0; color: var(--muted); line-height: 1.5; }
