:root {
  font: 16px/1.5 system-ui, "Microsoft YaHei UI", sans-serif;
  color: #f1f5f9;
  background: #101820;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid #33434d;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mark { width: 17px; height: 13px; border: 2px solid #6de5c5; border-radius: 3px; }
.badge { font-size: .84rem; color: #b9d0d7; }
main { padding: clamp(16px, 4vw, 44px); }
#setup, #status { max-width: 480px; margin: auto; }
#setup { background: #192630; padding: clamp(18px, 5vw, 38px); border-radius: 14px; border: 1px solid #364c59; }
h1 { font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.2; margin: 0; }
p { color: #b9d0d7; }
label { font-weight: 650; }
#pair { display: grid; gap: 8px; }
#pair label:not(:first-child) { margin-top: 6px; }
input, select, button {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid #5c737e;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  background: #101820;
}
input, select { width: 100%; min-width: 0; }
.password-field { display: flex; gap: 8px; }
.password-field button { flex: none; }
button { cursor: pointer; }
#connect { margin-top: 10px; background: #6de5c5; color: #0c2520; border-color: #6de5c5; font-weight: 750; }
button:disabled { opacity: .55; cursor: wait; }
button[aria-pressed="true"] { background: #306e61; }
:focus-visible { outline: 2px solid #6de5c5; outline-offset: 2px; }
.hint { font-size: .85rem; margin-bottom: 0; }
#status { margin-top: 12px; color: #ffcc9a; }
.toolbar, #textForm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
#quality { flex: 1 1 150px; font-size: .85rem; }
#remoteText { flex: 1 1 150px; }
#viewport { background: #080d12; display: grid; place-items: center; overflow: hidden; min-height: 180px; }
canvas { display: block; max-width: 100%; max-height: 75dvh; width: auto; height: auto; touch-action: none; }
.touch { display: none; }
@media (pointer: coarse) { .touch { display: block; } }
