:root {
  --bg: #14181f; --card: #1f2530; --line: #2e3644; --text: #eef1f5; --muted: #95a0b1;
  --accent: #f2b23a; --ok: #3fbf7f; --bad: #e5604f;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f3f4f6; --card: #fff; --line: #dde1e7; --text: #171b22; --muted: #5f6b7c;
          --accent: #c17d00; color-scheme: light; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
         min-height: 44px; min-width: 44px; padding: 0 14px; }
button:active { transform: scale(.97); }
button.plain { border: 0; background: none; color: var(--muted); }

#login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
#login form { width: 100%; max-width: 340px; display: grid; gap: 14px; }
#login h1 { margin: 0 0 8px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input[type=email], input[type=password] { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; color: var(--text); font-size: 16px; }
#login button[type=submit] { background: var(--accent); color: #14181f; border: 0; font-weight: 600; }
.error { color: var(--bad); min-height: 1.4em; margin: 0; }

header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
         padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
header select { background: none; border: 0; font-weight: 600; font-size: 17px; min-height: 44px; }
.spacer { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.online { background: var(--ok); }
.dot.offline { background: var(--bad); }
.banner { margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--card);
          border: 1px solid var(--bad); }

#rooms { padding: 4px 16px 32px; max-width: 760px; margin: 0 auto; }
section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
             margin: 22px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
        padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 14px; }
.big { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.switch { position: relative; width: 52px; height: 32px; flex: none; border-radius: 16px; padding: 0;
          min-width: 52px; min-height: 32px; background: var(--line); border: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
                 border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true]::after { transform: translateX(20px); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; }
.buttons { display: flex; gap: 6px; }
.buttons button { font-size: 18px; }
.pending { opacity: .55; }
