/* Spareband dashboard. Colour tokens and fonts match site/index.html exactly. */
:root {
  --sky: #E6EEF5;
  --panel: #F7FAFC;
  --ink: #18273D;
  --muted: #4A5B72;
  --line: #B7C6D6;
  --led: #F2A900;
  --led-ink: #3A2A00;
  --ok: #1E6B52;
  --err: #A3261B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #0F1A2A; --panel: #16243A; --ink: #E3ECF5; --muted: #A2B3C8;
    --line: #2E4260; --led: #FFBE2E; --led-ink: #2A1E00; --ok: #6FD3AE; --err: #FF8A7E;
  }
}
:root[data-theme="dark"] {
  --sky: #0F1A2A; --panel: #16243A; --ink: #E3ECF5; --muted: #A2B3C8;
  --line: #2E4260; --led: #FFBE2E; --led-ink: #2A1E00; --ok: #6FD3AE; --err: #FF8A7E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 18px/1.6 "Atkinson Hyperlegible", system-ui, sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--led); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--panel); padding: 8px 14px; border-radius: 8px; z-index: 2; }
.skip:focus { top: 12px; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 24px 0 0; }
.logo { display: block; flex: none; }
.home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 0; }
.mark { width: 14px; height: 14px; border-radius: 50%; background: var(--led);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--led) 25%, transparent); }
.brand { font: 700 20px/1 "Familjen Grotesk", sans-serif; letter-spacing: -0.01em; }
nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: -12px; }
@media (min-width: 560px) { nav { margin-left: 0; } }
nav a, nav .navbtn { font: 700 16px/1 "Atkinson Hyperlegible", sans-serif; color: var(--ink); text-decoration: none;
  padding: 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; min-height: 0; }
nav a:hover, nav .navbtn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--led); border-radius: 8px 8px 0 0; }
nav form { margin: 0; }

/* type */
h1, h2 { font-family: "Familjen Grotesk", sans-serif; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(32px, 6vw, 44px); line-height: 1.08; margin: 40px 0 14px; overflow-wrap: anywhere; }
h2 { font-size: 22px; line-height: 1.2; margin: 0 0 12px; }
main > section:not(.card) > h2 { margin-top: 40px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 36em; }
.help { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.muted { color: var(--muted); }
.wrap-any { overflow-wrap: anywhere; }
.aside { margin: 20px 0 0; }
.crumb { margin: 32px 0 -28px; font-size: 16px; color: var(--muted); }
footer { margin: 72px 0 40px; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin: 0 0 18px; }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.narrow { max-width: 460px; }
.notice { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 16px; border: 1px solid; }
.notice.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--panel)); }
.notice.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 7%, var(--panel)); }
.notice.warn { color: var(--ink); border-color: color-mix(in srgb, var(--led) 60%, transparent); background: color-mix(in srgb, var(--led) 14%, var(--panel)); }
.empty { color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
@media (min-width: 640px) { .stats { grid-template-columns: 3fr 2fr; } }
.stat p { margin: 0; }
.stat-label { color: var(--muted); font-size: 16px; }
.stat .stat-value { font: 700 40px/1.1 "Familjen Grotesk", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 6px 0 4px; }
.stat .stat-value.usd { font-size: clamp(48px, 10vw, 68px); letter-spacing: -0.03em; }
.stat-sub { color: var(--muted); font-size: 16px; }
.payout p { margin: 12px 0 0; font-size: 16px; color: var(--muted); }

/* bars are <progress>: no inline styles, so the CSP needs no 'unsafe-inline' */
progress.bar { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 5px;
  background: color-mix(in srgb, var(--line) 55%, transparent); overflow: hidden; display: block; }
progress.bar.big { height: 14px; border-radius: 7px; }
progress.bar::-webkit-progress-bar { background: color-mix(in srgb, var(--line) 55%, transparent); border-radius: inherit; }
progress.bar::-webkit-progress-value { background: var(--led); border-radius: inherit; }
progress.bar::-moz-progress-bar { background: var(--led); border-radius: inherit; }

ol.days { list-style: none; padding: 0; margin: 12px 0 0; }
ol.days li { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 4px 14px;
  padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: 16px; }
ol.days li:first-child { border-top: 0; }
ol.days .amt { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
@media (max-width: 480px) {
  ol.days li { grid-template-columns: 1fr auto; }
  ol.days progress { grid-column: 1 / -1; grid-row: 2; }
}

/* devices */
ul.devices { list-style: none; margin: 0 0 28px; padding: 0; }
.device-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.device-name { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.device-meta { margin: 8px 0 14px; font-size: 16px; }
.state { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.state-online { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.state-online .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.state-idle .dot { background: var(--led); }
.state-off { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.state-off .dot { background: var(--err); }

/* forms */
.form .field { margin: 0 0 18px; }
label { font-weight: 700; display: block; margin: 0 0 6px; font-size: 16px; }
input:not([type=checkbox]), select { font: inherit; font-size: 17px; color: var(--ink); background: var(--sky);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%; max-width: 100%; min-height: 48px; }
input::placeholder { color: var(--muted); opacity: .8; }
button, .btn { font: 700 17px/1 "Atkinson Hyperlegible", sans-serif; background: var(--led); color: var(--led-ink);
  border: 1px solid transparent; border-radius: 10px; padding: 14px 22px; cursor: pointer; display: inline-block; text-decoration: none; }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--ink); }
button.destructive { background: var(--err); color: var(--panel); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 18px; }

/* settings */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 18px; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 48px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); transition: transform .15s; }
.switch input:checked + .track { background: var(--led); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--led); outline-offset: 3px; }

fieldset.window { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 2px; margin: 0 0 14px; min-width: 0; }
fieldset.window legend { font-weight: 700; font-size: 16px; padding: 0 6px; }
.days-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.chip { margin: 0; position: relative; font-weight: 400; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span[aria-hidden] { display: inline-block; min-width: 48px; text-align: center; padding: 8px 8px; border-radius: 8px;
  border: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.chip input:checked + span { background: var(--ink); color: var(--panel); border-color: var(--ink); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--led); outline-offset: 2px; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.caps { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) { .caps { grid-template-columns: repeat(3, 1fr); } }
details.more { margin: 6px 0 4px; }
details.more summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
details.more[open] summary { margin-bottom: 10px; }
.danger form { margin: 10px 0 0; }
.danger .form .field { margin-bottom: 14px; }

/* install command */
pre.cmd { background: var(--ink); color: var(--panel); border-radius: 10px; padding: 14px 16px; margin: 0 0 12px;
  white-space: pre-wrap; word-break: break-all; font: 15px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.copied { min-height: 1.4em; margin: 6px 0 12px; font-size: 15px; color: var(--ok); }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .card { padding: 18px 16px; }
  h1 { margin-top: 28px; }
  .crumb { margin: 24px 0 -20px; }
}
