:root{--sans:system-ui, "Segoe UI", Roboto, sans-serif;--heading:system-ui, "Segoe UI", Roboto, sans-serif;--mono:ui-monospace, Consolas, monospace;--accent-border:#38bdf880;--social-bg:#1f293780;--shadow:#0006 0 10px 15px -3px, #00000040 0 4px 6px -2px;font:18px/145% var(--sans);letter-spacing:.18px;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (width<=1024px){:root{font-size:16px}}#root{text-align:center;border-inline:1px solid var(--border);box-sizing:border-box;flex-direction:column;width:1126px;max-width:100%;min-height:100svh;margin:0 auto;display:flex}body{margin:0}h1,h2{font-family:var(--heading);color:var(--text-h);font-weight:500}h1{letter-spacing:-1.68px;margin:32px 0;font-size:56px}@media (width<=1024px){h1{margin:20px 0;font-size:36px}}h2{letter-spacing:-.24px;margin:0 0 8px;font-size:24px;line-height:118%}@media (width<=1024px){h2{font-size:20px}}p{margin:0}code,.counter{font-family:var(--mono);color:var(--text-h);border-radius:4px;display:inline-flex}code{background:var(--code-bg);padding:4px 8px;font-size:15px;line-height:135%}:root{--color-bg:#0a0a0a;--color-panel:#1a1a1a;--color-panel-2:#0f0f0f;--color-border:#374151;--color-border-hover:#75e6ff;--color-text:#e5e7eb;--color-text-muted:#9ca3af;--color-text-faint:#6b7280;--color-accent:#75e6ff;--color-success:#34d399;--color-error:#f87171;--color-warning:#fbbf24;--bg:var(--color-bg);--card-bg:var(--color-panel);--border:var(--color-border);--text:var(--color-text);--text-h:var(--color-text);--text-muted:var(--color-text-muted);--accent:var(--color-accent);--accent-bg:#38bdf814;--danger:var(--color-error);--success:var(--color-success);--code-bg:var(--color-panel-2);--radius:12px;--shadow:0 1px 2px #0006}*{box-sizing:border-box}body{background:var(--color-bg);color:var(--color-text);margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:14px}h1,h2,h3,.heading,.login-title,.page-header h2{color:var(--color-accent)}button{font-family:inherit;font-size:inherit;cursor:pointer;color:var(--color-text)}input,textarea,select{font-family:inherit;font-size:inherit;background:var(--color-panel-2);color:var(--color-text);border:1px solid var(--color-border)}input::placeholder,textarea::placeholder{color:var(--color-text-faint)}input:focus,textarea:focus,select:focus{outline:2px solid var(--color-accent);outline-offset:-1px;border-color:#0000}table th,table td{color:var(--color-text)}table th{color:var(--color-text-muted)}.app{flex-direction:column;min-height:100vh;display:flex}.topbar{border-bottom:1px solid var(--border);background:var(--card-bg);justify-content:space-between;align-items:center;padding:1rem 1.5rem;display:flex}.brand{letter-spacing:-.01em;font-size:18px;font-weight:600}.dashboard{flex:1;grid-template-columns:320px 1fr 360px;gap:1rem;width:100%;max-width:1600px;margin:0 auto;padding:1rem;display:grid}.panel{flex-direction:column;gap:1rem;display:flex}.card{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:1rem}.card-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;font-size:12px}.card-value{margin-top:.25rem;font-size:15px;font-weight:500}.row{justify-content:space-between;align-items:center;padding:.5rem 0;display:flex}.row+.row{border-top:1px solid var(--border)}.subheading{text-align:center;color:var(--text-muted);margin-bottom:.75rem;font-size:13px;font-weight:500}.muted{color:var(--text-muted);margin:.5rem 0;font-size:13px}.btn-primary{border:1px solid var(--color-accent);width:100%;color:var(--color-accent);border-radius:var(--radius);background:#38bdf814;padding:.6rem 1rem;font-weight:500;transition:background .15s}.btn-primary:hover{background:#38bdf833}.btn-secondary{border:1px solid var(--color-border);width:100%;color:var(--color-text);border-radius:var(--radius);background:0 0;margin-top:.5rem;padding:.5rem 1rem}.btn-secondary:hover{background:var(--color-panel-2);border-color:var(--color-border-hover)}.btn-icon{border:1px solid var(--border);background:var(--card-bg);border-radius:8px;justify-content:center;align-items:center;min-width:36px;height:36px;padding:.5rem;display:inline-flex}.btn-icon:hover{background:var(--bg)}.btn-link{color:var(--accent);background:0 0;border:none;padding:.25rem 0;font-size:13px}.btn-link:hover{text-decoration:underline}.num-input{border:1px solid var(--border);background:var(--card-bg);text-align:right;border-radius:8px;width:60px;padding:.4rem .5rem}.msg-input,.notes-input{border:1px solid var(--color-border);background:var(--color-panel-2);width:100%;min-height:80px;color:var(--color-text);resize:vertical;border-radius:8px;padding:.6rem .75rem;font-family:inherit}.search-input,.device-select{border:1px solid var(--border);background:var(--card-bg);width:100%;color:var(--text);border-radius:8px;margin-bottom:.5rem;padding:.5rem .75rem}.search-input::placeholder,.device-select::placeholder{color:var(--color-text-faint)}.control-grid{grid-template-columns:1fr 1fr;gap:1rem;display:grid}.dpad{grid-template-columns:repeat(3,1fr);justify-items:center;gap:.4rem;display:grid}.ctrl-btn{border:1px solid var(--border);background:var(--card-bg);border-radius:8px;justify-content:center;align-items:center;width:44px;height:44px;font-size:16px;display:inline-flex}.ctrl-btn:hover{background:var(--bg)}.gesture-list{flex-direction:column;gap:.4rem;display:flex}.gesture-btn{border:1px solid var(--border);background:var(--card-bg);border-radius:999px;padding:.45rem .75rem;font-size:13px;transition:all .15s}.gesture-btn:hover{background:var(--bg)}.gesture-btn.active{border-color:var(--accent);background:var(--accent-bg);color:var(--accent)}.msg-actions{align-items:center;gap:.5rem;margin-top:.5rem;display:flex}.msg-actions .btn-primary{flex:1}.device-nav .nav-arrows{justify-content:flex-end;gap:.5rem;display:flex}.tab-row{grid-template-columns:1fr 1fr;gap:.5rem;margin-bottom:.75rem;display:grid}.tab{border:1px solid var(--border);background:var(--card-bg);text-align:left;border-radius:8px;flex-direction:column;align-items:flex-start;gap:.15rem;padding:.6rem .5rem;display:flex}.tab span{color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px}.tab strong{font-size:14px;font-weight:500}.tab.active{border-color:var(--accent);background:var(--accent-bg)}.tab.active strong{color:var(--accent)}.tab-content{flex-direction:column;gap:.25rem;display:flex}.phone-mirror{-webkit-user-select:none;user-select:none;-webkit-user-drag:none;touch-action:none;flex-direction:column;justify-content:flex-start;align-items:center;gap:.5rem;display:flex}.stream-status{border:1px solid var(--color-border);background:var(--color-panel-2);text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-muted);border-radius:999px;align-items:center;gap:.4rem;padding:.2rem .6rem;font-size:11px;font-weight:500;display:inline-flex}.stream-status-dot{background:var(--color-text-faint);border-radius:50%;flex-shrink:0;width:8px;height:8px}.stream-status.status-connected{color:var(--color-success);border-color:#22c55e4d}.stream-status.status-connected .stream-status-dot{background:var(--color-success);box-shadow:0 0 6px #34d39980}.stream-status.status-connecting{color:var(--color-warning);border-color:#eab3084d}.stream-status.status-connecting .stream-status-dot{background:var(--color-warning);animation:1.2s ease-in-out infinite stream-status-pulse}.stream-status.status-disconnected{color:var(--color-error);border-color:#ef44444d}.stream-status.status-disconnected .stream-status-dot{background:var(--color-error)}@keyframes stream-status-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.85)}}.phone-frame{background:#1a1a1f;border-radius:40px;flex-direction:column;flex-shrink:0;width:320px;height:660px;padding:14px;display:flex;position:relative;box-shadow:0 6px 24px #0000001f}.phone-screen{background:var(--color-bg);color:var(--color-text);border-radius:28px;flex:1;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.phone-home-indicator{background:var(--color-border);border-radius:2px;width:80px;height:4px;position:absolute;bottom:8px;left:50%;transform:translate(-50%)}.phone-screen-status{text-align:center;color:var(--color-text-muted);flex-direction:column;justify-content:center;align-items:center;gap:.5rem;width:100%;height:100%;padding:1.25rem;display:flex}.phone-screen-status.status-loading{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:2;background:#0a0a0ad9;position:absolute;inset:0}.phone-screen-status-icon{justify-content:center;align-items:center;width:56px;height:56px;margin-bottom:.25rem;display:inline-flex}.phone-screen-status-glyph{border:2px solid;border-radius:50%;justify-content:center;align-items:center;width:48px;height:48px;font-size:22px;font-weight:600;line-height:1;display:inline-flex}.phone-screen-status-spinner{border:3px solid var(--color-border);border-top-color:var(--color-accent);border-radius:50%;width:40px;height:40px;animation:.9s linear infinite phone-screen-spin}@keyframes phone-screen-spin{to{transform:rotate(360deg)}}.phone-screen-status-title{color:var(--color-text);margin:0;font-size:15px;font-weight:600}.phone-screen-status-sub{color:var(--color-text-muted);max-width:240px;margin:0;font-size:13px}.phone-screen-status-meta{color:var(--color-text-faint);word-break:break-all;max-width:260px;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.phone-screen-status-action{border:1px solid var(--color-accent);background:var(--accent-bg);color:var(--color-accent);cursor:pointer;border-radius:999px;margin-top:.75rem;padding:.4rem 1rem;font-size:13px;font-weight:500;transition:background .15s,transform 50ms}.phone-screen-status-action:hover{background:#38bdf829}.phone-screen-status-action:active{transform:scale(.97)}.phone-screen-status.status-loading .phone-screen-status-title{color:var(--color-accent)}.phone-screen-status.status-failed .phone-screen-status-glyph{color:var(--color-error);background:#f8717114}.phone-screen-status.status-failed .phone-screen-status-action{border-color:var(--color-error);color:var(--color-error);background:#f871711a}.phone-screen-status.status-failed .phone-screen-status-action:hover{background:#f871712e}.phone-screen-status.status-offline{color:var(--color-text-muted)}.phone-screen-status.status-offline .phone-screen-status-glyph{color:var(--color-text-muted);background:#9ca3af14}.phone-screen-status.status-offline .phone-screen-status-action{border-color:var(--color-border);background:var(--color-panel-2);color:var(--color-text)}.phone-screen-status.status-offline .phone-screen-status-action:hover{background:var(--color-panel)}.phone-screen-status.status-unauth .phone-screen-status-glyph{color:var(--color-text-faint)}.phone-stream{object-fit:contain;cursor:crosshair;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;touch-action:none;background:#000;width:100%;height:100%;display:block}.stream-container{width:100%;height:100%;display:flex;position:relative}.tap-marker{border:2px solid var(--color-accent);pointer-events:none;background:#7de9ff2e;border-radius:50%;width:12px;height:12px;animation:.4s ease-out forwards tap-ripple-success;position:absolute;transform:translate(-50%,-50%);box-shadow:0 0 12px #7de9ff73}.tap-marker.success{border-color:var(--color-accent);background:#7de9ff2e;animation:.4s ease-out forwards tap-ripple-success}.tap-marker.error{border-color:var(--color-error);background:#f8717138;animation:.45s ease-out forwards tap-ripple-error;box-shadow:0 0 14px #f871718c}.tap-marker.swipe-end{border-color:var(--color-accent);background:#7de9ff38}.tap-marker.hold{border-color:var(--color-warning);background:#fbbf2440;animation-duration:.55s}.tap-marker.shutter{background:#ffffff8c;border-color:#fffffff2;animation-duration:.3s}.swipe-trail{pointer-events:none;width:100%;height:100%;position:absolute;inset:0;overflow:visible}.swipe-trail line{stroke:var(--color-accent);stroke-width:3px;stroke-linecap:round;filter:drop-shadow(0 0 4px #7de9ff8c);fill:none;stroke-dasharray:1200;stroke-dashoffset:1200px;animation:.5s ease-out forwards swipe-trail-draw}@keyframes swipe-trail-draw{0%{stroke-dashoffset:1200px;opacity:1}60%{stroke-dashoffset:0;opacity:1}to{stroke-dashoffset:0;opacity:0}}.gesture-modes{flex-wrap:wrap;justify-content:center;gap:.4rem;max-width:360px;margin-bottom:.75rem;display:flex}.gesture-mode{border:1px solid var(--border);background:var(--card-bg);cursor:pointer;border-radius:999px;padding:.35rem .7rem;font-size:12px;transition:all .15s}.gesture-mode:hover:not(:disabled){background:var(--bg)}.gesture-mode.active{border-color:var(--accent);background:var(--accent-bg);color:var(--accent);font-weight:500}.gesture-mode:disabled{opacity:.4;cursor:not-allowed}@keyframes tap-ripple-success{0%{opacity:1;width:12px;height:12px}to{opacity:0;width:30px;height:30px}}@keyframes tap-ripple-error{0%{opacity:1;width:14px;height:14px}60%{opacity:.9}to{opacity:0;width:44px;height:44px}}.tap-feedback{border-radius:6px;max-width:360px;margin:.75rem 0 0;padding:.4rem .7rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tap-feedback.success{color:var(--color-success);background:#14532d4d}.tap-feedback.error{color:var(--color-error);background:#7f1d1d4d}.login-screen{background:var(--bg);justify-content:center;align-items:center;min-height:100vh;padding:1rem;display:flex}.login-card{flex-direction:column;gap:1rem;width:100%;max-width:360px;padding:2rem;display:flex}.login-title{letter-spacing:-.01em;margin:0;font-size:22px;font-weight:600}.login-field{flex-direction:column;gap:.4rem;display:flex}.login-field input{border:1px solid var(--border);background:var(--card-bg);color:var(--text);border-radius:8px;padding:.6rem .75rem}.login-field input::placeholder{color:var(--color-text-faint)}.login-field input:focus{outline:2px solid var(--accent);outline-offset:-1px;border-color:#0000}.login-error{color:var(--color-error);background:#7f1d1d4d;border:1px solid #ef444480;border-radius:8px;padding:.6rem .75rem;font-size:13px}.topbar-actions{align-items:center;gap:1rem;display:flex}.banner{border-bottom:1px solid var(--color-border);padding:.75rem 1.5rem;font-size:13px}.banner.error{color:var(--color-error);background:#7f1d1d4d;border-bottom-color:#ef444480}.banner.success{color:var(--color-success);background:#14532d4d;border-bottom-color:#22c55e80}.banner.muted{background:var(--color-panel);color:var(--color-text-muted)}.topbar-nav{flex:1;align-items:center;gap:.25rem;margin-left:2rem;display:flex}.nav-link{color:var(--text-muted);border-radius:8px;padding:.4rem .8rem;font-size:14px;font-weight:500;text-decoration:none}.nav-link:hover{background:var(--bg);color:var(--text)}.nav-link.active{background:var(--accent-bg);color:var(--accent)}.app-main{flex-direction:column;flex:1;display:flex}.page-actions{justify-content:flex-end;align-items:center;gap:.75rem;padding:.75rem 1.5rem 0;display:flex}.kbd-toggle.active{background:var(--accent-bg);color:var(--accent);border-radius:6px;padding:.25rem .5rem}kbd{background:var(--bg);border:1px solid var(--border);color:var(--text);border-radius:4px;padding:1px 5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.admin-page{flex-direction:column;gap:1rem;width:100%;max-width:1100px;margin:0 auto;padding:1.5rem;display:flex}.page-header{justify-content:space-between;align-items:center;display:flex}.page-header h2{margin:0;font-size:22px;font-weight:600}.admin-form h3,.admin-page .card h3{margin:0 0 1rem;font-size:16px;font-weight:600}.form-grid{grid-template-columns:repeat(3,1fr);gap:1rem;display:grid}.form-field{flex-direction:column;gap:.4rem;display:flex}.form-field-wide{border:1px solid var(--border);border-radius:8px;grid-column:1/-1;padding:.75rem}.form-field input,.form-field select{border:1px solid var(--border);background:var(--card-bg);color:var(--text);font-family:inherit;font-size:inherit;border-radius:8px;padding:.5rem .75rem}.form-field input::placeholder{color:var(--color-text-faint)}.form-field select option{background:var(--card-bg);color:var(--text)}.form-field input:focus,.form-field select:focus{outline:2px solid var(--accent);outline-offset:-1px;border-color:#0000}.checkbox-row{align-items:center;gap:.5rem;padding:.25rem 0;font-size:13px;display:flex}.form-actions{grid-column:1/-1;justify-content:flex-end;display:flex}.form-actions .btn-primary{width:auto;min-width:160px}.admin-table{border-collapse:collapse;width:100%}.admin-table th{text-align:left;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--border);padding:.5rem .75rem;font-size:12px;font-weight:500}.admin-table td{border-bottom:1px solid var(--border);vertical-align:middle;padding:.6rem .75rem}.admin-table tr:last-child td{border-bottom:none}.role-badge{text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:.15rem .5rem;font-size:11px;font-weight:500;display:inline-block}.role-admin{background:var(--accent-bg);color:var(--accent)}.role-user{color:var(--color-text);background:#6b728033;border:1px solid #6b72804d}.btn-link.danger{color:var(--danger)}.btn-link.danger:disabled{color:var(--text-muted);cursor:not-allowed;text-decoration:none}.confirm-row{color:var(--text-muted);align-items:center;gap:.5rem;font-size:13px;display:inline-flex}.small{font-size:12px}.devices-page{flex-direction:column;gap:1rem;width:100%;max-width:1300px;margin:0 auto;padding:1.5rem;display:flex}.devices-page .page-header p{margin:.25rem 0 0}.devices-toolbar{flex-direction:column;gap:.75rem;padding:1rem;display:flex}.devices-toolbar .search-input{margin-bottom:0}.status-tabs{flex-wrap:wrap;gap:.4rem;display:flex}.status-tab{border:1px solid var(--border);background:var(--card-bg);border-radius:999px;padding:.4rem .75rem;font-size:13px}.status-tab:hover{background:var(--bg)}.status-tab.active{border-color:var(--accent);background:var(--accent-bg);color:var(--accent)}.empty-state{text-align:center;color:var(--text-muted);padding:2rem 1rem}.device-grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;display:grid}.device-card{background:var(--card-bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);flex-direction:column;gap:.75rem;padding:1rem;display:flex}.device-card.status-online{border-left:3px solid var(--color-success)}.device-card.status-in-use{border-left:3px solid var(--color-warning)}.device-card.status-offline{border-left:3px solid var(--color-text-faint);opacity:.85}.device-card-head{justify-content:space-between;align-items:flex-start;gap:.5rem;display:flex}.device-card-head h3{margin:0;font-size:16px;font-weight:600}.device-card-head .udid{color:var(--text-muted);background:var(--bg);border-radius:4px;margin-top:.25rem;padding:.1rem .4rem;font-size:11px;display:inline-block}.device-status{text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;border-radius:999px;padding:.2rem .55rem;font-size:11px;font-weight:500}.device-status.status-online{color:var(--color-success);background:#22c55e1a;border:1px solid #22c55e4d}.device-status.status-in-use{color:var(--color-warning);background:#eab3081a;border:1px solid #eab3084d}.device-status.status-offline,.device-status.status-unknown{color:var(--color-text-muted);background:#6b728033;border:1px solid #6b72804d}.device-attrs{grid-template-columns:1fr 1fr;gap:.4rem 1rem;margin:0;display:grid}.device-attrs>div{flex-direction:column;gap:.1rem;display:flex}.device-attrs dt{color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px}.device-attrs dd{margin:0;font-size:13px}.device-in-use{background:var(--bg);border-radius:6px;margin:0;padding:.4rem .6rem}.device-actions{gap:.5rem;display:flex}.device-actions .btn-primary{width:100%;min-width:0}.placeholder-card{background:var(--bg);border-style:dashed}.placeholder-card .card-label{margin-bottom:.5rem}.placeholder-card code{background:var(--card-bg);color:var(--text);border-radius:3px;padding:1px 4px;font-size:11px}.panel.left code.udid{background:var(--bg);color:var(--text);border-radius:4px;margin-top:.25rem;padding:2px 6px;font-size:11px;display:inline-block}.device-gestures .gesture-actions,.system-controls .system-row{grid-template-columns:1fr 1fr;gap:.5rem;margin-top:.5rem;display:grid}.system-controls .system-row .btn-secondary{width:100%;margin:0;font-size:13px}.system-dpad{grid-template-columns:1fr 1fr 1fr;justify-items:center;gap:.4rem;margin-top:.5rem;display:grid}.system-dpad .btn-secondary{width:44px;height:44px;margin:0;padding:0;font-size:18px;transition:transform .1s ease-out,border-color .1s ease-out,background .1s ease-out}.system-dpad .btn-secondary:not(:disabled):active{border-color:var(--color-accent);background:var(--accent-bg);transform:scale(.96)}.device-gestures .gesture-actions .btn-secondary{width:100%;margin:0;font-size:13px}.device-gestures .msg-input{min-height:60px;margin-top:.5rem}.gesture-feedback{border:1px solid #0000;border-radius:8px;margin:.75rem 0 0;padding:.5rem .75rem;font-size:12px;line-height:1.4;animation:.15s ease-out gesture-feedback-in}.gesture-feedback.success{color:var(--color-success);background:#34d3991a;border-color:#34d39980}.gesture-feedback.error{color:var(--color-error);background:#f871711a;border-color:#f8717180}@keyframes gesture-feedback-in{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}.live-type-input{border:1px solid var(--color-border);background:var(--color-panel-2);width:100%;color:var(--color-text);border-radius:8px;margin-top:.5rem;padding:.5rem .75rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.live-type-input:focus{outline:2px solid var(--color-accent);outline-offset:-1px;border-color:#0000}.live-type-input:disabled{background:var(--color-panel);color:var(--color-text-faint);cursor:not-allowed}.live-type-meta{justify-content:space-between;align-items:center;margin-top:.4rem;display:flex}@media (width<=1100px){.dashboard{grid-template-columns:320px 1fr}.panel.right{grid-column:1/-1}}@media (width<=760px){.dashboard{grid-template-columns:1fr;gap:.75rem;padding:.75rem}.panel.left,.panel.right{grid-column:1/-1}.phone-mirror{touch-action:pan-y}.phone-frame{margin:0 auto}}@media (height<=820px){.phone-mirror{touch-action:pan-y;max-height:calc(100vh - 140px);overflow-y:auto}}
