:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #1f6feb;
  background: #1f6feb;
  color: white;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary,
.topbar button,
.remote-toolbar button,
select {
  background: white;
  color: #17202a;
  border-color: #c8d0d9;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid #d8dee6;
}

.brand {
  font-size: 20px;
  font-weight: 700;
}

.topbar nav,
.remote-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  background: white;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 28px;
  display: grid;
  gap: 16px;
}

.login-panel h1,
.section-head h1 {
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  color: #425466;
}

input,
select {
  border: 1px solid #c8d0d9;
  border-radius: 6px;
  padding: 10px 12px;
  background: white;
}

.policy {
  grid-template-columns: auto 1fr;
  align-items: center;
  font-size: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}

.device-grid {
  display: grid;
  gap: 12px;
}

.device {
  background: white;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.device h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.device p {
  margin: 4px 0;
  color: #5d6b7a;
}

.device-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  min-width: 58px;
  text-align: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef2f6;
  color: #425466;
}

.status.ok {
  background: #e8f5ee;
  color: #17633a;
}

.status.bad,
.error {
  color: #a32020;
}

.remote-toolbar {
  min-height: 56px;
  margin-bottom: 16px;
}

.remote-toolbar #sessionStatus,
.remote-toolbar #frameRate {
  color: #425466;
}

.stage {
  position: relative;
  min-height: calc(100vh - 170px);
  background: #111820;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
}

.stage img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}

#stageHint {
  position: absolute;
  color: #cad3df;
}

dialog {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  max-width: 620px;
}

dialog form {
  display: grid;
  gap: 14px;
}

.pair-code {
  font-size: 34px;
  letter-spacing: 4px;
  font-weight: 800;
}

pre {
  max-width: 100%;
  overflow: auto;
  background: #f1f4f7;
  border-radius: 6px;
  padding: 12px;
}

.empty {
  padding: 28px;
  color: #5d6b7a;
  background: white;
  border: 1px solid #d8dee6;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .topbar,
  .device,
  .section-head,
  .remote-toolbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
  }

  .topbar {
    padding: 14px;
  }

  .layout {
    padding: 14px;
  }

  .device-actions {
    justify-content: space-between;
  }
}
