:root { color-scheme: light; font-family: Inter, "Segoe UI", sans-serif; background: #f4f6f8; color: #1e2935; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 12% 8%, #eaf5f2 0, transparent 34%), #f4f6f8; }
main { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; padding: 20px; }
.connect, .screen { border: 1px solid #e1e8e6; background: #fff; border-radius: 18px; box-shadow: 0 12px 38px rgba(23, 58, 56, .08); }
.connect { padding: 30px; }
.eyebrow { color: #167d68; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 10px 0; font-size: 30px; }
.hint, #status { color: #718096; line-height: 1.5; }
form { display: grid; gap: 10px; margin-top: 30px; }
label { margin-top: 8px; font-size: 13px; color: #53616c; }
input, button, select { width: 100%; min-height: 46px; border-radius: 10px; font: inherit; }
input { border: 1px solid #d7dee2; background: #fff; color: #1e2935; padding: 0 13px; }
input:focus { outline: 0; border-color: #167d68; box-shadow: 0 0 0 3px #eaf5f2; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.password-field button { width: auto; min-width: 86px; margin: 0; padding: 0 14px; background: #eaf5f2; color: #116454; border: 1px solid #c9e4dc; }
.password-field button:hover:not(:disabled) { background: #d8eee8; }
button { margin-top: 12px; border: 0; background: #167d68; color: white; font-weight: 750; cursor: pointer; }
button:hover:not(:disabled) { background: #116454; }
button:disabled { opacity: .55; cursor: wait; }
.screen { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; background: #030509; }
video { display: none; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; outline: none; }
.screen.connected video { display: block; }
.screen.connected #placeholder { display: none; }
#placeholder { color: #8aa19c; text-align: center; padding: 30px; }
.control-bar { display: none; position: absolute; left: 16px; right: 16px; bottom: 16px; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid #41645e; border-radius: 12px; background: rgba(23, 58, 56, .92); backdrop-filter: blur(10px); }
.screen.connected .control-bar { display: flex; }
.control-bar button { width: auto; min-height: 36px; margin: 0; padding: 0 14px; }
.control-bar select { width: auto; min-height: 36px; border: 1px solid #789a94; background: #fff; color: #1e2935; padding: 0 10px; }
.control-bar input { width: 180px; min-height: 36px; padding: 0 10px; }
.toolbar-label { margin: 0; color: #d6e5e1; font-size: 12px; }
.control-bar span { padding-right: 8px; color: #d6e5e1; font-size: 13px; }
#performance-status { color: #8ce0bd; font-variant-numeric: tabular-nums; }
.screen.controlling video { cursor: none; }
#remote-cursor { display: none; position: absolute; z-index: 3; width: 16px; height: 22px; pointer-events: none; transform: translate(-2px, -2px); filter: drop-shadow(0 1px 1px #000); }
#remote-cursor::before { content: ""; display: block; width: 0; height: 0; border-top: 18px solid white; border-right: 11px solid transparent; }
#remote-cursor::after { content: ""; position: absolute; left: 2px; top: 3px; width: 0; height: 0; border-top: 13px solid #111; border-right: 8px solid transparent; }
.screen.controlling #remote-cursor { display: block; }
.screen:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  place-items: stretch;
  background: #030509;
}
.screen:fullscreen video {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.screen:fullscreen .control-bar {
  position: static;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: #173a38;
  backdrop-filter: none;
}
@media (max-width: 760px) { main { grid-template-columns: 1fr; grid-template-rows: auto minmax(320px, 1fr); } }
