/* FOXY multi-camera wall: dialog, session picker and live grid. */
.fx-mc-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  margin-left: 8px;
  border: 1px solid var(--fx-line);
  border-radius: 10px;
  background: var(--fx-subtle);
  color: var(--fx-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fx-mc-launch:hover { border-color: var(--fx-accent); color: var(--fx-accent); }
.fx-mc-icon { width: 18px; height: 18px; flex: none; }

.fx-mc-dialog {
  width: min(1180px, 96vw);
  max-width: 96vw;
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--fx-line);
  border-radius: 18px;
  background: var(--fx-surface);
  color: var(--fx-text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
.fx-mc-dialog::backdrop { background: rgba(0, 0, 0, .58); backdrop-filter: blur(3px); }
.fx-mc-dialog[open] { display: flex; flex-direction: column; }

.fx-mc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
}
.fx-mc-head h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.fx-mc-head p { margin: 4px 0 0; color: var(--fx-muted); font-size: 13px; }
.fx-mc-close {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--fx-line);
  border-radius: 10px;
  background: transparent;
  color: var(--fx-muted);
  cursor: pointer;
}
.fx-mc-close:hover { color: var(--fx-text); border-color: var(--fx-accent); }

.fx-mc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--fx-line);
  color: var(--fx-muted);
  font-size: 13px;
}
.fx-mc-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.fx-mc-toolbar select {
  height: 34px; min-width: 64px;
  border: 1px solid var(--fx-line); border-radius: 9px;
  background: var(--fx-bg); color: var(--fx-text);
  font: inherit; padding: 0 8px;
}
.fx-mc-toolbar button[data-mc-refresh],
.fx-mc-toolbar button[data-mc-stop-all] {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--fx-line); border-radius: 9px;
  background: var(--fx-subtle); color: var(--fx-text);
  font: inherit; font-size: 13px; cursor: pointer;
}
.fx-mc-toolbar button[data-mc-stop-all] { margin-left: auto; color: #ff8a80; border-color: rgba(255, 138, 128, .45); }
.fx-mc-toolbar button:hover { border-color: var(--fx-accent); }
.fx-mc-check input { accent-color: var(--fx-accent); }

.fx-mc-body {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 20px 20px;
  min-height: 0;
  overflow: auto;
}
.fx-mc-side { display: flex; flex-direction: column; min-height: 0; }
.fx-mc-side h3 { margin: 0 0 8px; font-size: 14px; }
.fx-mc-sessions {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 58vh; overflow: auto; padding-right: 4px;
}
.fx-mc-session {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--fx-line);
  border-radius: 10px;
  background: var(--fx-subtle);
  cursor: pointer;
}
.fx-mc-session:hover { border-color: var(--fx-accent); }
.fx-mc-session.is-on { border-color: var(--fx-accent); box-shadow: inset 0 0 0 1px var(--fx-accent); }
.fx-mc-session input { margin-top: 3px; accent-color: var(--fx-accent); }
.fx-mc-session-text { display: flex; flex-direction: column; min-width: 0; }
.fx-mc-session-text strong { font-size: 13px; overflow-wrap: anywhere; }
.fx-mc-session-text small { color: var(--fx-muted); font-size: 11px; overflow-wrap: anywhere; }
.fx-mc-note { margin: 10px 0 0; color: var(--fx-muted); font-size: 12px; }
.fx-mc-empty { margin: 0; color: var(--fx-muted); font-size: 13px; }

.fx-mc-main { min-width: 0; display: flex; flex-direction: column; }
.fx-mc-grid {
  display: grid;
  grid-template-columns: repeat(var(--mc-cols, 2), minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}
.fx-mc-grid-empty { margin: 24px 0; color: var(--fx-muted); font-size: 13px; text-align: center; }

.fx-mc-tile {
  display: flex; flex-direction: column;
  min-width: 0;
  border: 1px solid var(--fx-line);
  border-radius: 14px;
  background: var(--fx-subtle);
  overflow: hidden;
}
.fx-mc-tile[data-state="live"] { border-color: var(--fx-accent); }
.fx-mc-tile[data-state="error"] { border-color: #e35d5d; }
.fx-mc-tile-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 8px; min-width: 0; }
.fx-mc-tile-head strong { font-size: 13px; overflow-wrap: anywhere; }
.fx-mc-tile-head span { color: var(--fx-muted); font-size: 11px; overflow-wrap: anywhere; }
.fx-mc-screen { position: relative; aspect-ratio: 16 / 9; background: #0a0a0c; }
.fx-mc-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-mc-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--fx-muted); font-size: 12px;
}
.fx-mc-tile[data-state="live"] .fx-mc-placeholder { display: none; }
.fx-mc-tile-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 10px;
}
.fx-mc-state { color: var(--fx-muted); font-size: 11px; overflow-wrap: anywhere; }
.fx-mc-tile[data-state="live"] .fx-mc-state { color: var(--fx-accent); }
.fx-mc-tile[data-state="error"] .fx-mc-state { color: #ff8a80; }
.fx-mc-actions { display: inline-flex; gap: 6px; flex: none; }
.fx-mc-actions button {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 9px;
  border: 1px solid var(--fx-line); border-radius: 8px;
  background: transparent; color: var(--fx-text);
  font: inherit; font-size: 12px; cursor: pointer;
}
.fx-mc-actions button:hover { border-color: var(--fx-accent); }
.fx-mc-actions button.is-on { color: var(--fx-accent); border-color: var(--fx-accent); }
.fx-mc-actions .fx-mc-icon { width: 15px; height: 15px; }

@media (max-width: 1000px) {
  .fx-mc-body { grid-template-columns: minmax(0, 1fr); }
  .fx-mc-sessions { max-height: 28vh; }
  .fx-mc-grid { grid-template-columns: repeat(min(var(--mc-cols, 2), 2), minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .fx-mc-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
  .fx-mc-toolbar button[data-mc-stop-all] { margin-left: 0; }
  .fx-mc-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .fx-mc-launch span { display: none; }
}

.fx-mc-actions button[hidden] { display: none; }
