:root {
  --bg: #f5f6f8; --card: #fff; --ink: #14181f; --muted: #5b6573; --line: #dde1e7;
  --accent: #1f5fd1; --ok: #14803c; --warn: #a15c00; --bad: #b3261e; --off: #8a94a3;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151b; --card: #1a2029; --ink: #e8ebf0; --muted: #98a2b1; --line: #2b3441;
          --accent: #6ea0ff; --ok: #4cc27a; --warn: #e0a040; --bad: #ff8a80; --off: #6c7787; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 1.3rem; margin: 8px 0 16px; }
.hint { color: var(--muted); margin: 0 0 14px; }
ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
     display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.name { font-weight: 600; font-size: 1.05rem; }
.status { font-size: .85rem; margin-top: 2px; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--off); display: inline-block; }
.live .dot { background: var(--ok); }
.nosignal .dot { background: var(--bad); }
.sw { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; }
.sw button { all: unset; cursor: pointer; width: 64px; height: 36px; border-radius: 18px; background: var(--off);
             position: relative; transition: background .15s; }
.sw button::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px;
                    border-radius: 50%; background: #fff; transition: transform .15s; }
.sw button[aria-checked="true"] { background: var(--ok); }
.sw button[aria-checked="true"]::after { transform: translateX(28px); }
.sw button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw button[disabled] { opacity: .5; cursor: progress; }
.sw .lbl { font-size: .8rem; font-weight: 600; }
.unconf .lbl { color: var(--warn); }
.banner { background: color-mix(in srgb, var(--warn) 18%, var(--card)); border: 1px solid var(--warn);
          border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
form { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
input { font: inherit; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
button.primary { font: inherit; font-weight: 600; padding: 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
button.link { all: unset; cursor: pointer; color: var(--muted); text-decoration: underline; margin-top: 18px; display: inline-block; }
.msg { color: var(--bad); margin: 0; min-height: 1.2em; }
[hidden] { display: none !important; }
