:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1a1d21;
  --muted: #5b636d;
  --line: #e2e5ea;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --ok: #1a7f43;
  --ok-bg: #e5f5ea;
  --err: #c0332b;
  --err-bg: #fbe9e7;
  --warn: #8a6100;
  --warn-bg: #fdf3d8;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1c2027;
    --ink: #e8ebef;
    --muted: #9aa3ae;
    --line: #2b313a;
    --accent: #5b8dff;
    --ok: #63d18c;
    --ok-bg: #16301f;
    --err: #ff8a7d;
    --err-bg: #3a1c19;
    --warn: #e9c35a;
    --warn-bg: #35300f;
  }
}
:root[data-theme='dark'] {
  --bg: #14171c; --card: #1c2027; --ink: #e8ebef; --muted: #9aa3ae; --line: #2b313a;
  --accent: #5b8dff; --ok: #63d18c; --ok-bg: #16301f; --err: #ff8a7d; --err-bg: #3a1c19;
  --warn: #e9c35a; --warn-bg: #35300f;
}
:root[data-theme='light'] {
  --bg: #f5f6f8; --card: #ffffff; --ink: #1a1d21; --muted: #5b636d; --line: #e2e5ea;
  --accent: #2f6fed; --ok: #1a7f43; --ok-bg: #e5f5ea; --err: #c0332b; --err-bg: #fbe9e7;
  --warn: #8a6100; --warn-bg: #fdf3d8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.site-head { max-width: 720px; margin: 0 auto; padding: 32px 20px 8px; }
.site-head h1 { margin: 0; font-size: 26px; }
.site-head .sub { margin: 4px 0 0; color: var(--muted); }
main { max-width: 720px; margin: 0 auto; padding: 12px 20px 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.card h2 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 700;
}

.row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.field.checkbox { gap: 6px; }
.hint { color: var(--muted); font-size: 12.5px; flex: 1 1 220px; min-width: 200px; }
.field input[type='number'] { width: 76px; }
input[type='number'], input[type='text'] {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
}

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 9px; padding: 9px 16px;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.ghost { background: transparent; }

.pill {
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.pill.on { color: var(--ok); border-color: var(--ok); }

/* The release panel: what this page installs, or why there is nothing. */
#release p { margin: 0; }
#release .label { color: var(--muted); font-size: 13px; }
#release .version { font-size: 22px; font-weight: 700; margin: 2px 0 4px; }
#release .version .muted { font-size: 15px; font-weight: 400; }
.muted { color: var(--muted); }
#steps p.muted { margin: 0 0 10px; }
#steps h2.step2 { margin-top: 26px; }
#steps .hint { display: block; margin-top: 10px; }
details.log-wrap .field { margin-top: 8px; font-size: 13px; }

/* The update log and the dock option: secondary, present but never the first
   thing read. */
details.log-wrap { margin-top: 14px; }
details > summary {
  cursor: pointer; color: var(--muted); font-size: 13px;
  padding: 4px 0; user-select: none;
}
details > summary:hover { color: var(--accent); }

/* Receiver list. Scrolls inside its own box so a narrow window never makes the
   whole page scroll sideways. */
#devices { margin-top: 14px; overflow-x: auto; }
table.devices { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.devices th, table.devices td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.devices th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
table.devices tbody tr:last-child td { border-bottom: 0; }
table.devices tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.devices tr.dim td { opacity: .55; }
table.devices td:first-child, table.devices th:first-child { width: 1%; }

.tag {
  font-size: 11.5px; font-weight: 600; border-radius: 999px;
  padding: 1px 8px; margin-left: 6px; white-space: nowrap;
}
.tag { background: var(--bg); color: var(--muted); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

.info { margin-top: 12px; }
.info.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }

.banner { border-radius: 9px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.banner.err { background: var(--err-bg); color: var(--err); font-weight: 600; }

.progress { margin: 14px 0; }
.bar { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
#bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width .2s; }
.prow { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.log {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap;
  margin: 12px 0 0; color: var(--ink);
}
.log:empty { display: none; }

.site-foot { max-width: 720px; margin: 8px auto 0; color: var(--muted); font-size: 12.5px; }
.site-foot code { font-family: var(--mono); background: var(--bg); padding: 1px 5px; border-radius: 5px; }

.hidden { display: none !important; }
