:root {
  --text: #1d1d1f;
  --muted: #5f6368;
  --background: #ffffff;
  --surface: #f4f5f7;
  --border: #d9dce1;
  --accent: #2457c5;
  --refused: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8eaed;
    --muted: #9aa0a6;
    --background: #16181c;
    --surface: #202328;
    --border: #3a3e45;
    --accent: #8ab4f8;
    --refused: #f2b8b5;
  }
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
header nav a[aria-current="page"] { color: var(--text); text-decoration: none; font-weight: 600; }
header form { margin: 0; }
.home { font-weight: 600; font-size: 18px; }

main { max-width: 960px; margin: 0 auto; padding: 16px; }

a { color: var(--accent); }
a.home { color: var(--text); text-decoration: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }

pre {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
}

input, select { font: inherit; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--background); color: var(--text); max-width: 100%; }
input[type="file"] { padding: 3px 0; border: none; }

button, a.button {
  font: inherit;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--background);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.link { padding: 0; border: none; background: none; color: var(--accent); text-decoration: underline; }

.new-token { padding: 12px 16px; border: 1px solid var(--accent); border-radius: 8px; margin-bottom: 24px; }
form.new-token-form, form.dev-sign-in { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.dev-sign-in p { flex-basis: 100%; margin: 0; color: var(--muted); }

h1 a, h1 a:visited { color: inherit; }
h2 { margin-top: 32px; }
.lead { font-size: 18px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 14px; max-width: 720px; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }
tr.paused td { color: var(--muted); }
.outcome-void, .outcome-leased { color: var(--muted); }
.outcome-line { font-size: 20px; margin-top: 0; }
table.facts { width: auto; }
table.facts th { padding-right: 24px; }
.scrolls { overflow-x: auto; }
table.pairs td { white-space: nowrap; }
table.pairs td.ahead { background: color-mix(in srgb, var(--accent) 14%, transparent); }
table.pairs td.behind { background: color-mix(in srgb, var(--muted) 14%, transparent); }
section.owned { margin-top: 32px; }
td.when, th { white-space: nowrap; }
form.row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
form.row label { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
form.inline { display: inline; margin: 0; }
td.actions { white-space: nowrap; }
td.actions form + form { margin-left: 12px; }
.notice { padding: 8px 12px; border: 1px solid var(--accent); border-radius: 6px; }
.notice.refused { border-color: var(--refused); color: var(--refused); }
form.stacked { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
form.stacked > label { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
form.stacked .note { margin: -4px 0 4px; }
fieldset.limits { border: 1px solid var(--border); border-radius: 6px; margin: 8px 0; padding: 8px 12px; }
fieldset.limits label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; }
fieldset.limits input { width: 9em; }
details summary { cursor: pointer; color: var(--accent); }
details.machine { margin-top: 4px; }
button.secondary { background: none; color: var(--accent); }
.code-to-compare { font: 600 28px/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.08em; margin: 16px 0; }
.retired { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
details.removal { margin-top: 40px; }
