:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: #142442;
  background: #dce7fc;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 85% 10%, #c8c3ff, transparent 55%),
    linear-gradient(145deg, #edf5ff 12%, #aac8f5 60%, #e0e5fa);
}
main {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem);
}
.brand, .panel {
  background: #f7faffd9;
  border: 1px solid #fff;
  border-radius: 1.25rem;
  box-shadow: 0 12px 32px #263d711a;
}
.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: .85rem;
  color: white;
  background: linear-gradient(#3297f2, #184ee4);
  box-shadow: 0 4px 10px #1c56c940;
}
.brand-icon svg { width: 1.65rem; }
.eyebrow { display: block; font-size: .75rem; font-weight: 650; color: #465a7a; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h2 { font-size: 1.125rem; }
.badge {
  margin-inline-start: auto;
  padding: .25rem .65rem;
  border-radius: 1rem;
  background: #e0ebff;
  color: #244677;
  font-size: .8rem;
}
.workspace { display: grid; grid-template-columns: minmax(17rem, 1fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.panel { min-width: 0; padding: clamp(1rem, 3vw, 1.5rem); }
p { margin: .65rem 0 1rem; color: #415674; overflow-wrap: anywhere; }
label { display: block; margin-bottom: .45rem; font-weight: 650; }
.controls { display: grid; gap: .65rem; }
input, button { font: inherit; min-height: 2.75rem; padding: .55rem .75rem; border: 1px solid #8095b5; border-radius: .65rem; }
input { width: 100%; min-width: 0; font: .875rem ui-monospace, monospace; background: white; color: inherit; }
button { background: #f4f8ff; color: #163b73; font-weight: 650; cursor: pointer; }
button[type="submit"] { background: #1758ca; border-color: #1758ca; color: white; }
button:not(:disabled):hover { filter: brightness(.91); }
button:disabled, input:disabled { opacity: .7; cursor: default; }
#leave { background: #fff0f1; border-color: #ba6c78; color: #8d2335; }
:is(input, button):focus-visible, :is(video, canvas):focus, .stage:focus-visible { outline: 3px solid #1758ca; outline-offset: 3px; }
#remote-cursor, #host-cursor {
  position: fixed;
  left: var(--pointer-x);
  top: var(--pointer-y);
  width: 22px;
  height: auto;
  transform: translate(-1.14px, -1.19px);
  pointer-events: none;
  filter: drop-shadow(0 0 2px #459bff) drop-shadow(0 0 1px #1771ee);
}
.stage { position: relative; overflow: auto; aspect-ratio: 16 / 9; background: #101b30; border-radius: .85rem; }
#view-size { display: flex; gap: .5rem; margin-bottom: .75rem; }
#view-size [aria-pressed="true"] { background: #1758ca; border-color: #1758ca; color: white; }
#stats { margin-bottom: .75rem; color: #415674; font-size: .875rem; }
#stats summary { width: fit-content; cursor: pointer; }
#stats summary:focus-visible { outline: 3px solid #1758ca; outline-offset: 3px; }
#stats dl { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; margin: .5rem 0; }
#stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.stage:focus-visible, .stage :is(video, canvas):focus { outline-offset: -3px; }
.stage[data-size="actual"] :is(video, canvas) { width: var(--video-width); height: var(--video-height); max-width: none; aspect-ratio: auto; border-radius: 0; }
:is(video, canvas) { display: block; object-fit: contain; width: 100%; height: 100%; background: #101b30; border-radius: .85rem; }
#display-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1rem;
  color: #d4e2f9;
  text-align: center;
  pointer-events: none;
}

@media (max-width: 44rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .badge { margin-inline-start: 0; }
}
