:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: #14181f;
  --muted: #6b7280;
  --accent: #16a34a;
  --accent-weak: #eafaf0;
  --amber: #f59e0b;
  --danger: #dc2626;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1512; --surface: #16211c; --border: #24312a;
    --text: #e8efe9; --muted: #93a29a; --accent: #4ade80; --accent-weak: #13251b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 18px 60px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
a { color: var(--accent); }

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.topbar .spacer { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }

button {
  font: inherit; border: 0; border-radius: 9px; padding: 10px 16px; cursor: pointer;
  background: var(--accent); color: #06281c; font-weight: 600;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); font-weight: 500; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--border); font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }

input {
  font: inherit; width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); color: var(--text); margin: 6px 0 12px;
}
label.field { display: block; font-size: 13px; color: var(--muted); }

.pwrow { display: flex; gap: 8px; align-items: start; }
.pwrow input { flex: 1; }
.pwbtn { white-space: nowrap; margin: 6px 0 12px; }

.center { min-height: 70vh; display: grid; place-items: center; }
.auth { width: 100%; max-width: 380px; }

.device { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; cursor: pointer; }
.device:hover { border-color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.green { background: var(--accent); } .dot.amber { background: var(--amber); } .dot.red { background: var(--danger); } .dot.grey { background: var(--muted); }
.device .grow { flex: 1; min-width: 0; }
.device .name { font-weight: 600; }

.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; }
.row .t { font-weight: 500; }
.row .d { font-size: 13px; color: var(--muted); }

/* toggle */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--border); border-radius: 26px; transition: .15s; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.radio { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; cursor: pointer; }
.radio input { width: auto; margin: 3px 0 0; }

.pill { font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--accent-weak); color: var(--accent); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }
pre.log { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  padding: 12px; font-size: 12px; color: var(--muted); max-height: 220px; overflow: auto; }
.hidden { display: none !important; }
.enroll { background: var(--accent-weak); border: 1px dashed var(--accent); }
code { background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
