:root { color-scheme: dark; --bg: #0f1115; --panel: #181b22; --line: #2a2f3a; --text: #e8eaf0; --muted: #8b93a5; --accent: #4f8cff; --danger: #e5484d; --ok: #30a46c; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
[hidden] { display: none !important; }
h1 { font-size: 1.4rem; margin: 0; }
.card { max-width: 420px; margin: 0 auto; padding: 32px 20px; display: flex; flex-direction: column; gap: 16px; }
.card header { display: flex; align-items: center; justify-content: space-between; }
form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.9rem; }
input { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 16px; padding: 12px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { background: var(--accent); border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-size: 1rem; font-weight: 600; padding: 12px 16px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 500; }
button.danger { background: var(--danger); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row button { flex: 1; }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.8rem; padding: 4px 12px; }
.pill[data-on="true"] { border-color: var(--ok); color: var(--ok); }
.error, #status[data-kind="error"] { color: var(--danger); }
#status, .error { min-height: 1.5em; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
code { word-break: break-all; }
.sas { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.sas p { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
#sas { font: 700 2.4rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: 0.12em; }

#remote { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
#surface { flex: 1; min-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#screen { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
#kbd { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }
#toolbar { display: flex; gap: 6px; overflow-x: auto; padding: 6px max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); scrollbar-width: none; }
#toolbar::-webkit-scrollbar { display: none; }
#toolbar button { background: #252a35; flex: 0 0 auto; font-size: 0.85rem; font-weight: 500; padding: 9px 12px; white-space: nowrap; }
#toolbar button:active { background: var(--accent); }
#toolbar button.danger { background: var(--danger); }
#toolbar button[data-active="true"] { background: var(--accent); }
