:root {
  --bg: #0e1116;
  --surface: #171c24;
  --surface-2: #1f2630;
  --line: #2a3340;
  --text: #e6ebf2;
  --muted: #8b97a7;
  --teal: #5dcaa5;
  --teal-ink: #0f6e56;
  --ink: #04231b;
  --red: #e5736b;
  --amber: #e0b15d;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
header {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
header h1 { font-size: 17px; margin: 0; letter-spacing: .3px; }
header .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
main { max-width: 940px; margin: 0 auto; padding: 24px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 14px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
input, select, button { font: inherit; }
input, select {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 11px; outline: none;
}
input:focus, select:focus { border-color: var(--teal); }
button {
  background: var(--teal); color: #04231b; border: 0; border-radius: 8px;
  padding: 9px 14px; font-weight: 600; cursor: pointer;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
button:disabled { opacity: .4; cursor: not-allowed; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.badge.on { color: var(--teal); border-color: var(--teal-ink); }
.badge.off { color: var(--muted); }
.device {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
  cursor: pointer; background: var(--surface-2);
}
.device.sel { border-color: var(--teal); }
.device small { color: var(--muted); }
.pair { font-size: 26px; letter-spacing: 6px; color: var(--teal); }
.muted { color: var(--muted); }
.cmd { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; }
.cmd:last-child { border-bottom: 0; }
.hint { color: var(--muted); font-size: 13px; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
