:root {
  --navy: #1a2430;
  --navy-2: #243140;
  --panel: #151d27;
  --ink: #f3eee4;
  --muted: #9aa7b5;
  --accent: #e0a070;
  --line: rgba(224, 160, 112, 0.28);
  --dim: #6e7b88;
  --bad: #e07a6a;
  --ok: #8fbf8a;
  --font: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #0e141b;
  color: var(--ink);
  font-family: var(--font);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.top {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: var(--navy);
  border-bottom: 1px solid var(--line);
}
.brand {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}
.brand span { color: var(--accent); }
.product { font-weight: 650; letter-spacing: 0.02em; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.views { margin-left: auto; display: flex; gap: 6px; }
.views button, .engine {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
}
.views button.on {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(224, 160, 112, 0.12);
}
.engine {
  border-color: var(--line);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.engine.live { color: var(--ok); }
.engine.demo { color: var(--accent); }

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: calc(100% - 52px);
  min-height: 0;
}
.rail {
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
  padding: 10px 8px 24px;
}
.group-label {
  margin: 14px 8px 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.cam-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cam-row.on { background: rgba(224, 160, 112, 0.12); }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 auto;
}
.dot.off { background: var(--bad); }
.dot.rec { box-shadow: 0 0 0 3px rgba(224, 122, 106, 0.25); background: #e07a6a; }
.cam-row small { display: block; color: var(--dim); font-size: 11px; }

.stage { min-width: 0; min-height: 0; overflow: auto; padding: 12px; }

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  background: #0a0e13;
  border: 1px solid rgba(224, 160, 112, 0.18);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  padding: 0;
  text-align: left;
}
.tile img, .tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile.offline img { filter: grayscale(0.7) brightness(0.45); }
.tile .stamp {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #f3eee4;
  text-shadow: 0 1px 2px #000;
}
.tile .name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 8px;
  background: linear-gradient(transparent, rgba(8, 10, 14, 0.85));
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.tile .tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.scan {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.08) 2px 3px
  );
  mix-blend-mode: multiply;
}

.focus {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  height: 100%;
}
.focus-main {
  position: relative;
  background: #0a0e13;
  border-radius: 10px;
  overflow: hidden;
  min-height: 240px;
}
.focus-main img, .focus-main video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.strip .tile { width: 180px; flex: 0 0 auto; aspect-ratio: 16 / 9; }

.play {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  min-height: 100%;
}
.play-list button {
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.play-list button.on { border-color: var(--line); }
.player {
  background: #0a0e13;
  border-radius: 10px;
  overflow: hidden;
  min-height: 280px;
  position: relative;
}
.player img, .player video { width: 100%; height: 100%; max-height: 62vh; object-fit: contain; background: #000; }
.note {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 2px;
}

.setup { max-width: 760px; }
.setup h2 { font-size: 18px; font-weight: 650; margin: 0 0 6px; }
.setup p { color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
input, select {
  width: 100%;
  background: #0e141b;
  border: 1px solid rgba(224, 160, 112, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions button, .ghost {
  background: rgba(224, 160, 112, 0.16);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}
.ghost { background: transparent; }
.preset { font-size: 12px; color: var(--dim); margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check input { width: auto; }

@media (max-width: 800px) {
  .top { height: auto; flex-wrap: wrap; padding: 8px 10px; }
  .views { order: 5; width: 100%; margin: 0; }
  .shell { grid-template-columns: 1fr; height: auto; }
  .rail { display: none; }
  .play { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr; }
}
