/* Pocket Remote adaptive workspace. Phone view temporarily reflows the active X11 app. */
#remote-workspace { flex: 1; min-height: 0; display: flex; overflow: hidden; }
#remote-chat-panel { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; position: relative; }
#remote-splitter, .mobile-workspace-tabs, .mobile-workspace-tabs[hidden] { display: none; }
.remote-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-surface) 88%, transparent); }
.remote-chat-kicker { margin: 0; color: var(--text-primary); font-size: 13px; font-weight: 720; line-height: 1.25; }
.remote-chat-caption { margin: 2px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.25; }
.remote-chatgpt-link { flex: 0 0 auto; color: var(--blue); font-size: 12px; font-weight: 650; text-decoration: none; }
.remote-chatgpt-link:hover, .remote-chatgpt-link:focus-visible { color: var(--text-primary); text-decoration: underline; outline: none; }
#remote-screen-panel { --remote-ink: #ecf5ff; --remote-muted: #8ea4b8; --remote-surface: #142130; --remote-edge: #293c50; display: none; position: relative; min-width: 0; min-height: 0; flex-direction: column; gap: 9px; padding: 12px; overflow: hidden; background: #080d12; border-color: var(--border); }
.remote-screen-head, .remote-control-bar, .remote-screen-identity, .remote-screen-actions { display: flex; align-items: center; }
.remote-screen-head { min-height: 38px; justify-content: space-between; gap: 10px; }
.remote-screen-identity { min-width: 0; gap: 9px; }
.remote-screen-identity > div { min-width: 0; }
.remote-screen-title { margin: 0; overflow: hidden; color: var(--remote-ink); font-size: 13px; font-weight: 720; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.remote-screen-status { margin: 2px 0 0; overflow: hidden; color: var(--remote-muted); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.remote-screen-indicator { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #f1b74b; box-shadow: 0 0 0 4px rgba(241,183,75,.13); }
.remote-screen-indicator[data-state="watching"] { background: #61b5ff; box-shadow: 0 0 0 4px rgba(97,181,255,.13); }
.remote-screen-indicator[data-state="control"] { background: #62d3a5; box-shadow: 0 0 0 4px rgba(98,211,165,.13); }
.remote-screen-indicator[data-state="error"] { background: #ff6b76; box-shadow: 0 0 0 4px rgba(255,107,118,.13); }
.remote-screen-actions { gap: 5px; }
.remote-icon-button { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--remote-edge); border-radius: 10px; background: var(--remote-surface); color: #bed0df; cursor: pointer; font: 650 13px/1 var(--font-sans); }
.remote-icon-button:hover, .remote-icon-button:focus-visible, .remote-control-btn:focus-visible, .remote-mode-button:focus-visible, .remote-dock-button:focus-visible, .remote-quick-key:focus-visible, .remote-keyboard-input:focus-visible { outline: 2px solid #61b5ff; outline-offset: 2px; }
.remote-input-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid #223548; border-radius: 13px; background: #0b141d; }
.remote-mode-button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: #849aae; font: 680 12px/1 var(--font-sans); }
.remote-mode-button.is-active { color: #eff8ff; background: #1c3144; box-shadow: inset 0 0 0 1px #31506b; }
.remote-mode-button:disabled { opacity: .46; }
.remote-mode-icon { margin-right: 7px; color: #70bdff; font-size: 18px; vertical-align: -1px; }
.remote-app-picker { grid-column: 1 / -1; min-width: 0; min-height: 42px; padding: 0 11px; border: 1px solid #30495f; border-radius: 9px; color: #dcecff; background: #101d29; font: 650 13px/1 var(--font-sans); }
.remote-app-picker:disabled { opacity: .52; }
.remote-app-picker:focus-visible { outline: 2px solid #61b5ff; outline-offset: 2px; }
.remote-screen-canvas { position: relative; flex: 1; min-width: 0; min-height: 220px; overflow: hidden; border: 1px solid #2b4055; border-radius: 15px; background: #03070a; touch-action: none; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.remote-screen-canvas canvas { display: block; outline: none; }
.remote-screen-placeholder { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 24px; color: #8ea4b8; text-align: center; font-size: 12px; background: radial-gradient(circle at 50% 18%, rgba(97,181,255,.16), transparent 45%), #070c11; }
.remote-screen-placeholder strong { color: #dcecff; font-size: 14px; }
.remote-screen-placeholder-icon { color: #61b5ff; font-size: 30px; }
.remote-screen-placeholder[hidden], .remote-control-btn[hidden], .remote-icon-button[hidden], .remote-keyboard-input[hidden], .remote-keyboard-label[hidden], .remote-phone-dock[hidden], .remote-key-strip[hidden] { display: none !important; }
.remote-control-bar { min-height: 40px; flex-wrap: wrap; gap: 7px; }
.remote-control-btn { min-height: 40px; padding: 0 14px; border: 1px solid #31475c; border-radius: 11px; color: var(--remote-ink); background: var(--remote-surface); cursor: pointer; font: 680 12px/1 var(--font-sans); }
.remote-control-primary { flex: 1; min-height: 48px; color: #071019; border-color: #61b5ff; background: #61b5ff; font-size: 14px; }
.remote-control-note { margin-left: auto; color: var(--remote-muted); font-size: 11px; }
.remote-keyboard-label { color: var(--remote-muted); font-size: 11px; font-weight: 650; }
.remote-keyboard-input { width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 13px; border: 1px solid #3a536b; border-radius: 12px; color: var(--remote-ink); background: #101d29; font: 16px var(--font-sans); }
.remote-phone-dock { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 7px 6px max(7px, env(safe-area-inset-bottom)); border: 1px solid #263b4e; border-radius: 17px; background: rgba(17,30,42,.96); box-shadow: 0 -8px 28px rgba(0,0,0,.22); }
.remote-dock-button { min-width: 0; min-height: 48px; padding: 4px 2px; border: 0; border-radius: 11px; color: #9fb2c4; background: transparent; font: 620 9px/1 var(--font-sans); }
.remote-dock-button span { display: block; min-height: 21px; margin-bottom: 3px; color: #e1effc; font: 700 18px/21px var(--font-sans); }
.remote-dock-button:active, .remote-dock-button.is-busy { background: #20374b; color: #fff; }
.remote-key-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.remote-quick-key { min-height: 38px; border: 1px solid #30475d; border-radius: 10px; color: #c5d6e5; background: #111e29; font: 650 11px/1 var(--font-sans); }
.remote-layout-btn { display: inline-flex; }
body.remote-screen-open #header, body.remote-screen-open #account-banner { display: none !important; }
.remote-chat-button { width: auto; min-width: 46px; padding: 0 9px; font-size: 12px; }
.remote-recovery-note { margin: 0; padding: 8px 10px; border: 1px solid #987744; border-radius: 8px; color: #ffe0a6; background: #33291b; font-size: 12px; line-height: 1.4; }
.remote-recovery-note[hidden] { display: none; }
.remote-layout-btn[aria-pressed="true"] { color: var(--blue); background: var(--blue-subtle); }

@media (max-width: 899px) {
  body.remote-screen-open #remote-screen-panel { display: flex; flex: 1; }
  body.remote-screen-open #remote-chat-panel { display: none; }
  body.remote-screen-open #remote-workspace { background: #080d12; }
  body.remote-screen-open #account-banner, body.remote-screen-open #install-banner, body.remote-screen-open #ios-install-hint { display: none !important; }
  body.remote-screen-open #remote-screen-panel { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); gap: 7px; }
  body.remote-screen-open .remote-screen-head { min-height: 38px; }
  body.remote-screen-open .remote-screen-canvas { min-height: 260px; border-radius: 13px; }
  body.remote-screen-open #remote-screen-panel[data-input-mode="phone"][data-mode="control"] .remote-screen-canvas { background: #111820; }
  body.remote-screen-open .remote-control-bar { min-height: 38px; }
  body.remote-screen-open #remote-screen-panel[data-mode="control"] .remote-control-bar { justify-content: space-between; }
  body.remote-screen-open #remote-screen-panel[data-mode="control"] .remote-control-note { order: -1; margin: 0; }
  body.remote-screen-open .remote-keyboard-label { display: none; }
  .remote-chat-head { min-height: 48px; padding: 8px 12px; }
  .remote-chat-caption { display: none; }
  .mobile-workspace-tabs { position: relative; z-index: 12; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex: 0 0 auto; padding: 7px max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-surface) 94%, var(--bg-base)); }
  .mobile-workspace-tab { min-height: 48px; border: 1px solid transparent; border-radius: 14px; color: var(--text-secondary); background: transparent; font: 700 13px/1 var(--font-sans); }
  .mobile-workspace-tab span { margin-right: 7px; color: currentColor; font-size: 16px; }
  .mobile-workspace-tab.is-active { color: var(--text-primary); border-color: color-mix(in srgb, var(--blue) 38%, var(--border)); background: var(--blue-subtle); }
  .mobile-workspace-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
  .remote-phone-appbar { min-height: 54px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #0c1722; border-bottom: 1px solid #203449; }
  .remote-phone-appbar[hidden], .remote-phone-home[hidden] { display: none !important; }
  .remote-phone-appbar-button, .remote-phone-home-button, .remote-phone-home-refresh { min-height: 44px; border: 1px solid #29445c; border-radius: 12px; color: #e8f4ff; background: #142436; font: 700 15px/1 var(--font-sans); }
  .remote-phone-appbar-button { width: 44px; padding: 0; }
  .remote-phone-home-button { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; padding: 0 11px; text-align: left; }
  .remote-phone-home-button span:last-child { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  #remote-phone-app-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: #07111b; background: #65c6ff; font-size: 13px; }
  .remote-phone-home { min-height: 0; flex: 1; overflow-y: auto; padding: 19px 14px 24px; color: #eaf4fc; background: radial-gradient(circle at 85% 0, rgba(82,209,156,.14), transparent 29%), #09131e; }
  .remote-phone-home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .remote-phone-home-head p { margin: 0 0 3px; color: #86a0b5; font-size: 13px; font-weight: 650; }
  .remote-phone-home-head strong { font-size: 23px; line-height: 1.1; }
  .remote-phone-home-refresh { width: 44px; padding: 0; color: #77c8ff; }
  .remote-phone-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .remote-phone-search { width: 100%; min-height: 48px; box-sizing: border-box; margin: 18px 0 10px; padding: 0 13px; border: 1px solid #28465e; border-radius: 14px; color: #edf6ff; background: #101f2e; font: 16px/1 var(--font-sans); }
  .remote-phone-home-note { margin: 0 2px 15px; color: #9ab0c2; font-size: 14px; line-height: 1.4; }
  .remote-phone-app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .remote-phone-app-card { min-height: 118px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 13px; border: 1px solid #254258; border-radius: 18px; color: #eaf4fc; background: linear-gradient(145deg, #13263a, #0d1a28); text-align: left; font: 700 15px/1.25 var(--font-sans); }
  .remote-phone-app-card:active { border-color: #66c8ff; background: #19334a; }
  .remote-phone-app-card:focus-visible, .remote-phone-acquire:focus-visible, .remote-phone-appbar-button:focus-visible, .remote-phone-home-button:focus-visible { outline: 2px solid #65c6ff; outline-offset: 2px; }
  .remote-phone-app-card-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; color: #06111c; background: #65c6ff; font-size: 18px; }
  .remote-phone-app-card-title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .remote-phone-acquire { width: 100%; min-height: 52px; margin-top: 13px; border: 1px solid #65c6ff; border-radius: 15px; color: #06111c; background: #65c6ff; font: 750 16px/1 var(--font-sans); }
  #remote-screen-panel[data-phone-view="home"] .remote-screen-head, #remote-screen-panel[data-phone-view="home"] .remote-input-mode, #remote-screen-panel[data-phone-view="home"] .remote-screen-canvas, #remote-screen-panel[data-phone-view="home"] .remote-key-strip, #remote-screen-panel[data-phone-view="home"] .remote-phone-dock, #remote-screen-panel[data-phone-view="home"] .remote-control-bar, #remote-screen-panel[data-phone-view="home"] .remote-keyboard-label, #remote-screen-panel[data-phone-view="home"] .remote-keyboard-input { display: none !important; }
  #remote-screen-panel[data-phone-view="computer"] .remote-screen-head, #remote-screen-panel[data-phone-view="computer"] .remote-input-mode, #remote-screen-panel[data-phone-view="computer"] .remote-key-strip, #remote-screen-panel[data-phone-view="computer"] .remote-phone-dock, #remote-screen-panel[data-phone-view="computer"] .remote-control-bar, #remote-screen-panel[data-phone-view="computer"] .remote-keyboard-label { display: none !important; }
  #remote-screen-panel[data-phone-view="computer"] .remote-keyboard-input { position: absolute; right: 10px; bottom: 10px; left: 10px; z-index: 3; width: auto; }
  #remote-screen-panel[data-phone-view="computer"] .remote-screen-canvas { min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
}

#remote-screen-panel:fullscreen, body.remote-screen-immersive #remote-screen-panel { display: flex; position: relative; width: 100%; height: 100%; box-sizing: border-box; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); gap: 7px; background: #080d12; }
body.remote-screen-immersive #screen-main { position: fixed; inset: 0; z-index: 1000; max-width: none; margin: 0; background: #080d12; }
body.remote-screen-immersive #header, body.remote-screen-immersive #account-banner { display: none; }
body.remote-screen-immersive #remote-workspace { display: flex; background: #080d12; }
body.remote-screen-immersive #remote-chat-panel { display: none; }
body.remote-screen-immersive .mobile-workspace-tabs { display: none !important; }
#remote-screen-panel:fullscreen .remote-screen-canvas, body.remote-screen-immersive #remote-screen-panel .remote-screen-canvas { min-height: 0; }

@media (min-width: 900px) {
  #screen-main { max-width: none; margin: 0; }
  #header, #account-banner, #install-banner, #ios-install-hint, #remote-chat-panel, #remote-splitter { display: none !important; }
  #remote-workspace { display: flex; background: #03070a; }
  #remote-screen-panel { display: flex; width: 100%; padding: 0; gap: 0; background: #03070a; border: 0; }
  #remote-screen-panel .remote-screen-head, #remote-screen-panel .remote-input-mode, #remote-screen-panel .remote-phone-dock, #remote-screen-panel .remote-key-strip, #remote-screen-panel .remote-keyboard-label, #remote-screen-panel .remote-keyboard-input { display: none !important; }
  #remote-screen-panel .remote-screen-canvas { min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  #remote-screen-panel .remote-control-bar { position: absolute; right: 16px; bottom: 16px; z-index: 3; min-height: 0; }
  #remote-screen-panel .remote-control-note, #remote-screen-panel .remote-control-bar #remote-return-codex { display: none !important; }
  #remote-screen-panel .remote-control-primary { flex: 0 0 auto; min-height: 40px; padding: 0 14px; font-size: 12px; }
  #remote-screen-panel[data-mode="control"] .remote-control-bar { display: none; }
}

@media (max-width: 360px) {
  #remote-screen-panel { padding-right: 6px; padding-left: 6px; }
  body.remote-screen-open .remote-screen-canvas { min-height: 220px; }
  .remote-app-picker { min-height: 40px; font-size: 12px; }
  .remote-screen-status { max-width: 205px; }
  .remote-mode-icon { margin-right: 4px; }
  .remote-phone-dock { gap: 1px; padding-right: 3px; padding-left: 3px; }
}
@media (max-width: 899px) and (orientation: landscape) {
  body.remote-screen-open #remote-screen-panel, #remote-screen-panel:fullscreen, body.remote-screen-immersive #remote-screen-panel { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .75fr); grid-template-rows: auto auto 1fr auto auto; }
  .remote-screen-head { grid-column: 1 / -1; }
  .remote-screen-canvas { grid-column: 1; grid-row: 2 / 6; width: 100%; height: 100%; }
  .remote-input-mode { grid-column: 2; grid-row: 2; }
  .remote-key-strip { grid-column: 2; grid-row: 3; align-self: end; }
  .remote-control-bar { grid-column: 2; grid-row: 4; }
  .remote-phone-dock { grid-column: 2; grid-row: 5; }
  .remote-keyboard-input { grid-column: 2; grid-row: 3; align-self: end; }
}
#remote-screen-panel:fullscreen, body.remote-screen-immersive #remote-screen-panel { display: block; padding: 0; gap: 0; overflow: hidden; }
#remote-screen-panel:fullscreen > :not(.remote-screen-canvas), body.remote-screen-immersive #remote-screen-panel > :not(.remote-screen-canvas) { transition: opacity 180ms ease, transform 180ms ease; }
#remote-screen-panel:fullscreen .remote-screen-canvas, body.remote-screen-immersive #remote-screen-panel .remote-screen-canvas { position: absolute; inset: 0; width: auto; height: auto; min-height: 0; border: 0; border-radius: 0; z-index: 0; }
#remote-screen-panel:fullscreen .remote-screen-head, body.remote-screen-immersive #remote-screen-panel .remote-screen-head { position: absolute; top: 10px; right: 10px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen .remote-input-mode, body.remote-screen-immersive #remote-screen-panel .remote-input-mode { position: absolute; top: 57px; right: 10px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen .remote-control-bar, body.remote-screen-immersive #remote-screen-panel .remote-control-bar { position: absolute; right: 10px; bottom: 10px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen .remote-phone-dock, body.remote-screen-immersive #remote-screen-panel .remote-phone-dock { position: absolute; right: 10px; bottom: 58px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen .remote-key-strip, body.remote-screen-immersive #remote-screen-panel .remote-key-strip { position: absolute; right: 10px; bottom: 120px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen .remote-keyboard-label, body.remote-screen-immersive #remote-screen-panel .remote-keyboard-label { position: absolute; right: 10px; bottom: 176px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen .remote-keyboard-input, body.remote-screen-immersive #remote-screen-panel .remote-keyboard-input { position: absolute; right: 10px; bottom: 122px; left: 10px; z-index: 2; }
#remote-screen-panel:fullscreen:not(.remote-toolbar-active) .remote-screen-head, #remote-screen-panel:fullscreen:not(.remote-toolbar-active) .remote-input-mode, #remote-screen-panel:fullscreen:not(.remote-toolbar-active) .remote-control-bar, #remote-screen-panel:fullscreen:not(.remote-toolbar-active) .remote-phone-dock, #remote-screen-panel:fullscreen:not(.remote-toolbar-active) .remote-key-strip, #remote-screen-panel:fullscreen:not(.remote-toolbar-active) .remote-keyboard-label, body.remote-screen-immersive #remote-screen-panel:not(.remote-toolbar-active) .remote-screen-head, body.remote-screen-immersive #remote-screen-panel:not(.remote-toolbar-active) .remote-input-mode, body.remote-screen-immersive #remote-screen-panel:not(.remote-toolbar-active) .remote-control-bar, body.remote-screen-immersive #remote-screen-panel:not(.remote-toolbar-active) .remote-phone-dock, body.remote-screen-immersive #remote-screen-panel:not(.remote-toolbar-active) .remote-key-strip, body.remote-screen-immersive #remote-screen-panel:not(.remote-toolbar-active) .remote-keyboard-label { opacity: 0; pointer-events: none; transform: translateY(-8px); }
#remote-screen-panel:fullscreen .remote-screen-head:focus-within, #remote-screen-panel:fullscreen .remote-input-mode:focus-within, #remote-screen-panel:fullscreen .remote-control-bar:focus-within, #remote-screen-panel:fullscreen .remote-phone-dock:focus-within, body.remote-screen-immersive #remote-screen-panel .remote-screen-head:focus-within, body.remote-screen-immersive #remote-screen-panel .remote-input-mode:focus-within, body.remote-screen-immersive #remote-screen-panel .remote-control-bar:focus-within, body.remote-screen-immersive #remote-screen-panel .remote-phone-dock:focus-within { opacity: 1; pointer-events: auto; transform: none; }
#remote-screen-panel:fullscreen.remote-keyboard-open .remote-keyboard-input, body.remote-screen-immersive #remote-screen-panel.remote-keyboard-open .remote-keyboard-input { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.unlock-form { width: min(360px, calc(100vw - 48px)); display: grid; gap: 16px; }
.unlock-form .connect-title, .unlock-form .error-message { margin: 0; }
.unlock-form label { font-weight: 600; }
.unlock-form input { width: 100%; box-sizing: border-box; min-height: 48px; padding: 12px; border: 1px solid #748396; border-radius: 8px; background: #fff; color: #192b3c; font: inherit; }
.unlock-form input:focus-visible { outline: 3px solid #448be0; outline-offset: 2px; }
.unlock-form .btn { min-height: 48px; }
.unlock-note { font-size: 14px; line-height: 1.6; color: var(--text-secondary, #94a3b8); }
.screen[hidden] { display: none !important; }
