/* Base layout */
:root { --bg:#0b0d10; --panel:#13161a; --card:#171b20; --text:#e6ebf0; --muted:#8a99a8; --accent:#4f8cff; --ok:#2ecc71; --warn:#f1c40f; --err:#e74c3c; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji"; background: var(--bg); color: var(--text); }

.topbar { display:flex; align-items:center; justify-content:space-between; padding: 10px 16px; background: #0f1216; border-bottom: 1px solid #1e242c; position: sticky; top: 0; z-index: 10; }
.topbar .brand { font-weight: 700; letter-spacing: .2px; }
.topbar .nav a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.topbar .nav a.active { color: var(--text); }

.container { padding: 16px; max-width: 1200px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid #212833; border-radius: 8px; padding: 12px; margin: 12px 0; }
.row { display:flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1 1 auto; }

label { font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
input { background: #0f1318; border: 1px solid #232a35; color: var(--text); border-radius: 6px; padding: 8px 10px; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,140,255,.2); }

.btn { background: #1a212c; color: var(--text); border: 1px solid #2a3544; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.btn:hover { background: #202838; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: #3f78d8; color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid #242b36; border-radius: 8px; padding: 10px; }

video { width: 100%; height: 100%; background: #000; border-radius: 6px; }
.log { background: #0b0f14; color: #9ee6a9; padding: 8px; border-radius: 6px; min-height: 160px; max-height: 280px; overflow: auto; border: 1px solid #1e2530; }

@media (max-width: 980px) { .grid { grid-template-columns: 1fr; } }
