:root {
  color-scheme: dark;
  --bg: #101215;
  --panel: #181c20;
  --panel-2: #20262b;
  --text: #f4f2ec;
  --muted: #aab0b5;
  --line: #30363d;
  --accent: #52c7a0;
  --danger: #ff8878;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: #07120e;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.button-link {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 18px;
  color: var(--text);
  text-decoration: none;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 380px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-panel h1 {
  margin: 0 0 24px;
  font-size: 24px;
}

.login-panel form {
  display: grid;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #0c0f12;
  color: var(--text);
}

.error {
  margin: 0;
  color: var(--danger);
}

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

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.viewer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 16px;
}

.stream-stage {
  position: relative;
  min-height: calc(100vh - 104px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #050607;
}

.stream-stage:fullscreen {
  border: 0;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
}

.stream-stage img {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 104px);
  object-fit: contain;
  display: none;
}

#empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.metrics {
  display: grid;
  align-content: start;
  gap: 12px;
}

.metrics div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  font-size: 18px;
}

.demo-shell {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.demo-shell canvas {
  width: min(100%, 1100px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050607;
}

.demo-actions {
  display: flex;
  gap: 10px;
}

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

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .viewer-shell {
    grid-template-columns: 1fr;
  }

  .stream-stage,
  .stream-stage img {
    min-height: 55vh;
  }
}
