/* Mobile application shell. Terminal styles are owned by the retained Test1 UI. */
.mobile-app { --bg:#151719; --panel:#1e2124; --line:#303438; --text:#f1f3f4; --muted:#a4acb3; --accent:#9ae5cf; --green:#9ae5cf; color-scheme:dark; min-height:100svh; font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; -webkit-tap-highlight-color:transparent; }
.mobile-app[data-appearance="light"] { --bg:#fff; --panel:#f2f3f5; --line:#e2e5e8; --text:#191c20; --muted:#606971; --accent:#156b58; --green:#156b58; color-scheme:light; }
@media(prefers-color-scheme:light){.mobile-app[data-appearance="system"]{--bg:#fff;--panel:#f2f3f5;--line:#e2e5e8;--text:#191c20;--muted:#606971;--accent:#156b58;--green:#156b58;color-scheme:light;}}
.mobile-app .shell { display:block; min-height:100svh; }
.mobile-app .rail,.mobile-app .topline,.mobile-app .page-heading,.mobile-app #project-context,.mobile-app .legacy-resources,.mobile-app footer { display:none!important; }
.mobile-app main { width:100%; max-width:720px; margin:auto; padding:0 max(16px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
.mobile-app h1,.mobile-app h2,.mobile-app h3 { letter-spacing:0; }
.mobile-app h2 { font-size:17px; font-weight:600; }
.mobile-app h3 { font-size:16px; }
.mobile-app svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; vertical-align:middle; }
.mobile-app button,.mobile-app .button,.mobile-app .quiet,.mobile-app summary { min-height:44px; font-size:16px; touch-action:manipulation; }
.mobile-app button { color:inherit; }
.mobile-app button:disabled { cursor:not-allowed; }
.mobile-app .button,.mobile-app .quiet { border-radius:8px; background:var(--panel); border-color:var(--line); }
.mobile-app .button.primary { background:var(--accent); color:var(--bg); border-color:transparent; }
.mobile-app input,.mobile-app select,.mobile-app textarea { font-size:16px; min-height:48px; background:var(--bg); border-color:var(--line); color:var(--text); }
.mobile-app label { font-size:15px; color:var(--text); }
.mobile-app p { overflow-wrap:anywhere; }
.mobile-app .project-header { position:sticky; top:0; z-index:8; display:flex; align-items:center; gap:0; min-height:calc(64px + env(safe-area-inset-top)); padding:calc(8px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left)); background:var(--bg); border-bottom:1px solid var(--line); }
.mobile-app .project-header button { border:0; background:transparent; padding:0; }
.mobile-app .project-selector { display:flex; align-items:center; gap:8px; min-width:0; margin-right:auto; text-align:left; }
.mobile-app .project-selector strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:calc(100vw - 192px); font-size:18px; font-weight:650; }
.mobile-app .project-selector > svg { width:16px; height:16px; color:var(--muted); }
.mobile-app .workspace-avatar { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:8px; background:var(--panel); border:1px solid var(--line); color:var(--accent); font-weight:650; font-size:17px; }
.mobile-app .header-icon { display:grid; place-items:center; width:44px; height:44px; flex:none; }
.mobile-app .profile-toggle { margin-right:-8px; }
.mobile-app .project-search { display:flex; align-items:center; gap:8px; margin:16px 0 8px; height:44px; padding:0 12px; border-radius:8px; background:var(--panel); color:var(--muted); }
.mobile-app .project-search svg { width:18px; height:18px; }
.mobile-app .project-search input { flex:1; width:0; min-height:44px; padding:0; background:transparent; border:0; border-radius:0; color:var(--text); outline-offset:2px; }
.mobile-app .project-search input::placeholder { color:var(--muted); opacity:1; }
.mobile-app .project-section { margin:8px -16px 16px; }
.mobile-app .project-section-heading { display:flex; align-items:center; padding:0 8px 0 12px; }
.mobile-app .project-section-heading button { border:0; background:transparent; }
.mobile-app .section-toggle { flex:1; display:flex; align-items:center; gap:4px; padding:8px 0; text-align:left; }
.mobile-app .section-toggle h2 { margin:0; font-size:16px; font-weight:650; }
.mobile-app .section-toggle svg { width:20px; height:20px; color:var(--muted); }
.mobile-app .section-toggle[aria-expanded="false"] svg { transform:rotate(-90deg); }
.mobile-app .section-add { width:44px; display:grid; place-items:center; color:var(--muted); padding:0; }
.mobile-app .section-add svg { width:20px; height:20px; }
.mobile-app .resource-row { display:flex; min-width:0; padding-left:16px; }
.mobile-app .row-main { display:flex; align-items:center; gap:12px; min-width:0; flex:1; min-height:72px; padding:8px 0; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; }
.mobile-app .row-icon { display:grid; place-items:center; flex:none; width:32px; height:40px; color:var(--muted); }
.mobile-app .row-icon svg { width:24px; height:24px; }
.mobile-app .row-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:2px; }
.mobile-app .row-copy strong { font-size:16px; line-height:24px; font-weight:600; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.mobile-app .row-copy > span { color:var(--muted); font-size:14px; line-height:22px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mobile-app .row-more { width:44px; flex:none; padding:0; display:grid; place-items:center; border:0; border-bottom:1px solid var(--line); background:transparent; }
.mobile-app .resource-row:not(:has(.row-more)) { padding-right:16px; }
.mobile-app .status-dot { width:7px; height:7px; border-radius:50%; background:#747c84; flex:none; margin:0 8px; }
.mobile-app .status-dot.live { background:#8bd7bc; }
.mobile-app .status-dot.attention { background:#f1b86e; }
.mobile-app .list-empty { margin:4px 16px 8px; padding:8px 0; color:var(--muted); font-size:14px; }
.mobile-app .project-details-link { display:flex; align-items:center; gap:12px; width:100%; padding:8px 0; border:0; border-top:1px solid var(--line); background:transparent; color:var(--muted); text-align:left; font-size:14px; }
.mobile-app .project-details-link svg:last-child { margin-left:auto; transform:rotate(-90deg); width:18px; }
.mobile-app .workspace-drawer { margin:0; padding:0; width:85vw; max-width:440px; height:100dvh; max-height:none; border:0; border-right:1px solid var(--line); border-radius:0; color:var(--text); background:var(--bg); }
.mobile-app .workspace-drawer::backdrop { background:#0009; }
.mobile-app .drawer-surface { min-height:100%; display:flex; flex-direction:column; padding:calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.mobile-app .drawer-surface header { display:flex; align-items:center; gap:8px; margin:0 0 24px; }
.mobile-app .drawer-surface header h2 { margin:0; flex:1; font-size:20px; }
.mobile-app .drawer-surface header button,.mobile-app .mobile-sheet header button { width:44px; padding:0; display:grid; place-items:center; border:0; background:transparent; }
.mobile-app .brand-mark { display:grid; place-items:center; width:32px; height:32px; border:0; background:transparent; color:var(--accent); font-weight:750; font-size:28px; }
.mobile-app .drawer-label { margin:0 0 8px; color:var(--muted); font-size:14px; font-weight:500; }
.mobile-app .workspace-drawer nav { display:grid; gap:4px; }
.mobile-app .workspace-drawer nav a { display:flex; align-items:center; gap:12px; min-height:64px; padding:8px; border:0; border-radius:8px; color:var(--text); }
.mobile-app .workspace-drawer nav a[aria-current="page"] { background:var(--panel); }
.mobile-app .drawer-project-copy { display:grid; min-width:0; }
.mobile-app .drawer-project-copy strong { font-size:16px; font-weight:600; overflow-wrap:anywhere; }
.mobile-app .drawer-project-copy small { color:var(--muted); font-size:13px; }
.mobile-app .selected-check { margin-left:auto; color:var(--accent); }
.mobile-app .drawer-bottom { display:grid; padding-top:24px; margin-top:auto; }
.mobile-app .drawer-bottom button { display:flex; align-items:center; gap:12px; width:100%; padding:8px; min-height:48px; border:0; background:transparent; text-align:left; }
.mobile-app .drawer-bottom button svg { width:20px; height:20px; color:var(--muted); }
.mobile-app .mobile-sheet { width:100%; max-width:720px; margin:auto auto 0; max-height:calc(100dvh - env(safe-area-inset-top) - 16px); overflow:auto; padding:8px 16px calc(24px + env(safe-area-inset-bottom)); border:1px solid var(--line); border-bottom:0; border-radius:16px 16px 0 0; background:var(--bg); color:var(--text); overscroll-behavior:contain; line-height:1.5; }
.mobile-app .mobile-sheet::backdrop { background:#0009; }
.mobile-app .mobile-sheet header { position:sticky; top:-8px; z-index:1; display:flex; align-items:center; gap:8px; margin:0 0 16px; background:var(--bg); min-height:56px; border-bottom:1px solid var(--line); }
.mobile-app .mobile-sheet header h2 { flex:1; font-size:17px; margin:0; }
.mobile-app .sheet-action { display:flex; align-items:center; gap:12px; width:100%; min-height:48px; padding:8px 0; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; }
.mobile-app .sheet-label { color:var(--muted); margin:24px 0 8px; font-size:14px; }
.mobile-app .danger { color:#f8aaa5; }
.mobile-app .signin-panel { width:100%; max-width:400px; margin:0 auto; padding:calc(48px + env(safe-area-inset-top)) 0 24px; border:0; border-radius:0; background:transparent; box-shadow:none; text-align:left; }
.mobile-app .signin-brand { display:flex; align-items:center; gap:8px; margin-bottom:40px; font-size:22px; }
.mobile-app .signin-panel h2 { font-size:24px; line-height:32px; margin:0 0 8px; }
.mobile-app .signin-panel > p { font-size:16px; margin:0 0 32px; }
.mobile-app .signin-panel .button { width:100%; }
.mobile-app #clerk-signin,.mobile-app #clerk-signin > div { width:100%; }
.mobile-app #clerk-signin .cl-rootBox,.mobile-app #clerk-signin .cl-cardBox,.mobile-app #clerk-signin .cl-card { width:100%; min-width:0; max-width:100%; border:0; background:transparent; box-shadow:none; padding:0; border-radius:0; }
.mobile-app #signin:has(.cl-rootBox) > h2,.mobile-app #signin:has(.cl-rootBox) > p { display:none; }
.mobile-app #clerk-signin .cl-socialButtons { display:flex; flex-direction:column; gap:8px; }
.mobile-app #clerk-signin button { min-height:48px; font-size:16px; border-radius:8px; }
.mobile-app #clerk-signin .cl-formFieldInput { min-height:48px; font-size:16px; }
.mobile-app #clerk-signin .cl-footer { background:transparent; margin-top:24px; }
.mobile-app .signin-create { display:block; width:100%; min-height:48px; margin-top:16px; background:transparent; border:1px solid var(--line); border-radius:8px; }
.mobile-app[data-auth-state="signed-out"] .project-header,.mobile-app[data-auth-state="checking"] .project-header { display:none; }
.mobile-app .project-grid { display:flex; flex-direction:column; gap:0; }
.mobile-app .project-card { display:grid; grid-template-columns:32px 1fr; gap:4px 12px; min-height:72px; padding:12px 0; background:transparent; border:0; border-bottom:1px solid var(--line); border-radius:0; }
.mobile-app .project-folder { grid-row:1/3; font-size:24px; color:var(--muted); }
.mobile-app .project-card h2 { margin:0; font-size:16px; }
.mobile-app .project-card p { margin:0; font-size:14px; }
.mobile-app .project-empty { background:transparent; border:0; padding:16px 0; }
.mobile-app #projects-index { margin-top:16px; }
.mobile-app .support-details { margin:16px 0; }
.mobile-app:not([data-app-view="help"]) #content > .support-details { display:none; }
.mobile-app[data-app-view="help"] #project-home,.mobile-app[data-app-view="help"] #projects-index { display:none; }
.mobile-app[data-app-view="help"] #hosts { display:block!important; }
.mobile-app[data-app-view="help"] #hosts > .section-heading,.mobile-app[data-app-view="help"] #inventory { display:none; }
.mobile-app .forms { grid-template-columns:1fr; }
.mobile-app .app-loading { padding:48px 16px; color:var(--muted); }
.mobile-app .message { font-size:14px; border-radius:8px; }
.mobile-app .message.checking { color:var(--muted); background:transparent; }
.mobile-app .setup-disclosure,.mobile-app .panel { background:var(--panel); border-color:var(--line); }
.mobile-app #machine-management .vm-administration { position:static; width:auto; padding:0; margin:16px 0; border:0; box-shadow:none; }
.mobile-app #machine-management .vm-administration > summary { display:none; }
.mobile-app #machine-management .vm-administration button { width:100%; margin:4px 0; }
.mobile-app #machine-management .vm-administration > .mono { font-size:13px; }
.mobile-app #auth-controls { display:block; }
.mobile-app #auth-controls button { width:100%; min-height:48px; background:transparent; border:0; border-bottom:1px solid var(--line); text-align:left; padding:8px 0; }
@media(prefers-reduced-motion:no-preference){.mobile-app .workspace-drawer[open]{animation:project-drawer-in 160ms ease-out;}@keyframes project-drawer-in{from{transform:translateX(-100%)}to{transform:translateX(0)}}}
.mobile-app #clerk-signin .cl-formButtonPrimary,.mobile-app #clerk-signin .cl-formButtonPrimary span { color:#10251e; }
/* The dedicated auth surface keeps the Clerk palette in every project theme. */
.mobile-app[data-auth-state="signed-out"],.mobile-app[data-auth-state="checking"] { --bg:#151719; --panel:#1e2124; --line:#303438; --text:#f1f3f4; --muted:#a4acb3; --accent:#9ae5cf; color-scheme:dark; }
.mobile-app[data-appearance="light"] .danger { color:#b42318; }
@media(prefers-color-scheme:light){.mobile-app[data-appearance="system"] .danger{color:#b42318;}}

.workspace-loading{max-width:720px;margin:auto;padding:calc(24px + env(safe-area-inset-top)) 16px;font:16px/1.5 -apple-system,BlinkMacSystemFont,system-ui,sans-serif;}
.workspace-loading h1{font-size:22px;letter-spacing:0;}
.workspace-loading a{display:inline-flex;align-items:center;min-height:44px;margin:16px 8px 0 0;}
