:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b1f24;
  --muted: #5b6570;
  --line: #dfe3e8;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --ok: #176b3f;
  --err: #a11c2c;
  --busy: #8a6100;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --card: #1d2126;
    --ink: #eceff2;
    --muted: #9aa5b1;
    --line: #303740;
    --accent: #5b9bf3;
    --accent-ink: #10141a;
    --ok: #5cc98d;
    --err: #f4859b;
    --busy: #e0b350;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 42rem;
  margin: 0 auto;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.sub,
.hint,
.footnote,
.who {
  color: var(--muted);
}

.sub {
  margin: 0.25rem 0 2rem;
}

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

h2:first-of-type {
  margin-top: 0;
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

#code {
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

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

button {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

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

button.danger {
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: var(--err);
  background: transparent;
  border: 1px solid var(--err);
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.between {
  justify-content: space-between;
}

.error,
.ok {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.error {
  color: var(--err);
}

.ok {
  color: var(--ok);
}

.installations {
  list-style: none;
  margin: 0;
  padding: 0;
}

.installations li {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.installations li:first-child {
  border-top: 0;
}

.meta {
  min-width: 0;
}

.meta .name {
  font-weight: 600;
}

.meta .detail {
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.state {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.state.online {
  color: var(--ok);
}

.state.offline {
  color: var(--muted);
}

.state.busy {
  color: var(--busy);
}

.footnote {
  margin: 1.5rem 0 0;
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

a {
  color: var(--accent);
}

/* ------------------------------------------------------------------ download page */

/* An <a> styled as the primary action. A link rather than a button because it navigates to
   another origin — the artifact host — and middle-click and "Save link as" should both work. */
.button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 8px;
  text-decoration: none;
}

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Version, file, size, digest. Two columns on anything wider than a phone, stacked below. */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

@media (max-width: 32rem) {
  .facts {
    grid-template-columns: 1fr;
    gap: 0 0;
  }

  .facts dd {
    margin-bottom: 0.6rem;
  }
}

.mono,
code {
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  font-size: 0.85em;
}

.wrap {
  overflow-wrap: anywhere;
}

code {
  padding: 0.1rem 0.3rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.steps,
.facts-list {
  margin: 0;
  padding-left: 1.25rem;
}

.steps li,
.facts-list li {
  margin-bottom: 0.6rem;
}

.steps li:last-child,
.facts-list li:last-child {
  margin-bottom: 0;
}
