:root {
  color-scheme: dark;
  --bg: #101314;
  --surface: #171c1f;
  --surface-2: #20272b;
  --line: #344047;
  --text: #e7ecec;
  --muted: #9aa7a8;
  --green: #49d29f;
  --amber: #ffc857;
  --red: #ff5c72;
  --cyan: #6fd3ff;
  --steel: #8fa3b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.topbar {
  min-height: 72px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #121719;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.signal {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #101314 0 26%, transparent 27%),
    conic-gradient(from 24deg, var(--green), var(--cyan), var(--amber), var(--green));
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  font-weight: 650;
}

h2 {
  font-size: 13px;
  font-weight: 650;
  color: var(--steel);
  text-transform: uppercase;
}

.brand p {
  color: var(--muted);
  margin-top: 2px;
}

.profile-tabs {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.profile,
.transport button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.profile.active,
.transport button:hover {
  border-color: var(--cyan);
  background: #16303a;
}

.layout {
  height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
}

.stage {
  min-width: 0;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}

.monitor-head,
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: var(--surface);
}

.monitor-head {
  border-bottom: 1px solid var(--line);
}

.monitor-head div:first-child {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

#camera {
  width: 100%;
  height: 100%;
  display: block;
  background: #111;
}

.transport {
  border-top: 1px solid var(--line);
  justify-content: flex-start;
  flex-wrap: wrap;
  min-height: 58px;
}

.toggle,
.range {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.range input {
  width: 140px;
  accent-color: var(--cyan);
}

output {
  min-width: 40px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.insights {
  min-width: 0;
  overflow: auto;
  background: #111617;
}

.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.strip div {
  min-height: 82px;
  padding: 14px;
  display: grid;
  align-content: center;
  border-right: 1px solid var(--line);
}

.strip div:last-child {
  border-right: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.strip strong {
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.panel {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.pipeline {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 9px;
}

.pipeline li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
}

.pipeline span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #203034;
  color: var(--green);
  font-size: 12px;
}

.pipeline b {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.bars {
  margin-top: 14px;
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px 1fr 56px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.bar-row div {
  height: 8px;
  border-radius: 999px;
  background: #273034;
  overflow: hidden;
}

.bar-row i {
  height: 100%;
  display: block;
  width: 20%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.bar-row b {
  color: var(--text);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.events {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.event {
  min-height: 42px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.event time {
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.event strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.event.alert strong {
  color: var(--red);
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-tabs {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
  }

  .layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .stage {
    height: 68vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .insights {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 17px;
  }

  .stage {
    height: 64vh;
  }

  .transport {
    height: auto;
    min-height: 86px;
    padding: 10px 12px;
  }

  .strip {
    grid-template-columns: 1fr;
  }

  .strip div {
    min-height: 64px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bar-row {
    grid-template-columns: 78px 1fr 52px;
  }
}
