:root {
  color-scheme: light;
  --bg: #f8f9fd;
  --panel: #ffffff;
  --line: rgba(54, 63, 111, .15);
  --muted: #626980;
  --text: #202237;
  --accent: #7145db;
  --cyan: #28b7d4;
  --danger: #b73c65;
  --gradient: linear-gradient(110deg, #565cff, #9145ed);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  background: radial-gradient(ellipse at 3% 35%, #eaf5ff8c, transparent 45%),
    radial-gradient(ellipse at 93% 55%, #eee6ff80, transparent 42%), var(--bg);
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
[hidden] { display: none !important; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 0 5.3vw; }
.topbar {
  position: relative; height: 88px; margin-top: 22px; padding: 0 23px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line); border-radius: 18px;
  background: #ffffffec; box-shadow: 0 10px 40px #3530660b;
}
.topbar::after {
  content: ''; position: absolute; height: 1px; bottom: -1px; left: 24px; right: 24px;
  background: linear-gradient(90deg, transparent, #4267ff, #a94dff, #38cfe0, transparent);
}
.brand {
  display: flex; gap: 13px; align-items: center; color: var(--text); text-decoration: none;
  font-size: 22px; font-weight: 400; letter-spacing: -.6px;
}
.brand strong { font-weight: 750; }
.brand small { display: block; font-size: 8px; letter-spacing: 1.6px; margin-top: 7px; color: var(--muted); }
.brand-mark {
  display: flex; align-items: center; justify-content: center; height: 44px; width: 44px;
  border-radius: 12px; background: var(--gradient); color: #fff; font-weight: 800;
  font-size: 27px; position: relative; box-shadow: 0 5px 20px #7454e333;
}
.brand-mark > span { font-size: 16px; margin-top: -15px; margin-left: -3px; }
.connection-pill {
  display: flex; align-items: center; gap: 9px; border: 1px solid #e0d9ee;
  padding: 10px 14px; border-radius: 30px; color: var(--muted); font-size: 11px; background: #faf9ff;
}
.status-dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #979aae; }
.connection-pill[data-state="connected"] { color: #6940b8; border-color: #cec2ef; background: #f4f0ff; }
.connection-pill[data-state="connected"] .status-dot { background: #7951e6; box-shadow: 0 0 9px #915fff80; }
.connection-pill[data-state="connecting"] .status-dot { background: #bb7c32; }
.welcome {
  position: relative; min-height: 660px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 6vw; align-items: center; padding: 76px 0 88px; isolation: isolate;
}
.welcome::before {
  content: ''; position: absolute; inset: 0 -24px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(#44559709 1px, transparent 1px), linear-gradient(90deg, #44559709 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse, #000, transparent 73%);
}
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: 1.7px; font-weight: 650; color: #7042c2; }
.intro > .eyebrow { width: fit-content; border: 1px solid #e0d6f4; border-radius: 24px; background: #f2eeff; padding: 10px 13px; }
.tiny-line { width: 19px; height: 2px; background: linear-gradient(90deg, #30c9e2, #9750ec); box-shadow: 0 0 8px #7a6aff55; }
h1 { font-size: clamp(38px, 4.2vw, 62px); line-height: 1.08; font-weight: 750; letter-spacing: -2.9px; margin: 27px 0; }
h1 > span { color: var(--accent); background: linear-gradient(105deg, #4263eb 6%, #8044df 60%, #a445cf); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.intro > p { font-size: 15px; line-height: 1.85; color: #5b6074; max-width: 510px; }
.features { display: flex; flex-wrap: wrap; gap: 12px 19px; margin-top: 28px; font-size: 11px; color: #525a73; }
.features > span { display: flex; align-items: center; gap: 8px; }
.features i { font-style: normal; color: var(--accent); font-size: 16px; }
.architecture { display: flex; align-items: center; gap: 15px; margin-top: 46px; font-size: 8px; letter-spacing: 1.4px; color: #697087; }
.architecture > span:first-child, .architecture > span:last-child { padding: 12px 10px; border: 1px solid #d8dcef; border-radius: 7px; background: #ffffffb5; box-shadow: 0 5px 16px #6961ab06; white-space: nowrap; }
.connection-line { color: #9673d8; letter-spacing: -1px; white-space: nowrap; font-size: 12px; text-shadow: 0 0 8px #3dcfe077; }
.login-card {
  position: relative; background: linear-gradient(145deg, #fff, #fcfaff) padding-box,
    linear-gradient(145deg, #bde7f2, #d0bdf2 52%, #c6d5ff) border-box;
  border: 1px solid transparent; border-radius: 20px; padding: 35px; max-width: 430px; width: 100%; justify-self: end;
  box-shadow: 0 22px 60px #5a438c0c, 12px 12px 0 -2px #f5f1fd, 12px 12px 0 -1px #e0d8f0;
}
.login-card::before { content: ''; position: absolute; height: 2px; left: 28px; right: 28px; top: -1px; background: linear-gradient(90deg, transparent, #32d2de, #a35cef, transparent); box-shadow: 0 0 12px #806df74d; }
.card-label { display: flex; align-items: center; gap: 11px; font-size: 9px; color: #74628b; letter-spacing: 1.6px; }
.square-icon { height: 30px; width: 30px; border: 1px solid #dacfef; background: #f7f3ff; display: grid; place-items: center; border-radius: 8px; color: var(--accent); font-size: 21px; }
h2 { font-size: 26px; font-weight: 650; letter-spacing: -.9px; margin: 27px 0 12px; }
.login-card > p { color: var(--muted); font-size: 13px; line-height: 1.75; }
.login-card label { display: block; font-size: 11px; color: #464c65; font-weight: 600; margin: 26px 0 10px; }
.login-card input { display: block; width: 100%; border: 1px solid #d8dbea; background: #fafbff; border-radius: 9px; padding: 15px 16px; min-height: 51px; color: var(--text); font-size: 15px; letter-spacing: 2px; box-shadow: inset 0 2px 4px #38305e03; }
.login-card input::placeholder { letter-spacing: 0; font-size: 13px; color: #85879c; }
.login-card input:focus { border-color: #9d7ce1; background: #fff; }
.primary-button { display: flex; align-items: center; justify-content: space-between; background: var(--gradient); border: 0; color: #fff; border-radius: 9px; width: 100%; padding: 15px 17px; margin-top: 15px; font-size: 13px; font-weight: 650; box-shadow: 0 8px 22px #6848e22e; transition: box-shadow 160ms, filter 160ms; }
.primary-button:hover { filter: brightness(1.06); box-shadow: 0 10px 28px #6848e24d; }
.primary-button > span:last-child { font-size: 20px; line-height: 20px; }
.login-card .login-help { font-size: 11px; line-height: 1.7; margin: 16px 0 22px; color: #72788c; }
.card-bottom { border-top: 1px solid var(--line); padding-top: 20px; display: flex; gap: 8px; align-items: center; font-size: 10px; color: #70758b; }
.card-bottom .status-dot { background: #22abc5; box-shadow: 0 0 7px #38cfe050; }
.login-card .error-message { color: var(--danger); font-size: 12px; }
.page-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; padding: 25px 0; color: #747b90; font-size: 9px; letter-spacing: 1px; }
.page-footer > span:last-child { letter-spacing: 0; font-size: 10px; }
.footer-divider { margin: 0 11px; color: #b0b4c7; }
.workspace { padding: 34px 0 25px; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.workspace-header h2 { margin: 10px 0 0; font-size: 25px; }
.quiet-button, .icon-button { border: 1px solid #d8dbea; color: #535b74; background: #fff; border-radius: 7px; padding: 10px 14px; font-size: 11px; white-space: nowrap; }
.quiet-button:hover, .icon-button:hover { background: #f2edff; border-color: #c7b5e9; color: #7042bd; }
.danger-button { display: flex; gap: 24px; }
.danger-button:hover { color: var(--danger); border-color: #d8aabb; background: #fff5f8; }
.viewer { border: 1px solid #d4d5e8; border-radius: 13px; overflow: hidden; background: #080a0f; box-shadow: 0 15px 45px #5b468d0d; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; background: linear-gradient(110deg, #fff, #f7f4ff); border-bottom: 1px solid var(--line); gap: 10px; }
.desktop-label { font-size: 11px; color: #555d76; display: flex; gap: 9px; align-items: center; }
.screen-symbol { display: block; width: 13px; height: 10px; border: 1px solid #8564bd; border-radius: 2px; position: relative; }
.screen-symbol::after { content: ''; position: absolute; left: 3px; right: 3px; height: 1px; bottom: -4px; background: #8564bd; }
.viewer-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.profile-label { font-size: 10px; color: var(--muted); margin-right: 3px; }
select { background: #fff; color: #515870; border: 1px solid #d6d5e8; border-radius: 6px; padding: 8px 25px 8px 10px; font-size: 11px; max-width: 170px; }
.viewer-actions .icon-button { padding: 7px 10px; min-height: 32px; }
#fullscreen { font-size: 21px; line-height: 17px; }
.video-stage { position: relative; width: 100%; min-width: 0; background: #080a0f; aspect-ratio: 16/9; max-height: 68vh; outline: none; overflow: hidden; touch-action: none; }
.video-stage:focus { box-shadow: inset 0 0 0 2px #8c59e5; }
.video-stage canvas { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.video-stage:focus canvas { cursor: crosshair; }
.video-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: radial-gradient(ellipse at 35% 40%, #edf8ff, transparent 60%), linear-gradient(125deg, #f9faff, #f4effc); text-align: center; padding: 25px; }
.video-placeholder h3 { font-weight: 550; font-size: 19px; margin: 21px 0 6px; }
.video-placeholder p { font-size: 12px; color: var(--muted); line-height: 1.7; max-width: 440px; }
.loader { width: 30px; height: 30px; border: 2px solid #d8dbef; border-top-color: var(--accent); border-right-color: #36bdd7; border-radius: 50%; animation: spin 1s linear infinite; }
.focus-hint { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); border: 1px solid #c8c0e0; border-radius: 7px; background: #fffffff0; color: #614885; padding: 10px 16px; font-size: 11px; white-space: nowrap; pointer-events: none; box-shadow: 0 5px 18px #34205a1a; }
.video-stage:focus .focus-hint { display: none; }
.viewer-footer { padding: 11px 16px; border-top: 1px solid var(--line); background: #fcfbff; display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: #7a7e94; }
#input-status { color: #6d4ca1; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; background: #ffffffcf; padding: 20px 0; box-shadow: 0 8px 26px #524a9105; }
.metrics > div { padding: 0 23px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.metrics > div:last-child { border-right: 0; }
.metrics span { font-size: 8px; letter-spacing: 1.4px; color: #787e93; margin-bottom: 11px; }
.metrics strong { font-size: 21px; font-weight: 550; letter-spacing: -.6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metrics small { font-size: 10px; color: #777d91; margin-top: 6px; overflow-wrap: anywhere; }
.session-message { font-size: 11px; color: #706783; line-height: 1.6; }
.viewer:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; display: flex; flex-direction: column; }
.viewer:fullscreen .video-stage { aspect-ratio: auto; max-height: none; flex: 1; min-height: 0; }
.viewer:fullscreen .viewer-toolbar, .viewer:fullscreen .viewer-footer { flex: none; }
.profile-note { font-size: 9px; color: #7b718d; white-space: nowrap; }
#profile:disabled { opacity: .75; cursor: default; }
.transport-info { display: flex; gap: 9px; align-items: center; }
#transport-mode[data-direct="true"] { color: var(--accent); }
#transport-rtt { color: #77718c; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .app-shell { padding: 0 70px; } }
@media (max-width: 1000px) {
  .welcome { gap: 38px; grid-template-columns: 1fr 1fr; min-height: 620px; }
  h1 { font-size: 39px; letter-spacing: -1.8px; }
  .login-card { padding: 26px; }
  .architecture { gap: 8px; font-size: 7px; letter-spacing: .7px; }
  .architecture > span:first-child, .architecture > span:last-child { padding: 10px 8px; }
  .connection-line { font-size: 8px; }
  .metrics > div { padding: 0 15px; }
  .metrics span { font-size: 7px; letter-spacing: 1px; }
  .metrics strong { font-size: 18px; }
}
@media (max-width: 720px) {
  .app-shell { padding: 0 20px; }
  .topbar { height: 75px; padding: 0 13px; margin-top: 14px; border-radius: 14px; gap: 8px; }
  .brand { font-size: 17px; gap: 9px; }
  .brand small { font-size: 6px; letter-spacing: .65px; }
  .brand-mark { width: 35px; height: 35px; font-size: 23px; border-radius: 10px; }
  .connection-pill { padding: 8px 9px; font-size: 9px; gap: 6px; }
  .welcome { grid-template-columns: 1fr; padding: 48px 0 54px; gap: 34px; }
  .welcome::before { inset-inline: -10px; }
  .intro > .eyebrow { font-size: 8px; letter-spacing: 1.1px; }
  .intro > p { font-size: 13px; }
  h1 { font-size: clamp(34px, 8.5vw, 47px); margin: 20px 0; letter-spacing: -1.7px; }
  .features { gap: 12px; font-size: 10px; margin-top: 22px; }
  .architecture { display: none; }
  .login-card { max-width: none; justify-self: stretch; padding: 26px; box-shadow: 0 15px 38px #5a438c0c, 5px 5px 0 -1px #e9e0f6; }
  .page-footer { flex-direction: column; gap: 10px; font-size: 8px; line-height: 1.6; }
  .page-footer > span:last-child { font-size: 9px; }
  .workspace { padding-top: 25px; }
  .workspace-header h2 { font-size: 21px; }
  .workspace-header .eyebrow { font-size: 8px; }
  .danger-button { gap: 10px; padding: 9px; }
  .viewer-toolbar { padding: 9px; align-items: flex-start; }
  .desktop-label { font-size: 0; padding-top: 10px; }
  .viewer-actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .profile-label, .profile-note { display: none; }
  select { max-width: 150px; padding-left: 7px; font-size: 10px; }
  .viewer-actions .icon-button { font-size: 10px; padding: 7px; }
  .video-stage { min-height: 220px; }
  .video-placeholder h3 { font-size: 16px; }
  .video-placeholder p { font-size: 10px; }
  .viewer-footer { font-size: 8px; padding: 10px 9px; flex-wrap: wrap; }
  .transport-info { gap: 6px; }
  .metrics { grid-template-columns: 1fr 1fr; padding: 0; }
  .metrics > div { padding: 17px; }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metrics strong { font-size: 20px; }
  .metrics span { font-size: 7px; }
  .metrics small { font-size: 9px; }
  .focus-hint { font-size: 9px; padding: 8px; bottom: 10px; }
  .viewer:fullscreen .video-stage { min-height: 0; }
}
@media (max-width: 380px) {
  .app-shell { padding: 0 14px; }
  .brand { font-size: 15px; gap: 7px; }
  .brand small { font-size: 5px; letter-spacing: .4px; }
  .connection-pill { padding: 7px; font-size: 8px; }
  .workspace-header h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .loader { animation-duration: 2.5s; } .primary-button { transition: none; } }

/* Compact remote keyboard stays inside the viewer, including fullscreen. */
#keyboard-toggle[aria-expanded="true"] { color: #7042bd; border-color: #bda4e9; background: #efe7ff; }
.touch-keyboard { flex: none; padding: 12px 14px 10px; border-top: 1px solid #d8ceee; background: linear-gradient(120deg, #f1f8ff, #f6f0ff); user-select: none; -webkit-user-select: none; }
.keyboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; max-width: 790px; margin: 0 auto 9px; }
.keyboard-heading > span { color: #715a96; font-size: 10px; font-weight: 650; letter-spacing: .6px; }
.keyboard-heading small { color: #7a7890; font-size: 9px; font-weight: 400; letter-spacing: 0; margin-left: 9px; }
.keyboard-heading > div { display: flex; gap: 5px; }
.touch-keyboard button { border: 1px solid #d4d3e8; border-radius: 6px; min-width: 0; padding: 0 3px; background: #ffffffed; color: #484464; font-size: 12px; font-weight: 550; box-shadow: 0 2px 0 #d7d2e880; touch-action: none; -webkit-touch-callout: none; }
.keyboard-heading button { height: 28px; min-width: 37px; padding-inline: 9px; font-size: 10px; }
.touch-keyboard button:hover { border-color: #b4a3d8; background: #fbf8ff; }
.touch-keyboard button:active, .touch-keyboard button.is-held { color: #fff; background: var(--gradient); border-color: #8961dc; box-shadow: 0 0 11px #9d78e64d; }
.keyboard-keys { display: grid; gap: 5px; max-width: 790px; margin: auto; }
.keyboard-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.keyboard-row button { height: 35px; }
.keyboard-row button[data-modifier] { font-size: 10px; background: #eee8fa; color: #6d4b99; }
.keyboard-row button[data-modifier].is-held { color: #fff; background: var(--gradient); }
.keyboard-space { grid-column: span 3; }
.keyboard-help { margin: 9px auto 0; max-width: 790px; color: #787088; font-size: 9px; line-height: 1.4; }
@media (max-width: 720px) {
  #keyboard-toggle { font-size: 9px; padding-inline: 7px; }
  .touch-keyboard { padding: 10px 7px 8px; }
  .keyboard-heading small { display: none; }
  .keyboard-heading { margin-bottom: 8px; }
  .keyboard-heading button { height: 27px; padding-inline: 8px; }
  .keyboard-row, .keyboard-keys { gap: 3px; }
  .keyboard-row button { height: 36px; font-size: 12px; }
  .keyboard-row button[data-modifier] { font-size: 9px; }
  .keyboard-help { font-size: 8px; margin-top: 8px; }
}
@media (orientation: landscape) and (max-height: 550px) {
  .viewer:is(:fullscreen, .viewer-expanded) .touch-keyboard { padding-block: 6px; }
  .viewer:is(:fullscreen, .viewer-expanded) .keyboard-heading { margin-bottom: 5px; }
  .viewer:is(:fullscreen, .viewer-expanded) .keyboard-heading button { height: 24px; }
  .viewer:is(:fullscreen, .viewer-expanded) .keyboard-row button { height: 26px; }
  .viewer:is(:fullscreen, .viewer-expanded) .keyboard-keys, .viewer:is(:fullscreen, .viewer-expanded) .keyboard-row { gap: 3px; }
  .viewer:is(:fullscreen, .viewer-expanded) .keyboard-help { display: none; }
}

/* A real fullscreen or the visual-viewport fallback includes the controls and
   keyboard. Browser bars remain under browser control in viewport mode. */
.viewer.viewer-expanded {
  --viewer-safe-top: env(safe-area-inset-top, 0px); --viewer-safe-right: env(safe-area-inset-right, 0px);
  --viewer-safe-bottom: env(safe-area-inset-bottom, 0px); --viewer-safe-left: env(safe-area-inset-left, 0px);
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; min-height: 0;
  display: flex; flex-direction: column; border: 0; border-radius: 0; box-shadow: none;
  padding: var(--viewer-safe-top) var(--viewer-safe-right) var(--viewer-safe-bottom) var(--viewer-safe-left);
}
.viewer.viewer-viewport {
  position: fixed; z-index: 10000;
  top: var(--viewer-viewport-top, 0px); left: var(--viewer-viewport-left, 0px);
  width: var(--viewer-viewport-width, 100vw); height: var(--viewer-viewport-height, 100dvh);
}
.viewer-expanded .video-stage { flex: 1 1 0%; min-height: 0; max-height: none; aspect-ratio: auto; }
.viewer-expanded .viewer-toolbar, .viewer-expanded .viewer-footer, .viewer-expanded .touch-gesture-hint { flex: none; }
.viewer-expanded .touch-keyboard { flex: 0 1 auto; min-height: 0; max-height: 55%; overflow-y: auto; overscroll-behavior: contain; }
.viewer-expanded .viewer-footer { flex-wrap: wrap; }
#fullscreen[aria-pressed="true"] { color: #7042bd; border-color: #bda4e9; background: #efe7ff; font-size: 11px; line-height: 18px; font-weight: 600; }
.fullscreen-note { margin: 0; color: #746087; font-size: 9px; padding: 7px 12px; background: #fcfbff; line-height: 1.5; }
.touch-gesture-hint { display: none; margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); background: #f5f3fc; color: #706783; font-size: 9px; line-height: 1.5; }
.touch-cursor { position: absolute; z-index: 4; width: 24px; height: 28px; left: 0; top: 0; pointer-events: none; transform: translate(-1px, -1px); filter: drop-shadow(0 1px 2px #0007); }
.touch-cursor svg { display: block; }
.mobile-controls, .mobile-drag-options, .mobile-control-help, .mobile-disconnect { display: none; }
.touch-cursor[data-gesture="dragging"]::after {
  content: ''; position: absolute; width: 44px; height: 44px; left: -19px; top: -20px;
  border-radius: 50%; border: 2px solid #ddd8e8; background: #77758b60; box-shadow: 0 0 0 3px #ffffff35;
}
.computers { min-height: 620px; padding: 52px 0 64px; }
.computer-heading, .pair-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.computer-heading h2 { margin: 12px 0 9px; font-size: 33px; letter-spacing: -1.2px; }
.computer-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.computer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.computer-actions .quiet-button { min-height: 40px; background: #ffffffc9; }
#add-computer { color: #7042bd; border-color: #d3c1ef; background: #f4efff; }
#logout { color: var(--muted); }
.device-list-status { margin: 31px 0 13px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.device-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.device-card { min-width: 0; display: flex; align-items: center; gap: 16px; padding: 25px 22px; border: 1px solid #dcd6ef; border-radius: 15px; background: linear-gradient(125deg, #fff, #fbfaff); box-shadow: 0 8px 28px #55458109, inset 0 1px #fff; }
.device-icon { position: relative; flex: none; display: grid; place-items: center; width: 47px; height: 47px; border-radius: 12px; border: 1px solid #cdd8f3; background: linear-gradient(135deg, #eafaff, #f0eaff); color: #7353d3; font-size: 39px; line-height: 1; text-shadow: 0 0 10px #57c5ee70; }
.device-card-body { min-width: 0; flex: 1; }
.device-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.device-state { margin: 0 0 7px; display: flex; align-items: baseline; gap: 7px; font-size: 11px; color: #77778c; line-height: 1.5; }
.device-state::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #a1a4b6; }
.device-state[data-online="true"] { color: #6650a5; }
.device-state[data-online="true"]::before { background: #8060e5; box-shadow: 0 0 7px #9971eb75; }
.device-card small { font-size: 10px; color: #7a7e94; line-height: 1.6; }
.device-connect { flex: none; padding: 10px 12px; color: #7042bd; background: #f5f1fd; }
.device-connect:disabled { cursor: default; color: #7e8093; background: #f3f3f8; }
.device-error { color: #a43661; background: #fff2f6; border: 1px solid #f0c7d4; border-radius: 9px; padding: 12px 15px; font-size: 12px; line-height: 1.7; }
.pair-panel { margin-top: 26px; padding: 28px; border: 1px solid #d5cef0; border-radius: 15px; background: radial-gradient(ellipse at top right, #e9f9ff80, transparent 65%), #fdfcff; box-shadow: 0 10px 30px #57459808; }
.pair-heading h3 { margin: 10px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.pair-steps { margin: 23px 0; padding-left: 20px; color: #626780; font-size: 12px; line-height: 1.8; }
.pair-steps li { padding-left: 7px; margin-bottom: 7px; }
.pair-steps li::marker { color: #8351d4; font-weight: 650; }
.pair-steps a { color: #6747c3; text-underline-offset: 3px; }
.pair-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; }
#generate-pair-code { width: auto; min-width: 255px; margin: 0; gap: 28px; }
.pair-result { display: grid; grid-template-columns: auto auto; align-items: center; gap: 7px 16px; min-width: 0; }
#pair-code { font-family: Consolas, "SFMono-Regular", monospace; font-weight: 650; font-size: 24px; letter-spacing: 1.3px; color: #6542bb; }
#copy-pair-code { font-size: 10px; padding: 8px 10px; }
#pair-expiry { grid-column: 1/-1; font-size: 10px; color: #7b738f; }
.pair-help { margin: 19px 0 0; font-size: 10px; color: #77778e; line-height: 1.7; }
@media (max-width: 1100px) { .device-list { grid-template-columns: 1fr; } .computer-heading { align-items: flex-start; } .computer-actions { max-width: 300px; } }
@media (max-width: 720px) {
  .computers { padding: 32px 0 45px; min-height: 530px; }
  .computer-heading { display: block; }
  .computer-heading .eyebrow { font-size: 8px; }
  .computer-heading h2 { font-size: 29px; }
  .computer-heading p { font-size: 12px; }
  .computer-actions { max-width: none; justify-content: flex-start; gap: 7px; margin-top: 21px; }
  .computer-actions .quiet-button { min-height: 37px; padding: 9px 11px; font-size: 10px; }
  .device-list-status { margin-top: 23px; }
  .device-card { padding: 18px 16px; gap: 13px; flex-wrap: wrap; }
  .device-card-body { flex-basis: calc(100% - 62px); }
  .device-card h3 { font-size: 15px; }
  .device-connect { margin-left: 60px; min-height: 37px; }
  .pair-panel { padding: 21px 17px; }
  .pair-heading { gap: 12px; align-items: flex-start; }
  .pair-heading h3 { font-size: 18px; line-height: 1.4; }
  .pair-heading .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .pair-heading .quiet-button { padding: 7px 9px; font-size: 10px; }
  .pair-steps { margin-block: 19px; font-size: 11px; }
  #generate-pair-code { width: 100%; min-width: 0; font-size: 12px; }
  .pair-result { width: 100%; gap: 9px; }
  #pair-code { font-size: clamp(18px, 5.5vw, 24px); letter-spacing: .4px; }
  #copy-pair-code { padding: 8px 6px; font-size: 9px; }
}
@media (pointer: coarse) {
  .mobile-drag-options { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; flex-basis: 100%; }
  .mobile-drag-options > span { width: 100%; color: #746087; font-size: 10px; }
  .mobile-drag-options [aria-pressed="true"] { color: #6337b4; background: #eee5ff; border-color: #b99be7; }
  .viewer-actions { flex-wrap: wrap; }
  .touch-gesture-hint { display: block; }
  /* Scale the complete vector arrow around its tip, retaining the same click
     position and the full-size stage as the touch target. */
  .touch-cursor { transform: translate(-1px, -1px) scale(.65); transform-origin: 3px 2px; }
  .viewer-expanded .viewer-toolbar {
    position: absolute; z-index: 8; top: calc(var(--viewer-safe-top) + 7px); right: calc(var(--viewer-safe-right) + 7px);
    max-width: calc(100% - var(--viewer-safe-left) - var(--viewer-safe-right) - 14px);
    padding: 5px; border: 1px solid #d4d5e8; border-radius: 9px; background: #fbf9fff2; box-shadow: 0 2px 14px #0003;
  }
  .viewer-expanded .desktop-label, .viewer-expanded .profile-label, .viewer-expanded .profile-note,
  .viewer-expanded .viewer-footer, .viewer-expanded .touch-gesture-hint { display: none; }
  .viewer-expanded .viewer-actions { flex-wrap: nowrap; gap: 4px; }
  .viewer-expanded #profile { min-width: 0; max-width: 115px; }
  .viewer-expanded .viewer-actions .icon-button { min-height: 36px; padding-inline: 8px; font-size: 10px; white-space: nowrap; }
  .viewer-expanded #zoom-reset { color: #7042bd; font-variant-numeric: tabular-nums; }
  .viewer-expanded .touch-keyboard { position: relative; z-index: 7; }
  .viewer-expanded .fullscreen-note {
    position: absolute; z-index: 5; bottom: calc(var(--viewer-safe-bottom) + 7px); left: calc(var(--viewer-safe-left) + 7px); right: calc(var(--viewer-safe-right) + 7px);
    width: fit-content; margin-inline: auto; max-width: 420px; border-radius: 7px; background: #fcfbffe8; pointer-events: none;
  }
  .viewer-expanded:has(.touch-keyboard:not([hidden])) .fullscreen-note { display: none; }
}
@media (pointer: coarse) {
  .viewer-expanded.mobile-controls-ready .mobile-controls {
    display: grid; place-items: center; position: absolute; z-index: 10;
    top: calc(var(--viewer-safe-top) + 12px); right: var(--viewer-safe-right);
    width: 36px; height: 48px; padding: 0; border: 1px solid #cec3e9; border-right: 0;
    border-radius: 14px 0 0 14px; background: #f9f5fff0; color: #7042bd; font-size: 32px;
    box-shadow: 0 2px 12px #0003; touch-action: manipulation;
  }
  .viewer-expanded.mobile-controls-ready:not(.mobile-panel-open) .viewer-toolbar { display: none; }
  .viewer-expanded.mobile-controls-ready .viewer-toolbar {
    right: calc(var(--viewer-safe-right) + 42px); top: calc(var(--viewer-safe-top) + 12px);
    width: 300px; max-width: calc(100% - var(--viewer-safe-left) - var(--viewer-safe-right) - 50px);
    max-height: calc(100% - var(--viewer-safe-top) - var(--viewer-safe-bottom) - 24px); overflow-y: auto;
    padding: 12px; overscroll-behavior: contain;
  }
  .viewer-expanded.mobile-controls-ready .viewer-actions { flex-wrap: wrap; gap: 8px; width: 100%; }
  .viewer-expanded.mobile-controls-ready .profile-label { display: block; flex: 0 0 50px; font-size: 11px; }
  .viewer-expanded.mobile-controls-ready #profile { flex: 1 0 calc(100% - 60px); max-width: none; min-height: 40px; }
  .viewer-expanded.mobile-controls-ready .viewer-actions .icon-button { min-height: 40px; }
  .viewer-expanded.mobile-controls-ready .mobile-control-help { display: block; margin: 3px 0; color: #665d78; font-size: 11px; line-height: 1.65; }
  .viewer-expanded.mobile-controls-ready .mobile-disconnect { display: block; color: #965276; }
}
@media (orientation: landscape) and (max-height: 550px) {
  .viewer-expanded .video-stage { min-height: 64px; }
  .viewer-expanded .touch-gesture-hint { display: none; }
  .viewer-expanded .viewer-toolbar { padding-block: 6px; }
  .viewer-expanded .viewer-footer { padding-block: 6px; font-size: 9px; }
}
