* { box-sizing: border-box; }
body {
  margin: 0;
  background: #0b0d10;
  color: #e6e6e6;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: #14171b;
  border-bottom: 1px solid #23262b;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; white-space: nowrap; }

.branch-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.branch-tabs button {
  background: #1f232a;
  color: #cfd3d8;
  border: 1px solid #2c3138;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
}
.branch-tabs button.active {
  background: #2f7dff;
  color: #fff;
  border-color: #2f7dff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 14px;
}

.cam-tile {
  background: #111418;
  border: 1px solid #22262c;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  cursor: pointer;
}
.cam-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.cam-tile .label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0,0,0,0.55);
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
}
.cam-tile .status {
  position: absolute;
  right: 6px;
  top: 6px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
}
.status.connecting { color: #f5c542; }
.status.live { color: #45d16a; }
.status.error { color: #ff5a5a; }

.modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.modal.hidden { display: none; }

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #14171b;
  border-bottom: 1px solid #23262b;
}
.modal-actions { display: flex; gap: 8px; }
.modal-actions button {
  background: #1f232a;
  color: #e6e6e6;
  border: 1px solid #2c3138;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
}
.modal-actions button:hover { background: #2c3138; }

.zoom-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #000;
  cursor: grab;
  touch-action: none;
}
.zoom-stage.dragging { cursor: grabbing; }
.zoom-stage video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 0 0;
}

.hint {
  text-align: center;
  font-size: 12px;
  color: #8a8f98;
  padding: 6px;
  margin: 0;
  background: #14171b;
}
