:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #66717f;
  --line: #d9dee5;
  --accent: #0d6b57;
  --accent-strong: #084d40;
  --danger: #a83232;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.app {
  min-height: 100vh;
}

.panel {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: 0;
}

h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.box,
.created {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.narrow {
  max-width: 560px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.created {
  margin-top: 16px;
}

pre {
  overflow: auto;
  border-radius: 6px;
  background: #17212b;
  color: #f6f8fa;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

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

a {
  color: var(--accent);
  font-weight: 700;
}

.console {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.toolbar strong {
  display: block;
}

.toolbar span,
.toggle {
  color: var(--muted);
  font-size: 14px;
}

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

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.toggle input {
  width: auto;
}

#closeButton {
  background: var(--danger);
}

.stage {
  position: relative;
  overflow: auto;
  outline: none;
  background: #111820;
  cursor: crosshair;
}

#screen {
  display: block;
  width: 100%;
  height: auto;
  min-height: calc(100vh - 64px);
  object-fit: contain;
  user-select: none;
}

#webrtcVideo,
#localPreview {
  display: block;
  width: 100%;
  height: auto;
  background: #111820;
}

#webrtcVideo {
  min-height: calc(100vh - 64px);
  object-fit: contain;
  user-select: none;
}

#localPreview {
  margin: 12px 0;
  border-radius: 6px;
  border: 1px solid var(--line);
}

#empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d8dee9;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
