body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:#0b1220;
  color:#e7ecf3;
  margin:0;
  padding:16px;
}

.card{
  max-width:960px;
  margin:0 auto;
  background:#111a2b;
  padding:24px;
  border-radius:16px;
  box-shadow:0 6px 30px rgba(0,0,0,.3);
}

h1{
  margin:0 0 8px 0;
  font-size:24px;
}

h2{
  margin:12px 0 8px;
  font-size:18px;
}

.subtitle{
  margin:0 0 16px;
  font-size:14px;
  color:#9ca3af;
}

.layout{
  display:flex;
  flex-wrap:wrap;
  gap:18px;
}

.video-panel,
.controls-panel{
  flex:1 1 280px;
  min-width:0;
}

.cam-frame{
  position:relative;
  background:#020617;
  border-radius:12px;
  overflow:hidden;
  min-height:200px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.cam-frame img{
  width:100%;
  display:block;
  max-height:360px;
  object-fit:contain;
}

.cam-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(to bottom,rgba(15,23,42,.9),rgba(15,23,42,.9));
  font-size:14px;
  color:#e5e7eb;
  text-align:center;
  padding:12px;
}

.cam-frame img.cam-has-image + .cam-overlay{
  background:linear-gradient(to top,rgba(15,23,42,.9),rgba(15,23,42,.0));
  align-items:flex-start;
  justify-content:flex-end;
  padding:8px 10px;
  font-size:12px;
  color:#cbd5f5;
}

.cam-info{
  margin:8px 0 0;
  font-size:13px;
  color:#9ca3af;
}

.status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 10px;
  border-radius:999px;
  font-size:12px;
}

.status-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#4b5563;
}

.status-online{
  background:rgba(34,197,94,.15);
  color:#bbf7d0;
}

.status-online .status-dot{
  background:#22c55e;
}

.status-offline{
  background:rgba(239,68,68,.15);
  color:#fecaca;
}

.status-offline .status-dot{
  background:#ef4444;
}

.hint{
  margin:0 0 10px;
  font-size:13px;
  color:#9ca3af;
}

.gpio-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:10px;
  margin-bottom:12px;
}

button,
.gpio-btn{
  padding:10px 16px;
  border:0;
  border-radius:10px;
  background:#2b86ff;
  color:#fff;
  font-weight:600;
  cursor:pointer;
  font-size:14px;
}

button:hover,
.gpio-btn:hover{
  filter:brightness(1.08);
}

button:disabled,
.gpio-btn:disabled{
  opacity:0.6;
  cursor:default;
}

pre{
  background:#0a1020;
  border-radius:10px;
  padding:12px;
  white-space:pre-wrap;
  font-size:12px;
  max-height:260px;
  overflow:auto;
  margin:0;
}

@media (max-width:600px){
  .card{
    padding:16px;
  }
}
