.desktop-panel input {
  margin: 8px 0;
}
.desktop-panel>.muted{max-width:850px;line-height:1.6}.desktop-card[data-kind="agent"] .desktop-icon{background:linear-gradient(140deg,var(--brand-soft),color-mix(in srgb,var(--violet) 24%,var(--surface)));color:var(--violet)}

.desktop-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.desktop-grid button {
  white-space: nowrap;
}

.desktop-workspace-ref {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface2);
  color: var(--muted);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.selected-computer-head { align-items: flex-start; }
.selected-computer-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; }
.desktop-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.desktop-header-actions { display: flex; align-items: center; gap: 6px; }
.computer-action-icon { display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.computer-action-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.computer-action-icon.stop { border-color: #eccaca; color: var(--red); background: #fff8f8; }
.computer-action-icon.start { border-color: #b9dfd1; color: var(--success); background: var(--success-soft); }
.computer-action-icon.open { box-shadow: 0 6px 16px #4457d92b; }
.computer-action-icon[hidden] { display: none; }

.desktop-list {
  display: grid;
  gap: 9px;
}

.desktop-card[data-kind="operator"] .desktop-icon {
  background: linear-gradient(145deg, #fff0e5, #ffd6c5);
  color: #a9533f;
}

.desktop-interactive {
  margin-top: 14px;
  border: 1px solid var(--mint);
  border-radius: 14px;
  overflow: hidden;
  background: #050b09;
}

.desktop-interactive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  color: var(--mint);
  font-size: 12px;
}

.desktop-interactive-head > span { display: grid; gap: 2px; }
.desktop-interactive-head small { color: var(--muted); font-size: 10px; font-weight: 500; }
.desktop-view-controls { display: flex; align-items: center; gap: 5px; }
.desktop-view-controls button { min-width: 34px; min-height: 32px; padding: 4px 8px; border-color: #ffffff20; background: #ffffff0c; color: #fff; }
.desktop-view-controls button:nth-child(2) { min-width: 58px; }
.desktop-viewport { position: relative; width: 100%; height: auto; max-height: 720px; aspect-ratio: 16 / 10; overflow: auto; overscroll-behavior: contain; background: #11131a; }

#desktop-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 720px;
  border: 0;
  background: #000;
}

.browser-surface { --browser-zoom: 1; position: relative; overflow: auto; background: radial-gradient(circle at 50% 0, #252a38, #101218 62%); outline: 0; touch-action: none; overscroll-behavior: contain; user-select: none; -webkit-user-select: none; }
.browser-surface > [data-browser-frame] { display: block; width: calc(100% * var(--browser-zoom)); min-width: 100%; height: auto; margin: 0; opacity: 0; transition: opacity .18s ease; transform-origin: top left; cursor: default; -webkit-user-drag: none; }
.browser-surface > [data-browser-frame].ready { opacity: 1; }
.browser-surface[data-interactive="true"] > [data-browser-frame] { cursor: crosshair; }
.browser-surface-state { position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; color: #e8eaf2; text-align: center; background: linear-gradient(145deg, #181b25e8, #11131af2); }
.browser-surface-state[hidden] { display: none; }
.browser-surface-state span:not(.state-spinner) { max-width: 360px; color: #aeb4c4; font-size: 12px; }
.browser-surface textarea[data-browser-keyboard] { position: absolute; z-index: 0; left: 50%; bottom: 0; width: 2px; height: 2px; margin: 0; padding: 0; border: 0; opacity: .01; pointer-events: none; transform: translateX(-50%); caret-color: transparent; }
.browser-keyboard-fab { position: absolute; z-index: 4; right: 10px; bottom: 10px; width: 42px; height: 42px; padding: 0; border: 1px solid #ffffff26; border-radius: 50%; background: #1d2230dd; color: #fff; box-shadow: 0 8px 24px #0006; font-size: 18px; }
.semantic-mobile-entry { position: fixed; z-index: 91; left: max(10px,env(safe-area-inset-left)); right: max(10px,env(safe-area-inset-right)); bottom: calc(72px + env(safe-area-inset-bottom)); display: none; grid-template-columns: minmax(0,1fr) auto auto; gap: 6px; max-width: 620px; margin-inline: auto; padding: 8px; border: 1px solid #ffffff2b; border-radius: 14px; background: #151925f2; box-shadow: 0 14px 36px #0009; backdrop-filter: blur(16px); }
.semantic-mobile-entry.open { display: grid; }
.semantic-mobile-entry input { width: 100%; min-width: 0; height: 40px; margin: 0; padding: 8px 10px; border: 1px solid #ffffff26; border-radius: 9px; background: #ffffff0d; color: #fff; font: 500 16px/1.2 system-ui,sans-serif; user-select: text; -webkit-user-select: text; }
.semantic-mobile-entry button { min-width: 42px; min-height: 40px; padding: 7px 10px; border-color: #ffffff24; background: #ffffff0d; color: #fff; }
.semantic-mobile-entry .primary { border-color: #6e8cff88; background: linear-gradient(135deg,#526de8,#7656db); }
.semantic-fallback { border-style: dashed; }
.rfb-mobile-keys { position: absolute; z-index: 6; left: 10px; right: 60px; bottom: 10px; display: none; align-items: center; justify-content: center; gap: 4px; padding: 5px; border: 1px solid #ffffff24; border-radius: 13px; background: #171b26e8; box-shadow: 0 10px 28px #0008; backdrop-filter: blur(12px); }
.rfb-surface.keyboard-open .rfb-mobile-keys { display: flex; }
.rfb-mobile-keys button { flex: 0 1 42px; min-width: 32px; min-height: 34px; padding: 4px 7px; border: 1px solid #ffffff1c; border-radius: 9px; background: #ffffff0d; color: #f7f8fb; font: 700 12px/1 system-ui,sans-serif; touch-action: manipulation; }
.rfb-mobile-keys button:active { background: #ffffff25; transform: translateY(1px); }
.rfb-mobile-entry { position: fixed; z-index: 90; left: max(10px,env(safe-area-inset-left)); right: max(10px,env(safe-area-inset-right)); bottom: calc(72px + env(safe-area-inset-bottom)); display: none; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 6px; align-items: end; max-width: 620px; margin-inline: auto; padding: 8px; border: 1px solid #ffffff2b; border-radius: 14px; background: #151925f2; box-shadow: 0 14px 36px #0009; backdrop-filter: blur(16px); }
.rfb-mobile-entry.open { display: grid; }
.rfb-mobile-entry label { min-width: 0; margin: 0; color: #cbd2e2; font: 700 10px/1.2 system-ui,sans-serif; }
.rfb-mobile-entry label span { display: block; margin: 0 0 5px 4px; }
.rfb-mobile-entry input { width: 100%; min-width: 0; height: 38px; margin: 0; padding: 8px 10px; border: 1px solid #ffffff26; border-radius: 9px; background: #ffffff0d; color: #fff; font: 500 14px/1.2 system-ui,sans-serif; pointer-events: auto; touch-action: manipulation; user-select: text; -webkit-user-select: text; }
.rfb-mobile-entry button { min-height: 38px; padding: 7px 10px; border-color: #ffffff24; background: #ffffff0d; color: #fff; white-space: nowrap; }
.rfb-mobile-entry button.primary { border-color: #6e8cff88; background: linear-gradient(135deg,#526de8,#7656db); }
.rfb-mobile-entry small { grid-column: 1 / -1; min-height: 14px; padding: 0 4px 1px; color: #aeb9d0; font: 500 10px/1.25 system-ui,sans-serif; }
.advanced-desktop-view { border-top: 1px solid #ffffff14; background: #131620; color: #cfd3df; }
.advanced-desktop-view summary { padding: 10px 14px; cursor: pointer; font-size: 11px; }
.advanced-desktop-view p { margin: 0; padding: 0 14px 10px; color: #969daf; font-size: 10px; }
.advanced-desktop-view #desktop-frame { display: block; width: 100%; height: min(62dvh, 620px); border: 0; background: #000; }
.connection-browser { width: 100%; height: min(68dvh, 720px); min-height: 420px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 42px #1c1a3420; }
.rfb-surface > [data-browser-frame] { display: none; }
.rfb-native-stage { position: relative; width: calc(100% * var(--browser-zoom)); height: calc(100% * var(--browser-zoom)); min-width: 100%; min-height: 100%; display: grid; place-items: center; overflow: hidden; background: #11131a; }
.rfb-native-stage.awaiting-frame { opacity: 0; }
.rfb-native-stage canvas { max-width: 100%; max-height: 100%; outline: 0; touch-action: none; }
.rfb-last-frame { position: absolute; z-index: 1; inset: 0; width: calc(100% * var(--browser-zoom)); height: calc(100% * var(--browser-zoom)); object-fit: contain; object-position: top left; background: #11131a; }
.browser-surface-state.reconnect-overlay { inset: auto 10px 10px; z-index: 5; display: flex; place-content: initial; justify-content: flex-start; padding: 9px 12px; border: 1px solid #ffffff24; border-radius: 12px; background: #111827dd; box-shadow: 0 8px 26px #0008; backdrop-filter: blur(12px); text-align: left; }
.browser-surface-state.reconnect-overlay .state-spinner { width: 14px; height: 14px; }
.computer-control-note { align-self: center; color: var(--muted); font-size: 12px; }
.rfb-surface.connected .rfb-native-stage { animation: computer-arrive .22s ease-out both; }
@keyframes computer-arrive { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 620px) {
  .selected-computer-head { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
  .selected-computer-meta { justify-content: space-between; }
  .desktop-badges { justify-content: flex-start; }
  .desktop-header-actions { margin-left: auto; }
  .computer-action-icon { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
  .desktop-viewport { height: auto; min-height: 0; max-height: none; aspect-ratio: 16 / 10; }
  #desktop-frame { height: 100%; min-height: 0; max-height: none; }
  .desktop-interactive-head { display: flex; align-items: center; }
  .desktop-interactive-head > span small { display: none; }
  .desktop-view-controls { margin-left: auto; }
  .connection-browser { height: min(62dvh, 560px); min-height: 340px; border-radius: 14px; }
  .browser-keyboard-fab { display: grid; place-items: center; }
  .rfb-mobile-entry { grid-template-columns: minmax(0,1fr) auto auto; }
  .rfb-mobile-entry label { grid-column: 1 / -1; }
  .rfb-mobile-entry [data-rfb-url] { padding-inline: 9px; }
}

@media (min-width: 621px) { .browser-keyboard-fab { display: none; } }
