:root{
  --bg:#0b1220;
  --card:#0f1a2e;
  --card2:#0c1526;
  --text:#e6eefc;
  --muted:#9fb0d0;
  --line:rgba(255,255,255,.08);
  --btn:#2b66ff;
  --btn2:rgba(255,255,255,.08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 30% 10%, rgba(43,102,255,.20), transparent 60%),
              radial-gradient(900px 500px at 70% 30%, rgba(0,255,170,.10), transparent 55%),
              var(--bg);
  color:var(--text);
  display:flex;
  justify-content:center;
  padding:32px 16px;
}

.card{
  width:min(980px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 28%) , var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  padding:18px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}

h1{margin:0;font-size:20px;letter-spacing:.2px}
.sub{color:var(--muted);font-size:13px;margin-top:2px}

button{
  border:1px solid var(--line);
  background: var(--btn2);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
button:hover{filter:brightness(1.08)}
button:active{transform:translateY(1px)}

#btnConnect, #btnSend{
  background: var(--btn);
  border-color: rgba(43,102,255,.45);
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:12px 0;
}

.pill{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  color:var(--muted);
  font-size:12px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
  margin-top:10px;
}

@media (max-width: 720px){
  .grid{grid-template-columns:1fr}
}

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

input, select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: var(--card2);
  color:var(--text);
  outline:none;
}

.hint{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

.grid.small{
  margin-top:12px;
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
}

.label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.debug{
  margin-top:12px;
  border:1px dashed rgba(255,255,255,.18);
  border-radius:14px;
  padding:10px 12px;
  background: rgba(255,255,255,.02);
}
.debug > summary{
  cursor:pointer;
  color:var(--muted);
  font-weight:600;
  user-select:none;
}
.debug[open] > summary{
  color:var(--text);
}

.logHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid var(--line);
}

.log{
  margin:10px 0 0 0;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  height:260px;
  overflow:auto;
  font-size:12px;
  line-height:1.35;
  white-space:pre-wrap;
}
