:root {
  --bg: #0b0d12;
  --panel: #151922;
  --panel-2: #1d2230;
  --line: #2a3040;
  --text: #e8ecf4;
  --muted: #8b93a7;
  --accent: #5b8cff;
  --live: #ff4d5e;
  --ok: #3ddc84;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2033 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.card {
  width: 100%;
  max-width: 420px;
  margin: 32px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
input, select {
  width: 100%; padding: 12px 14px; font-size: 16px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.field { margin-bottom: 16px; }
button {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent); border: 0; border-radius: 12px; cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
button.danger { background: var(--live); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > button { flex: 1 1 140px; width: auto; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 18px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--live); box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); animation: pulse 1.8s infinite; }
.dot.on { background: var(--ok); }
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(255, 77, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); }
}
.meter { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.meter > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #ffd166, var(--live)); transition: width .08s linear; }
.err { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 77, 94, .12); border: 1px solid rgba(255, 77, 94, .35); color: #ffb3bb; font-size: 13px; }
.foot { margin-top: 20px; text-align: center; font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.stat { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 10px 0; border-top: 1px solid var(--line); }
.stat b { color: var(--text); font-weight: 600; }
[hidden] { display: none !important; }
