aicodeman 0.9.12 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/dist/config/hook-secret.d.ts +28 -0
- package/dist/config/hook-secret.d.ts.map +1 -0
- package/dist/config/hook-secret.js +63 -0
- package/dist/config/hook-secret.js.map +1 -0
- package/dist/hooks-config.d.ts +3 -2
- package/dist/hooks-config.d.ts.map +1 -1
- package/dist/hooks-config.js +10 -2
- package/dist/hooks-config.js.map +1 -1
- package/dist/respawn-controller.d.ts.map +1 -1
- package/dist/respawn-controller.js +12 -0
- package/dist/respawn-controller.js.map +1 -1
- package/dist/session-auto-ops.d.ts +43 -1
- package/dist/session-auto-ops.d.ts.map +1 -1
- package/dist/session-auto-ops.js +162 -1
- package/dist/session-auto-ops.js.map +1 -1
- package/dist/session-cli-builder.d.ts.map +1 -1
- package/dist/session-cli-builder.js +5 -0
- package/dist/session-cli-builder.js.map +1 -1
- package/dist/session.d.ts +41 -4
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +129 -5
- package/dist/session.js.map +1 -1
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +3 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/types/session.d.ts +4 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js.map +1 -1
- package/dist/usage-limit-patterns.d.ts +48 -0
- package/dist/usage-limit-patterns.d.ts.map +1 -0
- package/dist/usage-limit-patterns.js +184 -0
- package/dist/usage-limit-patterns.js.map +1 -0
- package/dist/web/middleware/auth.d.ts +9 -1
- package/dist/web/middleware/auth.d.ts.map +1 -1
- package/dist/web/middleware/auth.js +58 -8
- package/dist/web/middleware/auth.js.map +1 -1
- package/dist/web/network-auth-policy.d.ts +6 -0
- package/dist/web/network-auth-policy.d.ts.map +1 -1
- package/dist/web/network-auth-policy.js +10 -0
- package/dist/web/network-auth-policy.js.map +1 -1
- package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
- package/dist/web/public/app.a23f8bf6.js +35 -0
- package/dist/web/public/app.a23f8bf6.js.br +0 -0
- package/dist/web/public/app.a23f8bf6.js.gz +0 -0
- package/dist/web/public/{constants.74211deb.js → constants.8fa1a65f.js} +4 -0
- package/dist/web/public/constants.8fa1a65f.js.br +0 -0
- package/dist/web/public/constants.8fa1a65f.js.gz +0 -0
- package/dist/web/public/image-input.0ea86695.js.gz +0 -0
- package/dist/web/public/index.html +39 -34
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.b8686b5e.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.bc753cc7.js.gz +0 -0
- package/dist/web/public/{mobile-handlers.d54d97d6.js → mobile-handlers.763a7439.js} +10 -2
- package/dist/web/public/mobile-handlers.763a7439.js.br +0 -0
- package/dist/web/public/mobile-handlers.763a7439.js.gz +0 -0
- package/dist/web/public/mobile.c7513aed.css +1 -0
- package/dist/web/public/mobile.c7513aed.css.br +0 -0
- package/dist/web/public/mobile.c7513aed.css.gz +0 -0
- package/dist/web/public/notification-manager.9c984ac2.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/panels-ui.6bb3169f.js.gz +0 -0
- package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
- package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
- package/dist/web/public/respawn-ui.2d249da9.js.gz +0 -0
- package/dist/web/public/{session-ui.512816d8.js → session-ui.34f25fdf.js} +1 -1
- package/dist/web/public/session-ui.34f25fdf.js.br +0 -0
- package/dist/web/public/session-ui.34f25fdf.js.gz +0 -0
- package/dist/web/public/{settings-ui.21b009ca.js → settings-ui.3a341938.js} +8 -8
- package/dist/web/public/settings-ui.3a341938.js.br +0 -0
- package/dist/web/public/settings-ui.3a341938.js.gz +0 -0
- package/dist/web/public/styles.c14ecd8a.css +1 -0
- package/dist/web/public/styles.c14ecd8a.css.br +0 -0
- package/dist/web/public/styles.c14ecd8a.css.gz +0 -0
- package/dist/web/public/subagent-windows.a366a4ad.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/terminal-ui.1f5b45cf.js +3 -0
- package/dist/web/public/terminal-ui.1f5b45cf.js.br +0 -0
- package/dist/web/public/terminal-ui.1f5b45cf.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +52 -2
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/routes/system-routes.d.ts.map +1 -1
- package/dist/web/routes/system-routes.js +19 -0
- package/dist/web/routes/system-routes.js.map +1 -1
- package/dist/web/routes/ws-routes.d.ts.map +1 -1
- package/dist/web/routes/ws-routes.js +7 -0
- package/dist/web/routes/ws-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +4 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +4 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/server.d.ts +1 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +17 -1
- package/dist/web/server.js.map +1 -1
- package/dist/web/session-listener-wiring.d.ts +11 -0
- package/dist/web/session-listener-wiring.d.ts.map +1 -1
- package/dist/web/session-listener-wiring.js +25 -0
- package/dist/web/session-listener-wiring.js.map +1 -1
- package/dist/web/sse-events.d.ts +9 -0
- package/dist/web/sse-events.d.ts.map +1 -1
- package/dist/web/sse-events.js +9 -0
- package/dist/web/sse-events.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/app.a8663e79.js +0 -35
- package/dist/web/public/app.a8663e79.js.br +0 -0
- package/dist/web/public/app.a8663e79.js.gz +0 -0
- package/dist/web/public/constants.74211deb.js.br +0 -0
- package/dist/web/public/constants.74211deb.js.gz +0 -0
- package/dist/web/public/mobile-handlers.d54d97d6.js.br +0 -0
- package/dist/web/public/mobile-handlers.d54d97d6.js.gz +0 -0
- package/dist/web/public/mobile.959f6fe2.css +0 -1
- package/dist/web/public/mobile.959f6fe2.css.br +0 -0
- package/dist/web/public/mobile.959f6fe2.css.gz +0 -0
- package/dist/web/public/session-ui.512816d8.js.br +0 -0
- package/dist/web/public/session-ui.512816d8.js.gz +0 -0
- package/dist/web/public/settings-ui.21b009ca.js.br +0 -0
- package/dist/web/public/settings-ui.21b009ca.js.gz +0 -0
- package/dist/web/public/styles.f3a0faa3.css +0 -1
- package/dist/web/public/styles.f3a0faa3.css.br +0 -0
- package/dist/web/public/styles.f3a0faa3.css.gz +0 -0
- package/dist/web/public/terminal-ui.0e930cb3.js +0 -3
- package/dist/web/public/terminal-ui.0e930cb3.js.br +0 -0
- package/dist/web/public/terminal-ui.0e930cb3.js.gz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--bg-dark: #09090b;--bg-card: #131316;--bg-input: #1a1a1f;--bg-hover: #1f1f26;--border: #232329;--border-light: #2e2e38;--text: #ececf0;--text-dim: #8b8b97;--text-muted: #52525e;--accent: #3b82f6;--accent-hover: #60a5fa;--green: #22c55e;--yellow: #eab308;--red: #ef4444;--header-height: 36px;--toolbar-height: 42px;--glass-bg: rgba(19, 19, 22, .85);--glass-border: rgba(255, 255, 255, .06);--subtle-shadow: 0 -1px 3px rgba(0, 0, 0, .3), 0 -4px 16px rgba(0, 0, 0, .15);--btn-radius: 6px;--transition-smooth: .2s cubic-bezier(.4, 0, .2, 1);--session-red: #ef4444;--session-orange: #f97316;--session-yellow: #eab308;--session-green: #22c55e;--session-blue: #3b82f6;--session-purple: #a855f7;--session-pink: #ec4899;--safe-area-top: env(safe-area-inset-top, 0px);--safe-area-bottom: env(safe-area-inset-bottom, 0px);--safe-area-left: env(safe-area-inset-left, 0px);--safe-area-right: env(safe-area-inset-right, 0px);--touch-target-min: 44px}*{box-sizing:border-box;margin:0;padding:0}.skip-link{position:absolute;top:-50px;left:8px;padding:8px 16px;background:var(--accent);color:#fff;text-decoration:none;border-radius:4px;z-index:10000;font-size:.875rem;transition:top .2s}.skip-link:focus{top:8px}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}:focus:not(:focus-visible){outline:none}button:focus-visible,.btn-toolbar:focus-visible,.btn-icon:focus-visible,.btn-icon-header:focus-visible,.btn-icon-sm:focus-visible{outline:2px solid var(--accent);outline-offset:2px}input:focus-visible,select:focus-visible,textarea:focus-visible{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent);outline:none}.xterm-helper-textarea{border:none!important;box-shadow:none!important;outline:none!important;opacity:0!important;caret-color:transparent!important}.touch-device .xterm .xterm-helper-textarea{left:var(--xterm-helper-left, 0px)!important;top:var(--xterm-helper-top, 0px)!important;width:1px!important;height:1px!important;z-index:0!important;font-size:16px!important}.session-tab:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;z-index:1}.modal-close:focus-visible{outline:2px solid var(--accent);outline-offset:2px}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:var(--bg-dark);color:var(--text);height:100vh;height:100dvh;height:var(--app-height, 100dvh);overflow:hidden}.app{display:flex;flex-direction:column;height:100vh;height:100dvh;height:var(--app-height, 100dvh)}.header{display:flex;align-items:flex-start;min-height:var(--header-height);padding:.35rem .75rem;background:var(--glass-bg);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--glass-border);flex-shrink:0;position:relative;z-index:100;contain:layout style paint}.header-brand{display:flex;align-items:center;padding-right:.75rem;border-right:1px solid var(--glass-border);margin-right:.5rem;height:var(--header-height);flex-shrink:0}.logo{font-size:.85rem;font-weight:700;color:var(--accent-hover);letter-spacing:-.02em;cursor:pointer;transition:color var(--transition-smooth),text-shadow var(--transition-smooth),filter var(--transition-smooth)}.logo:hover{color:#93c5fd;text-shadow:0 0 12px rgba(96,165,250,.5),0 0 24px rgba(96,165,250,.2);filter:brightness(1.1)}.session-tabs{display:flex;align-items:flex-start;flex-wrap:nowrap;gap:4px 2px;flex:1;overflow-x:auto;overflow-y:hidden;padding:.15rem .25rem;contain:layout}.session-tabs.tabs-two-rows{flex-wrap:wrap;overflow-x:hidden;overflow-y:auto;max-height:120px}.session-tabs::-webkit-scrollbar{width:4px;height:0}.session-tabs::-webkit-scrollbar-track{background:transparent}.session-tabs::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}.session-tabs::-webkit-scrollbar-thumb:hover{background:var(--border-light)}.session-tab{display:flex;align-items:center;gap:.35rem;position:relative;padding:.35rem .6rem;background:transparent;border:1px solid transparent;border-radius:var(--btn-radius);color:var(--text-dim);font-size:.75rem;cursor:pointer;white-space:nowrap;transition:background var(--transition-smooth),border-color var(--transition-smooth),color var(--transition-smooth),box-shadow var(--transition-smooth)}.session-tab:hover{background:#22c55e0f;color:var(--text);box-shadow:0 0 8px 2px #22c55e2e,inset 0 0 6px 1px #22c55e0f;border-color:#22c55e2e}.session-tab:active{background:#22c55e1f;box-shadow:0 0 12px 4px #22c55e59,inset 0 0 8px 2px #22c55e26;border-color:#22c55e4d}.session-tab.active{background:#22c55e26!important;border:2px solid #00FF66!important;color:#fff!important;box-shadow:none!important;outline:none!important}.session-tab.tab-loading:after{content:"";position:absolute;left:8px;right:8px;bottom:-2px;height:2px;border-radius:999px;background:linear-gradient(90deg,transparent,rgba(96,165,250,.95),transparent);animation:tab-load-sweep .9s linear infinite;pointer-events:none}.tab-load-spinner{width:10px;height:10px;border:2px solid rgba(96,165,250,.3);border-top-color:#60a5faf2;border-radius:50%;flex:0 0 10px;animation:tab-load-spin .7s linear infinite}@keyframes tab-load-spin{to{transform:rotate(360deg)}}@keyframes tab-load-sweep{0%{transform:translate(-45%);opacity:.35}50%{opacity:1}to{transform:translate(45%);opacity:.35}}.session-tab.tab-glow{animation:tab-glow .35s ease-out}@keyframes tab-glow{0%{box-shadow:0 0 #22c55e00;background:transparent}10%{box-shadow:0 0 18px 6px #22c55eb3,0 0 40px 12px #22c55e4d,inset 0 0 12px 3px #22c55e40;background:#22c55e1f}30%{box-shadow:0 0 14px 5px #22c55e80,0 0 30px 10px #22c55e33,inset 0 0 10px 2px #22c55e26;background:#22c55e14}to{box-shadow:0 0 #22c55e00;background:transparent}}.session-tab .tab-status{width:6px;height:6px;border-radius:50%;flex-shrink:0}.session-tab .tab-status.idle{background:var(--green)}.session-tab .tab-status.busy{background:var(--green);animation:pulse 1.5s infinite;will-change:opacity}.session-tab .tab-status.error{background:var(--red)}.session-tab .tab-status.ended{background:var(--text-muted);opacity:.5}.session-tab[data-color=red]{border-left:3px solid var(--session-red)}.session-tab[data-color=orange]{border-left:3px solid var(--session-orange)}.session-tab[data-color=yellow]{border-left:3px solid var(--session-yellow)}.session-tab[data-color=green]{border-left:3px solid var(--session-green)}.session-tab[data-color=blue]{border-left:3px solid var(--session-blue)}.session-tab[data-color=purple]{border-left:3px solid var(--session-purple)}.session-tab[data-color=pink]{border-left:3px solid var(--session-pink)}.session-tab.active[data-color=red]{background:#ef444426;border-color:#ef444480;box-shadow:0 0 10px #ef44444d}.session-tab.active[data-color=orange]{background:#f9731626;border-color:#f9731680;box-shadow:0 0 10px #f973164d}.session-tab.active[data-color=yellow]{background:#eab30826;border-color:#eab30880;box-shadow:0 0 10px #eab3084d}.session-tab.active[data-color=green]{background:#22c55e26;border-color:#22c55e80;box-shadow:0 0 10px #22c55e4d}.session-tab.active[data-color=blue]{background:#3b82f626;border-color:#3b82f680;box-shadow:0 0 10px #3b82f64d}.session-tab.active[data-color=purple]{background:#a855f726;border-color:#a855f780;box-shadow:0 0 10px #a855f74d}.session-tab.active[data-color=pink]{background:#ec489926;border-color:#ec489980;box-shadow:0 0 10px #ec48994d}.session-tab .tab-number{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:3px;background:#ffffff26;border:1px solid rgba(255,255,255,.35);color:#ffffffbf;font-size:.6rem;font-weight:700;flex-shrink:0;font-family:monospace}.session-tab.active .tab-number{background:#0f63!important;border-color:#00ff6680!important;color:#0f6!important}.session-tab .tab-info{display:flex;flex-direction:column;overflow:hidden;min-width:0}.session-tab .tab-name-row{display:flex;align-items:center;gap:.25rem}.session-tab .tab-name{overflow:hidden;text-overflow:ellipsis}.session-tab .tab-prefix{color:var(--text-muted)}.session-tab .tab-suffix{color:var(--text);font-weight:500}.session-tab .tab-folder{font-size:.6rem;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2;display:none}.tabs-show-folder .session-tab .tab-folder{display:block}.session-tab .tab-close{opacity:0;width:0;padding:0;font-size:.9rem;line-height:1;color:var(--text-muted);overflow:hidden;cursor:default;border-radius:3px;transition:opacity .05s ease-out,width .05s ease-out,padding .05s ease-out}.session-tab:hover .tab-close{opacity:1;width:auto;padding:.15rem .35rem}.session-tab .tab-close:hover{color:var(--red);background:#ffffff1a}.session-tab.new-tab{padding:.35rem .5rem;color:var(--text-muted);font-size:1rem;font-weight:300}.session-tab.new-tab:hover{color:var(--green)}.session-tab.tab-alert-action{animation:tab-blink-red 2.5s ease-in-out infinite}.session-tab.tab-alert-idle{animation:tab-blink-yellow 3.5s ease-in-out infinite}@keyframes tab-blink-red{0%,to{background:transparent;border-color:transparent}50%{background:#ef44441f;border-color:var(--red)}}@keyframes tab-blink-yellow{0%,to{background:transparent;border-color:transparent}50%{background:#eab3081a;border-color:var(--yellow)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.4}}.session-tab[draggable=true]{cursor:grab}.session-tab.dragging{opacity:.5;cursor:grabbing}.session-tab.drag-over-left{box-shadow:-2px 0 0 0 var(--accent)}.session-tab.drag-over-right{box-shadow:2px 0 0 0 var(--accent)}.header-right{display:flex;align-items:center;gap:.5rem;margin-left:auto;padding-left:.75rem;border-left:1px solid var(--glass-border)}.connection-indicator{display:flex;align-items:center;gap:.35rem;font-size:.7rem;color:var(--text-dim);font-family:SF Mono,Monaco,monospace;white-space:nowrap}.connection-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.connection-dot.offline{background:var(--red);box-shadow:0 0 6px var(--red)}.connection-dot.reconnecting{background:var(--yellow);animation:connection-pulse 1.5s ease-in-out infinite}.connection-dot.draining{background:var(--green);animation:connection-pulse .8s ease-in-out infinite}@keyframes connection-pulse{0%,to{opacity:1}50%{opacity:.3}}.tunnel-indicator{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:transparent;border:none;cursor:pointer;border-radius:var(--btn-radius);padding:0;position:relative;transition:background var(--transition-smooth)}.tunnel-indicator:hover{background:#ffffff0f}.tunnel-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 6px #22c55e,0 0 12px #22c55e66;animation:tunnel-glow 2s ease-in-out infinite}.tunnel-indicator.connecting .tunnel-dot{background:#f59e0b;box-shadow:0 0 6px #f59e0b,0 0 12px #f59e0b66;animation:tunnel-glow-amber 1s ease-in-out infinite}@keyframes tunnel-glow{0%,to{box-shadow:0 0 6px #22c55e,0 0 12px #22c55e66}50%{box-shadow:0 0 8px #22c55e,0 0 18px #22c55e99}}@keyframes tunnel-glow-amber{0%,to{box-shadow:0 0 6px #f59e0b,0 0 12px #f59e0b66;opacity:1}50%{box-shadow:0 0 4px #f59e0b;opacity:.4}}.tunnel-panel{position:fixed;top:36px;right:12px;width:320px;background:var(--bg-card);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 32px #00000080;z-index:1000;overflow:hidden}.tunnel-panel-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border)}.tunnel-panel-header h3{margin:0;font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:8px}.tunnel-panel-status{font-size:11px;font-weight:400;color:#22c55e}.tunnel-panel-status.offline{color:var(--text-muted)}.tunnel-panel-body{padding:10px 14px}.tunnel-panel-section{margin-bottom:12px}.tunnel-panel-section:last-child{margin-bottom:0}.tunnel-panel-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:6px}.tunnel-panel-url{font-family:SF Mono,Monaco,monospace;font-size:11px;color:var(--accent-hover);word-break:break-all;cursor:pointer;padding:6px 8px;background:var(--bg-input);border-radius:4px;transition:background .15s}.tunnel-panel-url:hover{background:var(--bg-hover)}.tunnel-panel-stat{display:flex;align-items:center;justify-content:space-between;padding:4px 0;font-size:12px;color:var(--text-dim)}.tunnel-panel-stat-value{color:var(--text);font-family:SF Mono,Monaco,monospace;font-size:11px}.tunnel-panel-session{display:flex;align-items:center;gap:8px;padding:6px 8px;background:var(--bg-input);border-radius:4px;margin-bottom:4px;font-size:11px;color:var(--text-dim)}.tunnel-panel-session-dot{width:6px;height:6px;border-radius:50%;background:#22c55e;flex-shrink:0}.tunnel-panel-session-info{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tunnel-panel-session-method{font-size:10px;padding:1px 5px;border-radius:3px;background:var(--bg-hover);color:var(--text-muted);text-transform:uppercase;flex-shrink:0}.tunnel-panel-actions{display:flex;gap:6px;padding-top:8px;border-top:1px solid var(--border)}.tunnel-panel-btn{flex:1;padding:6px 0;font-size:12px;font-weight:500;border:1px solid var(--border);border-radius:5px;cursor:pointer;text-align:center;transition:all .15s}.tunnel-panel-btn.btn-start{background:#22c55e1a;border-color:#22c55e4d;color:#22c55e}.tunnel-panel-btn.btn-start:hover{background:#22c55e33}.tunnel-panel-btn.btn-stop{background:#ef44441a;border-color:#ef44444d;color:#ef4444}.tunnel-panel-btn.btn-stop:hover{background:#ef444433}.tunnel-panel-btn.btn-qr{background:var(--bg-input);color:var(--text-dim)}.tunnel-panel-btn.btn-qr:hover{background:var(--bg-hover);color:var(--text)}.tunnel-panel-btn.btn-revoke{background:#ef44441a;border-color:#ef44444d;color:#ef4444;font-size:11px}.tunnel-panel-btn.btn-revoke:hover{background:#ef444433}.tunnel-panel-empty{font-size:11px;color:var(--text-muted);font-style:italic;padding:4px 0}.header-tokens{font-size:.75rem;font-weight:500;color:var(--accent-hover);font-family:SF Mono,Monaco,monospace}.header-system-stats{display:flex;gap:.75rem;font-size:.65rem;font-family:SF Mono,Monaco,monospace;color:var(--text-dim);padding:0 .5rem}.stat-item{display:flex;align-items:center;gap:.35rem}.stat-label{color:var(--text-muted);font-size:.6rem;text-transform:uppercase;min-width:24px}.stat-bar{width:40px;height:5px;background:#ffffff0f;border-radius:3px;overflow:hidden}.stat-bar-fill{height:100%;border-radius:3px;transition:width .3s ease,background .3s ease}.stat-bar-cpu{background:linear-gradient(90deg,var(--green) 0%,var(--green) 100%)}.stat-bar-cpu.medium{background:linear-gradient(90deg,var(--green) 0%,var(--yellow) 100%)}.stat-bar-cpu.high{background:linear-gradient(90deg,var(--yellow) 0%,var(--red) 100%)}.stat-bar-mem{background:linear-gradient(90deg,var(--accent) 0%,var(--accent-hover) 100%)}.stat-bar-mem.medium{background:linear-gradient(90deg,var(--accent) 0%,var(--yellow) 100%)}.stat-bar-mem.high{background:linear-gradient(90deg,var(--yellow) 0%,var(--red) 100%)}.stat-value{min-width:32px;text-align:right;color:var(--text-dim)}.stat-value.high{color:var(--red);font-weight:500}.btn-icon-header{display:flex;align-items:center;justify-content:center;width:26px;height:26px;background:transparent;border:none;color:var(--text-muted);font-size:1rem;cursor:pointer;border-radius:var(--btn-radius);transition:all var(--transition-smooth)}.btn-icon-header:hover{background:#ffffff12;color:var(--text);transform:rotate(45deg)}.btn-multimonitor--hidden{display:none!important}.btn-icon-header.btn-settings{width:30px;height:30px;margin-left:0}.btn-icon-header.btn-sm{width:20px;height:20px;font-size:.7rem;font-weight:600}.btn-icon-header.btn-sm:hover{transform:none}.header-font-controls{display:flex;align-items:center;gap:.25rem;padding:.15rem .4rem;background:#ffffff0a;border:1px solid rgba(255,255,255,.04);border-radius:var(--btn-radius)}.header-font-controls .font-size-display{font-size:.7rem;color:var(--text-muted);min-width:18px;text-align:center;font-family:SF Mono,Monaco,monospace}.session-tab .tab-gear{opacity:0;width:0;padding:0;font-size:1rem;line-height:1;color:var(--text-muted);cursor:pointer;overflow:hidden;transition:opacity .15s,width .15s,padding .15s,transform .2s}.session-tab:hover .tab-gear{opacity:1;width:auto;padding:0 .3rem}.session-tab .tab-gear:hover{color:var(--accent-hover);transform:rotate(45deg)}.session-tab .tab-detach{opacity:0;width:0;padding:0;font-size:.95rem;line-height:1;color:var(--text-muted);cursor:pointer;overflow:hidden;transition:opacity .15s,width .15s,padding .15s}.session-tab:hover .tab-detach{opacity:1;width:auto;padding:0 .3rem}.session-tab .tab-detach:hover{color:var(--accent-hover);background:#ffffff1a;border-radius:3px}.session-tab.detached{opacity:.72}.session-tab.detached .tab-detach{opacity:1;width:auto;padding:0 .3rem;color:var(--accent-hover)}.session-tab .tab-detached-badge{display:none;align-items:center;font-size:.55rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:1px 4px;margin-left:4px;border-radius:3px;background:#60a5fa2e;color:var(--accent-hover)}.session-tab.detached .tab-detached-badge{display:inline-flex}body.solo-mode .session-tabs,body.solo-mode .header-system-stats,body.solo-mode .header-tokens,body.solo-mode .btn-notifications,body.solo-mode .btn-multimonitor,body.solo-mode .btn-lifecycle-log{display:none!important}.solo-session-title{flex:1;min-width:0;font-weight:600;font-size:13px;color:var(--text);padding:0 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.solo-gone-overlay{position:fixed;inset:0;z-index:5000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:#09090beb;color:var(--text);text-align:center;padding:24px}.solo-gone-overlay h2{margin:0;font-size:18px}.solo-gone-overlay p{margin:0;color:var(--text-muted);font-size:13px}.session-tab .tab-mode{font-size:.6rem;padding:1px 4px;border-radius:3px;background:var(--bg-hover);color:var(--text-muted);text-transform:uppercase}.session-tab .tab-mode.shell{background:#eab30833;color:var(--yellow)}.session-tab .tab-mode.opencode{background:#10b98133;color:#10b981}.session-tab .tab-mode.codex{background:#a855f733;color:#a855f7}.timer-banner{display:flex;align-items:center;gap:1rem;padding:.4rem 1rem;background:linear-gradient(90deg,#1e3a5fcc,#152238cc);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid rgba(59,130,246,.2);flex-shrink:0}.timer-content{display:flex;align-items:center;gap:1rem;flex:1}.timer-value{font-size:1rem;font-weight:600;font-family:SF Mono,Monaco,monospace;color:var(--accent-hover)}.timer-progress{flex:1;height:4px;background:#0000004d;border-radius:2px;max-width:200px}.timer-progress-fill{height:100%;background:linear-gradient(90deg,#3b82f6,#60a5fa);border-radius:2px;transition:width 1s linear}.timer-meta{font-size:.7rem;color:var(--text-dim)}.respawn-banner{display:flex;padding:.25rem .75rem;background:linear-gradient(90deg,#1e3a1ecc,#132513cc);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid rgba(34,197,94,.2);font-size:.7rem;flex-shrink:0}.respawn-compact-layout{display:flex;width:100%;gap:1rem}.respawn-status-col{display:flex;flex-direction:column;gap:.15rem;min-width:0;flex-shrink:0}.respawn-status-row1{display:flex;align-items:center;gap:.5rem}.respawn-status-row2{display:flex;align-items:center;gap:.5rem;min-height:1.2em;font-size:.65rem;color:var(--text-dim)}.respawn-status-row2:empty{display:none}.respawn-countdown-timers{display:flex;gap:.3rem;flex-wrap:wrap}.respawn-countdown-timer{display:flex;align-items:center;gap:.25rem;background:#00000059;padding:.1rem .35rem;border-radius:3px;font-family:SF Mono,Monaco,monospace;font-size:.6rem}.respawn-countdown-timer .timer-name{color:var(--text-dim)}.respawn-countdown-timer .timer-value{color:var(--green);font-weight:500;min-width:2em;text-align:right}.respawn-timer-bar{width:30px;height:2px;background:#ffffff26;border-radius:1px;overflow:hidden}.respawn-timer-progress{height:100%;background:var(--green);transition:width .1s linear}.respawn-action-log{flex:1;max-height:3.2em;overflow-y:auto;font-size:.65rem;font-family:SF Mono,Monaco,monospace;color:var(--text-dim);border-left:1px solid rgba(34,197,94,.2);padding-left:.5rem}.respawn-action-log::-webkit-scrollbar{width:3px}.respawn-action-log::-webkit-scrollbar-thumb{background:#22c55e4d;border-radius:2px}.respawn-action-entry{padding:.05rem 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.respawn-action-entry .action-time{color:var(--text-muted);margin-right:.3rem}.respawn-action-entry .action-type{color:var(--green);margin-right:.3rem}.respawn-action-entry .action-detail{color:var(--text-dim)}.respawn-action-entry.action-command{color:var(--accent)}.respawn-action-entry.action-command .action-type{color:var(--accent);font-weight:600}.respawn-action-entry.action-command .action-detail{color:var(--text);font-weight:500}.respawn-indicator{color:var(--green);animation:spin 2s linear infinite;font-size:.8rem}.respawn-state{color:#fff;font-weight:600;background:#22c55e4d;padding:.1rem .4rem;border-radius:3px;font-size:.7rem}.respawn-state.respawn-blocked{background:#f443364d;color:#f44336;animation:respawn-blocked-pulse 1.5s ease-in-out infinite}@keyframes respawn-blocked-pulse{0%,to{opacity:1}50%{opacity:.6}}.respawn-cycles{color:var(--text-muted);font-family:SF Mono,Monaco,monospace;font-size:.65rem}.respawn-timer{color:var(--accent-hover);font-family:SF Mono,Monaco,monospace;font-weight:500;font-size:.65rem;padding:0 .4rem;border-left:1px solid rgba(34,197,94,.3)}.respawn-tokens{color:var(--text-dim);font-family:SF Mono,Monaco,monospace;font-size:.65rem}.detection-status{color:var(--text-dim);font-size:.65rem}.detection-ai-check{font-size:.65rem;padding:.05rem .3rem;border-radius:2px;background:#ffffff1a}.detection-ai-check.ai-checking{color:var(--accent);background:#3b82f626}.detection-ai-check.ai-idle{color:var(--green);background:#22c55e26}.detection-ai-check.ai-working{color:var(--yellow);background:#eab30826}.detection-ai-check.ai-disabled{color:var(--text-muted);background:#ffffff0d}.detection-confidence{color:var(--text-dim);font-family:SF Mono,Monaco,monospace;font-size:.6rem;padding:.05rem .25rem;background:#22c55e26;border-radius:2px}.detection-confidence.high{background:#22c55e4d;color:var(--green)}.detection-confidence.medium{background:#eab30833;color:var(--yellow)}.detection-confidence.hook-confirmed{background:#8b5cf64d;color:var(--purple, #a78bfa)}.detection-hook{font-size:.65rem;padding:.05rem .3rem;border-radius:2px;background:#8b5cf626;color:var(--purple, #a78bfa)}.detection-hook.hook-active{background:#8b5cf640;color:var(--purple, #a78bfa);font-weight:500}@keyframes pulse-hook{0%,to{opacity:1}50%{opacity:.7}}.ralph-panel{background:var(--glass-bg);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--glass-border);font-size:.75rem;flex-shrink:0;overflow:hidden;position:relative;overflow-anchor:none;contain:layout style paint}.ralph-ring-mini{position:relative;width:32px;height:32px;flex-shrink:0}.ralph-ring-svg{width:100%;height:100%;transform:rotate(-90deg)}.ralph-ring-bg{fill:none;stroke:var(--bg-input);stroke-width:3}.ralph-ring-progress{fill:none;stroke:url(#ralphGradient);stroke-width:3;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;transition:stroke-dashoffset .5s ease-out}.ralph-ring-progress-mini{fill:none;stroke:url(#ralphGradientMini);stroke-width:3;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100;transition:stroke-dashoffset .5s ease-out}.ralph-ring-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.4rem;font-weight:700;background:linear-gradient(135deg,#3b82f6,#22c55e);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;line-height:1;text-align:center}.ralph-summary-info{flex:1;display:flex;align-items:center;gap:.75rem;min-width:0}.ralph-title{font-weight:600;color:var(--text);font-size:.8rem;white-space:nowrap}.ralph-status-badge{display:flex;align-items:center;gap:.35rem;padding:.2rem .5rem;border-radius:4px;background:var(--bg-input);font-size:.7rem;font-weight:500}.ralph-status-dot{width:6px;height:6px;border-radius:50%;background:var(--text-muted);transition:background .2s}.ralph-status-badge.active .ralph-status-dot{background:var(--accent);animation:ralph-pulse 1.5s ease-in-out infinite}.ralph-status-badge.completed .ralph-status-dot{background:var(--green)}.ralph-status-badge.tracking .ralph-status-dot{background:var(--yellow)}@keyframes ralph-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(1.2)}}.ralph-circuit-breaker{display:flex;align-items:center;gap:.25rem;padding:.2rem .5rem;border-radius:4px;font-size:.7rem;font-weight:600;cursor:pointer;transition:all .2s;margin-left:.5rem}.ralph-circuit-breaker.half-open{background:#ffc10733;color:#ffc107;border:1px solid rgba(255,193,7,.4)}.ralph-circuit-breaker.half-open:hover{background:#ffc1074d}.ralph-circuit-breaker.open{background:#f4433633;color:#f44336;border:1px solid rgba(244,67,54,.4);animation:circuit-breaker-pulse 1s ease-in-out infinite}.ralph-circuit-breaker.open:hover{background:#f443364d}.ralph-circuit-breaker .cb-icon{font-size:.8rem}.ralph-circuit-breaker .cb-text{font-size:.65rem;text-transform:uppercase;letter-spacing:.5px}@keyframes circuit-breaker-pulse{0%,to{opacity:1}50%{opacity:.7}}.ralph-status-block{background:var(--bg-input);border-radius:4px;padding:.5rem .75rem;margin-top:.5rem;font-size:.75rem}.ralph-status-block-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.4rem;font-weight:600;color:var(--text-bright)}.ralph-status-block-status{padding:.1rem .4rem;border-radius:3px;font-size:.65rem;font-weight:600;text-transform:uppercase}.ralph-status-block-status.in-progress{background:#2196f333;color:#2196f3}.ralph-status-block-status.complete{background:#4caf5033;color:#4caf50}.ralph-status-block-status.blocked{background:#f4433633;color:#f44336}.ralph-status-block-stats{display:flex;gap:1rem;color:var(--text-dim)}.ralph-status-block-stats span{display:flex;align-items:center;gap:.25rem}.ralph-status-block-recommendation{margin-top:.4rem;padding-top:.4rem;border-top:1px solid var(--border);color:var(--text-muted);font-style:italic}.ralph-summary-stats{display:flex;align-items:center;gap:.75rem}.ralph-stat{display:flex;align-items:center;gap:.25rem;color:var(--text-dim);font-size:.7rem}.ralph-stat-icon{font-size:.75rem;opacity:.7}.ralph-toggle{color:var(--text-dim);font-size:.6rem;flex-shrink:0}.ralph-panel.collapsed .ralph-detail{display:none}.ralph-detail{padding:.5rem .75rem;border-top:1px solid var(--border);background:var(--bg-dark)}.ralph-detail-row{display:flex;align-items:center;gap:1rem}.ralph-ring-compact{position:relative;width:75px;height:75px;flex-shrink:0}.ralph-ring-compact .ralph-ring-percent{font-size:.95rem;font-weight:600}.ralph-ring-compact .ralph-ring-label{font-size:.55rem}.ralph-info-unified{flex:1;display:flex;align-items:flex-start;gap:.75rem;overflow:hidden;min-width:0;background:var(--bg-input);padding:.4rem .6rem;border-radius:4px}.ralph-info-labels{display:grid;grid-template-columns:auto auto;gap:.15rem .5rem;flex-shrink:0;align-items:center}.ralph-info-row{display:contents}.ralph-info-label{font-size:.5rem;white-space:nowrap;text-transform:uppercase;letter-spacing:.3px;color:var(--text-muted);text-align:right}.ralph-info-unified code{font-size:.7rem;font-weight:500;padding:0;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:transparent;color:var(--text)}.ralph-info-unified span:not(.ralph-info-label){font-size:.7rem;font-weight:500;color:var(--text)}.ralph-info-unified .ralph-tasks-count{font-size:.7rem;font-weight:500;color:var(--text)}.ralph-info-unified .ralph-tasks-grid{flex:1;display:flex;flex-wrap:wrap;gap:.2rem;padding:0;max-height:60px;overflow-y:auto;align-content:flex-start}.ralph-tasks-compact .ralph-task-card{padding:.2rem .4rem;font-size:.65rem;border-left-width:2px}.ralph-tasks-compact .ralph-task-icon{font-size:.7rem}.ralph-tasks-compact .ralph-task-content{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ralph-ring-svg-large{width:100%;height:100%;transform:rotate(-90deg)}.ralph-ring-track{fill:none;stroke:var(--bg-input);stroke-width:6}.ralph-ring-fill{fill:none;stroke:url(#ralphGradient);stroke-width:6;stroke-linecap:round;stroke-dasharray:264;stroke-dashoffset:264;transition:stroke-dashoffset .5s ease-out}.ralph-ring-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center}.ralph-ring-percent{font-size:1.25rem;font-weight:700;color:var(--text);line-height:1}.ralph-ring-label{font-size:.6rem;color:var(--text-dim);margin-top:.15rem}.ralph-tasks-count{color:var(--text-dim);font-weight:400}.ralph-tasks-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:.5rem;padding:.5rem;max-height:200px;overflow-y:auto}.ralph-task-card{display:flex;align-items:flex-start;gap:.5rem;padding:.5rem;background:var(--bg-dark);border-radius:4px;border-left:2px solid var(--text-muted);transition:border-color .2s,background .2s;position:relative}.ralph-task-card.task-pending{border-left-color:var(--text-muted)}.ralph-task-card.task-in-progress{border-left-color:var(--accent);background:#3b82f60d}.ralph-task-card.task-completed{border-left-color:var(--green);opacity:.75}.ralph-task-icon{flex-shrink:0;width:16px;height:16px;display:flex;align-items:center;justify-content:center;font-size:.7rem;border-radius:50%}.ralph-task-card.task-pending .ralph-task-icon{color:var(--text-muted)}.ralph-task-card.task-in-progress .ralph-task-icon{color:var(--accent);animation:ralph-spin 2s linear infinite}.ralph-task-card.task-completed .ralph-task-icon{color:var(--green)}@keyframes ralph-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ralph-task-content{flex:1;font-size:.7rem;color:var(--text-dim);line-height:1.3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ralph-task-card.task-completed .ralph-task-content{color:var(--text-dim)}.ralph-task-priority{font-size:.55rem;font-weight:700;padding:.1rem .25rem;border-radius:2px;flex-shrink:0;text-transform:uppercase}.ralph-task-priority.priority-p0{background:#f443364d;color:#f44336}.ralph-task-priority.priority-p1{background:#ffc1074d;color:#ffc107}.ralph-task-priority.priority-p2{background:#2196f333;color:#2196f3}.ralph-task-card.task-priority-p0{border-left-color:#f44336}.ralph-task-card.task-priority-p1:not(.task-completed){border-left-color:#ffc107}.ralph-state-empty{color:var(--text-muted);font-style:italic;padding:.5rem}.ralph-summary{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;user-select:none;transition:background .15s}.ralph-summary-content{display:flex;align-items:center;gap:.75rem;flex:1;cursor:pointer}.ralph-summary-content:hover{background:var(--bg-hover)}.ralph-controls{display:flex;gap:.25rem;flex-shrink:0}.ralph-menu-container{position:relative}.ralph-dropdown{display:none;position:absolute;top:100%;right:0;background:#16161cf2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.08);border-radius:10px;min-width:170px;box-shadow:0 8px 32px #0006,0 2px 8px #0003;z-index:1000;padding:4px}.ralph-dropdown.show{display:block}.ralph-dropdown button{display:block;width:100%;padding:.5rem .75rem;border:none;background:transparent;color:var(--text);text-align:left;font-size:.75rem;cursor:pointer;border-radius:var(--btn-radius);transition:background var(--transition-smooth)}.ralph-dropdown button:hover{background:#ffffff12}.ralph-dropdown hr{margin:.25rem 4px;border:none;border-top:1px solid rgba(255,255,255,.06)}.ralph-panel.detached{position:fixed;top:80px;left:50px;width:600px;height:400px;min-width:350px;min-height:200px;max-width:90vw;max-height:80vh;z-index:1000;border:1px solid rgba(255,255,255,.08);border-radius:12px;box-shadow:0 16px 64px #00000080,0 4px 16px #0000004d;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);overflow:hidden;resize:both;display:flex;flex-direction:column}.ralph-panel.detached .ralph-summary{cursor:move;background:linear-gradient(180deg,var(--bg-hover) 0%,var(--bg-card) 100%);border-bottom:1px solid var(--border);border-radius:8px 8px 0 0;flex-shrink:0}.ralph-panel.detached .ralph-summary-content{cursor:move}.ralph-panel.detached .ralph-summary-content:hover{background:transparent}.ralph-panel.detached .ralph-detail{flex:1;max-height:none;overflow:auto;display:flex;flex-direction:column}.ralph-panel.detached .ralph-detail-row{flex:1;overflow:auto}.ralph-panel.detached .ralph-info-unified{flex-direction:column;flex:1;overflow:auto}.ralph-panel.detached .ralph-info-unified .ralph-tasks-grid{max-height:none;flex:1}.ralph-panel.detached.collapsed{min-height:auto;height:auto}.main{flex:1;display:flex;overflow:hidden;background:var(--bg-dark);position:relative}.terminal-wrap{flex:1;display:flex;flex-direction:column;overflow:hidden}.terminal-container{flex:1;background:#0d0d0d;overflow:hidden;position:relative;contain:layout paint;will-change:contents}.terminal-container .xterm{width:100%;min-width:0;height:100%;padding:0}.terminal-container .xterm-viewport{background:transparent!important}.welcome-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:var(--bg-dark);z-index:10;opacity:0;pointer-events:none;transition:opacity .3s cubic-bezier(.4,0,.2,1)}.welcome-overlay.visible{opacity:1;pointer-events:auto}.welcome-content{text-align:center;max-width:520px;padding:2rem}.welcome-title{font-size:3.5rem;font-weight:800;background:linear-gradient(135deg,#60a5fa,#93c5fd,#60a5fa);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;margin-bottom:1rem;letter-spacing:-.04em}.welcome-desc{color:var(--text-dim);font-size:.9rem;line-height:1.6;margin-bottom:.5rem}.welcome-actions{display:flex;gap:.75rem;justify-content:center;flex-wrap:wrap;margin-top:2rem;margin-bottom:1.5rem}.welcome-btn{display:flex;align-items:center;gap:.5rem;padding:.7rem 1.3rem;font-size:.85rem;font-weight:600;border-radius:10px;border:1px solid transparent;cursor:pointer;transition:all var(--transition-smooth);letter-spacing:.01em}.welcome-btn-claude{background:linear-gradient(135deg,#1a3358,#1e4fb8,#2563eb);border-color:#3b82f666;color:#e0e7ff;box-shadow:0 2px 8px #2563eb33,inset 0 1px #ffffff14}.welcome-btn-claude:hover{background:linear-gradient(135deg,#2454a8,#2d6cf0,#4b8af7);box-shadow:0 4px 20px #3b82f659,0 0 40px #3b82f626,inset 0 1px #ffffff1a;border-color:#60a5fa80;color:#fff;transform:translateY(-1px)}.welcome-btn-opencode{background:linear-gradient(135deg,#0a2e2a,#0b3d35,#0d4a40);border-color:#10b98166;color:#6ee7b7;box-shadow:0 2px 8px #10b98126,inset 0 1px #ffffff0f}.welcome-btn-opencode:hover{background:linear-gradient(135deg,#0d4a40,#116a58,#15856e);box-shadow:0 4px 20px #10b9814d,0 0 40px #10b9811a,inset 0 1px #ffffff14;border-color:#34d39980;color:#a7f3d0;transform:translateY(-1px)}.welcome-btn-tunnel{background:linear-gradient(135deg,#221538,#3b1a7a,#6d28d9);border-color:#7c3aed66;color:#ddd6fe;box-shadow:0 2px 8px #6d28d933,inset 0 1px #ffffff0f}.welcome-btn-tunnel:hover{background:linear-gradient(135deg,#4c1d95,#6d28d9,#7c3aed);box-shadow:0 4px 20px #7c3aed59,0 0 40px #7c3aed26,inset 0 1px #ffffff1a;border-color:#8b5cf680;color:#fff;transform:translateY(-1px)}.welcome-btn-tunnel.active{background:linear-gradient(135deg,#047857,#059669,#10b981);border-color:#34d39980;color:#ecfdf5;box-shadow:0 2px 8px #10b98133,inset 0 1px #ffffff14}.welcome-btn-tunnel.active:hover{background:linear-gradient(135deg,#059669,#10b981,#34d399);box-shadow:0 4px 20px #34d39959,0 0 40px #34d39926,inset 0 1px #ffffff1a;color:#fff;transform:translateY(-1px)}.welcome-btn-tunnel.connecting{background:linear-gradient(135deg,#1e1e3a,#312e81,#4338ca);border-color:#6366f166;color:#c7d2fe;cursor:wait}.tunnel-spinner{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.25);border-top-color:currentColor;border-radius:50%;animation:tunnel-spin .8s linear infinite;flex-shrink:0}@keyframes tunnel-spin{to{transform:rotate(360deg)}}.welcome-qr{display:none;flex-direction:column;align-items:center;margin-top:1.5rem;margin-bottom:.5rem;cursor:pointer;transition:transform .2s ease}.welcome-qr.visible{display:flex}.welcome-qr-inner{background:#fff;border-radius:10px;padding:12px;width:140px;height:140px;transition:width .25s ease,height .25s ease,padding .25s ease}.welcome-qr-inner svg{width:100%;height:100%}.welcome-qr.expanded .welcome-qr-inner{width:280px;height:280px;padding:16px}.welcome-qr-url{margin-top:8px;font-family:monospace;font-size:11px;color:var(--text-muted);word-break:break-all;max-width:320px;text-align:center}.history-sessions{margin-top:1.5rem;width:100%;max-width:560px}.history-title{font-size:.85rem;color:var(--text-dim);margin-bottom:.5rem;font-weight:500;text-align:left}.history-list{display:flex;flex-direction:column;gap:.35rem;max-height:240px;overflow-y:auto}.history-item{display:flex;flex-direction:column;background:#ffffff08;border:1px solid rgba(255,255,255,.06);border-radius:8px;transition:all var(--transition-smooth);text-align:left}.history-item:hover{border-color:#3b82f64d;background:#ffffff0f;box-shadow:0 2px 8px #0003}.history-item.expanded{border-color:#3b82f659;background:#ffffff0d}.history-item-main{display:flex;align-items:center;gap:.6rem;padding:.55rem .8rem;cursor:pointer;border-radius:8px}.history-item-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:.2rem}.history-item-title{font-size:.8rem;color:var(--text);line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.history-item-subtitle{font-size:.65rem;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-item-subtitle.is-case{color:#7aa7ff;font-weight:500}.history-item-meta{font-size:.7rem;color:var(--text-muted);white-space:nowrap;align-self:center}.history-item-expand{appearance:none;border:none;background:transparent;color:var(--text-dim);font-size:1.1rem;line-height:1;padding:.25rem .4rem;cursor:pointer;border-radius:6px;transition:background var(--transition-smooth),color var(--transition-smooth);flex-shrink:0}.history-item-expand:hover{background:#ffffff14;color:var(--text)}.history-item.expanded .history-item-expand{color:#7aa7ff;transform:rotate(90deg)}.history-item-detail{padding:.5rem .8rem .7rem;border-top:1px dashed rgba(255,255,255,.08);display:flex;flex-direction:column;gap:.4rem;font-size:.72rem;color:var(--text-muted)}.history-item-detail[hidden]{display:none}.history-detail-row{display:flex;gap:.5rem;align-items:flex-start;word-break:break-word}.history-detail-label{color:var(--text-dim);min-width:46px;flex-shrink:0;font-size:.65rem;text-transform:uppercase;letter-spacing:.04em;padding-top:.1rem}.history-detail-value{color:var(--text);flex:1;min-width:0;white-space:pre-wrap}.history-detail-path{font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:.68rem;color:#a8b5c9}.history-detail-meta{color:var(--text-dim);font-size:.68rem}@media(max-width:640px){.history-item-meta{font-size:.65rem}.history-item-main{gap:.45rem;padding:.6rem .7rem}}.history-show-more{width:100%;padding:.5rem;margin-top:.25rem;background:#ffffff0a;border:1px dashed rgba(255,255,255,.1);border-radius:8px;color:var(--text-muted);font-size:.75rem;cursor:pointer;transition:background var(--transition-smooth),color var(--transition-smooth)}.history-show-more:hover{background:#ffffff14;color:var(--text)}.history-detail-actions{margin-top:.5rem}.history-view-all-btn{width:100%;padding:.45rem .75rem;background:#63b3ed14;border:1px solid rgba(99,179,237,.25);border-radius:6px;color:#63b3edf2;font-size:.78rem;font-weight:500;cursor:pointer;transition:background var(--transition-smooth),border-color var(--transition-smooth)}.history-view-all-btn:hover{background:#63b3ed26;border-color:#63b3ed80}.folder-history-modal .modal-body{padding:.75rem 1rem 1rem}.folder-history-subtitle{color:var(--text-muted);font-size:.78rem;font-family:SF Mono,Menlo,Consolas,monospace;word-break:break-all;margin-bottom:.75rem;padding-bottom:.5rem;border-bottom:1px solid rgba(255,255,255,.06)}.folder-history-list{display:flex;flex-direction:column;gap:.5rem}.folder-history-empty{padding:2rem .5rem;text-align:center;color:var(--text-muted);font-size:.85rem}.welcome-hint{color:var(--text-muted);font-size:.8rem}.welcome-hint kbd{display:inline-block;padding:.15rem .45rem;background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:5px;font-family:inherit;font-size:.75rem;color:var(--text-dim);box-shadow:0 1px 2px #00000026}.welcome-ralph-link{background:none;border:none;color:var(--text-muted);font-size:.75rem;cursor:pointer;padding:.25rem 0;margin-top:.25rem;transition:color .15s ease}.welcome-ralph-link:hover{color:var(--accent)}.toolbar{display:flex;align-items:center;justify-content:space-between;position:relative;height:var(--toolbar-height);padding:0 .75rem;background:var(--glass-bg);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-top:1px solid var(--glass-border);box-shadow:0 -1px 3px #0003,0 -4px 12px #0000001a;flex-shrink:0;contain:style}.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:.5rem}.toolbar-center{position:absolute;left:50%;transform:translate(-50%)}.version-display{font-family:SF Mono,Monaco,monospace;font-size:.6rem;color:var(--text-muted);padding:.2rem .5rem;background:#ffffff0a;border:1px solid rgba(255,255,255,.04);border-radius:var(--btn-radius);cursor:default;user-select:none;opacity:.8;letter-spacing:.02em}.toolbar-group{display:flex;align-items:center;gap:0}.btn-toolbar{display:flex;align-items:center;gap:.35rem;padding:.4rem .8rem;background:#ffffff0d;border:1px solid rgba(255,255,255,.07);border-radius:var(--btn-radius);color:var(--text-dim);font-size:.75rem;cursor:pointer;transition:all var(--transition-smooth);white-space:nowrap}.btn-toolbar:hover{background:#ffffff17;color:var(--text);border-color:#ffffff1f;box-shadow:0 1px 4px #0003}.btn-toolbar:active{background:#ffffff0f;transform:translateY(.5px)}.btn-toolbar.btn-sm{padding:.3rem .55rem;font-size:.7rem}.btn-toolbar.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn-toolbar.btn-primary:hover{background:var(--accent-hover)}.run-btn-group{display:flex;position:relative}.btn-toolbar.btn-run{border-radius:var(--btn-radius) 0 0 var(--btn-radius);border-right:1px solid rgba(255,255,255,.12);font-weight:600;padding:.45rem .9rem;gap:.45rem;letter-spacing:.01em}.btn-toolbar.btn-run svg{flex-shrink:0;width:12px;height:12px}.btn-toolbar.btn-run-gear{border-radius:0 var(--btn-radius) var(--btn-radius) 0;padding:.45rem;min-width:unset}.btn-toolbar.btn-run.mode-claude,.btn-toolbar.btn-run-gear.mode-claude{background:linear-gradient(135deg,#1a3358,#1e4fb8,#2563eb);border-color:#3b82f680;color:#e0e7ff;box-shadow:0 1px 2px #0003,inset 0 1px #ffffff14}.btn-toolbar.btn-run.mode-claude:hover,.btn-toolbar.btn-run-gear.mode-claude:hover{background:linear-gradient(135deg,#2454a8,#2d6cf0,#4b8af7);box-shadow:0 0 16px #3b82f666,0 2px 8px #3b82f633,inset 0 1px #ffffff1a;border-color:#60a5fa99;color:#fff}.btn-toolbar.btn-run.mode-opencode,.btn-toolbar.btn-run-gear.mode-opencode{background:linear-gradient(135deg,#0a2e2a,#0b3d35,#0d4a40);border-color:#10b98180;color:#6ee7b7;box-shadow:0 1px 2px #0003,inset 0 1px #ffffff0f}.btn-toolbar.btn-run.mode-opencode:hover,.btn-toolbar.btn-run-gear.mode-opencode:hover{background:linear-gradient(135deg,#0d4a40,#116a58,#15856e);box-shadow:0 0 12px #10b98159,0 2px 8px #10b98133,inset 0 1px #ffffff14;border-color:#34d39999;color:#a7f3d0}.btn-toolbar.btn-run.mode-codex,.btn-toolbar.btn-run-gear.mode-codex{background:linear-gradient(135deg,#2a0a3e,#350b4d,#400d5e);border-color:#a855f780;color:#d8b4fe;box-shadow:0 1px 2px #0003,inset 0 1px #ffffff0f}.btn-toolbar.btn-run.mode-codex:hover,.btn-toolbar.btn-run-gear.mode-codex:hover{background:linear-gradient(135deg,#400d5e,#581c87,#6b21a8);box-shadow:0 0 12px #a855f759,0 2px 8px #a855f733,inset 0 1px #ffffff14;border-color:#c084fc99;color:#e9d5ff}.run-mode-menu{display:none;position:absolute;bottom:100%;left:0;margin-bottom:6px;background:#16161cf2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:4px;z-index:1000;min-width:190px;max-width:300px;box-shadow:0 8px 32px #00000080,0 2px 8px #0000004d}.run-mode-menu.active{display:flex;flex-direction:column;gap:2px}.run-mode-option{display:flex;align-items:center;gap:8px;padding:7px 12px;background:none;border:none;border-radius:var(--btn-radius);color:var(--text);cursor:pointer;font-size:.8rem;white-space:nowrap;transition:background var(--transition-smooth)}.run-mode-option:hover{background:#ffffff12}.run-mode-option.selected{background:#ffffff14;font-weight:600}.run-mode-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.run-mode-dot.claude{background:#3b82f6}.run-mode-dot.opencode{background:#10b981}.run-mode-dot.codex{background:#a855f7}.run-mode-sep{height:1px;background:var(--border);margin:4px 0}.run-mode-header{padding:4px 10px 2px;font-size:.72em;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;font-weight:600}.run-mode-history{max-height:200px;overflow-y:auto}.run-mode-option .hist-dir{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.run-mode-option .hist-meta{font-size:.85em;color:var(--text-muted);white-space:nowrap}.run-mode-hist-empty{padding:6px 10px;color:var(--text-muted);font-style:italic}.btn-toolbar.btn-shell{background:linear-gradient(135deg,#1a2e1a,#1e3a1e,#234023);border-color:#2d5a2d99;color:#8fbc8f;font-weight:600;letter-spacing:.01em;box-shadow:0 1px 2px #0003,inset 0 1px #ffffff0d}.btn-toolbar.btn-shell:hover{background:linear-gradient(135deg,#234023,#2d5a2d,#357035);border-color:#3d7a3db3;box-shadow:0 0 12px #228b224d,0 2px 8px #228b2226,inset 0 1px #ffffff14;color:#a8d8a8}.btn-toolbar.btn-stop{display:none;background:linear-gradient(135deg,#4a1515,#5a1a1a,#7f1d1d);border-color:#dc262680;color:#fca5a5;font-weight:600;box-shadow:0 1px 2px #0003,inset 0 1px #ffffff0d}.btn-toolbar.btn-stop:hover{background:linear-gradient(135deg,#7f1d1d,#991b1b,#b91c1c);border-color:#ef444499;box-shadow:0 0 12px #dc262659,0 2px 8px #dc262633,inset 0 1px #ffffff14;color:#fff}.btn-toolbar.btn-stop svg{flex-shrink:0;width:12px;height:12px}.btn-toolbar.btn-stop.confirming{background:linear-gradient(135deg,#6b4f00,#856200);border-color:#b8860b;color:#ffd54f;font-size:.65rem;white-space:nowrap}.btn-settings-mobile{display:none}.btn-toolbar.btn-case-mobile{display:none;background:transparent;border:1px solid rgba(255,255,255,.2);color:#9ca3af;gap:4px}.btn-toolbar.btn-case-mobile:hover{background:#ffffff1a;color:#fff}.btn-toolbar.btn-case-mobile svg{flex-shrink:0}.btn-toolbar.btn-case-mobile #mobileCaseName{max-width:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn-voice-mobile,.btn-case-settings-mobile,.case-settings-popover-mobile,.case-settings-popover-mobile.hidden{display:none}.btn-toolbar .btn-icon{display:inline-flex;align-items:center;justify-content:center}.btn-toolbar.btn-success{background:linear-gradient(135deg,#16a34a,#22c55e);border-color:#22c55e80;color:#fff;box-shadow:0 1px 2px #0003,inset 0 1px #ffffff1a}.btn-toolbar.btn-success:hover{background:linear-gradient(135deg,#15803d,#16a34a);box-shadow:0 0 10px #22c55e4d,inset 0 1px #ffffff1a}.btn-toolbar.btn-danger{color:var(--red);border-color:#ef444433}.btn-toolbar.btn-danger:hover{background:linear-gradient(135deg,#b91c1c,#ef4444);color:#fff;border-color:#ef444480;box-shadow:0 0 10px #ef444440}.btn-toolbar.btn-voice{padding:.3rem .5rem}@media(max-width:1023px){.toolbar-center .btn-toolbar.btn-voice{display:none!important}}.btn-toolbar.btn-voice:hover{color:var(--text);border-color:#3b82f666}.btn-toolbar.btn-voice.recording{background:#ef444433;border-color:#ef444499;color:#ef4444;animation:voice-pulse 1.2s ease-in-out infinite}.btn-toolbar.btn-voice.recording:hover{background:#ef44444d;border-color:#ef4444cc;color:#f87171}@keyframes voice-pulse{0%,to{box-shadow:0 0 #ef444480;background:#ef444433}50%{box-shadow:0 0 0 6px #ef444400;background:#ef444459}}@media(prefers-reduced-motion:reduce){.btn-toolbar.btn-voice.recording,.btn-voice-mobile.recording{animation:none}}.voice-preview{position:fixed;bottom:48px;left:50%;transform:translate(-50%);background:#000000e0;color:#ffffffb3;font-style:italic;font-family:var(--font-mono, monospace);padding:8px 20px;border-radius:8px;border:1px solid rgba(255,255,255,.1);font-size:.85rem;max-width:80%;max-height:3.6em;overflow:hidden;z-index:10001;pointer-events:none;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.voice-preview-badge{display:inline-block;font-size:.6rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;background:#3b82f64d;color:#60a5fa;padding:1px 5px;border-radius:3px;font-style:normal;vertical-align:middle}.voice-provider-status{font-size:.75rem;color:var(--text-dim);padding:2px 8px;border-radius:4px;background:#ffffff0d}.voice-provider-status.active{color:#4ade80;background:#4ade801a}.voice-recording-indicator{display:inline-flex;align-items:center;gap:6px;margin-right:8px;flex-shrink:0}.voice-rec-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#ef4444;animation:voice-rec-blink 1s ease-in-out infinite}@keyframes voice-rec-blink{0%,to{opacity:1}50%{opacity:.3}}.voice-level-bars{display:inline-flex;align-items:flex-end;gap:2px;height:14px}.voice-level-bar{display:inline-block;width:3px;background:#ef444440;border-radius:1px;transition:background .1s ease,height .1s ease}.voice-level-bar:nth-child(1){height:4px}.voice-level-bar:nth-child(2){height:7px}.voice-level-bar:nth-child(3){height:10px}.voice-level-bar:nth-child(4){height:13px}.voice-level-bar:nth-child(5){height:14px}.voice-level-bar.active{background:#ef4444}.voice-timer{font-size:.7rem;font-weight:600;color:#ef4444;font-variant-numeric:tabular-nums;min-width:2.5em}.voice-preview:has(.voice-recording-indicator){border-color:#ef44444d;background:#140000eb}@media(prefers-reduced-motion:reduce){.voice-rec-dot{animation:none;opacity:1}}.voice-send-active{background:#22c55e33!important;border-color:#22c55eb3!important;color:#22c55e!important;animation:voice-send-glow 1.4s ease-in-out infinite}.voice-send-active:active{transform:scale(.9);background:#22c55e66!important}@keyframes voice-send-glow{0%,to{box-shadow:0 0 4px #22c55e4d;border-color:#22c55e80!important}50%{box-shadow:0 0 12px #22c55e99;border-color:#22c55ee6!important}}.voice-send-active.voice-send-blink{animation:voice-send-flash .4s ease-out!important}@keyframes voice-send-flash{0%{background:#22c55e99!important;box-shadow:0 0 16px #22c55ecc}to{background:transparent!important;box-shadow:none;opacity:0}}@media(prefers-reduced-motion:reduce){.voice-send-active{animation:none;box-shadow:0 0 6px #22c55e66}.voice-send-active.voice-send-blink{animation:none}}.form-row input[type=password]{width:100%;padding:.5rem .75rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.8rem;font-family:inherit}.form-row input[type=password]:focus{outline:none;border-color:var(--accent)}.btn-icon-only{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:transparent;border:1px solid rgba(255,255,255,.07);border-radius:var(--btn-radius);color:var(--text-dim);font-size:.7rem;cursor:pointer;transition:all var(--transition-smooth)}.btn-icon-only:hover{background:#ffffff12;color:var(--text)}.case-select-group{display:flex;align-items:stretch;position:relative}.toolbar-select{padding:.4rem 1.5rem .4rem .6rem;background:#ffffff0d;border:1px solid rgba(255,255,255,.07);border-radius:var(--btn-radius) 0 0 var(--btn-radius);color:var(--text-dim);font-size:.75rem;cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238b8b97' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .4rem center;width:fit-content;min-width:unset;max-width:unset;transition:all var(--transition-smooth)}.toolbar-select:hover{border-color:#ffffff1f;background:#ffffff12}.toolbar-select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px #3b82f633}.btn-case-add{display:flex;align-items:center;justify-content:center;width:28px;background:#ffffff0d;border:1px solid rgba(255,255,255,.07);border-left:none;border-radius:0;color:var(--green);font-size:1.1rem;font-weight:500;cursor:pointer;transition:all var(--transition-smooth)}.btn-case-add:hover{background:var(--green);color:#fff;border-color:var(--green);box-shadow:0 0 8px #22c55e4d}.btn-case-settings{display:flex;align-items:center;justify-content:center;width:28px;background:#ffffff0d;border:1px solid rgba(255,255,255,.07);border-left:none;border-radius:0 var(--btn-radius) var(--btn-radius) 0;color:var(--text-dim);font-size:1rem;cursor:pointer;transition:all var(--transition-smooth)}.btn-case-settings:hover{background:var(--accent);color:#fff;border-color:var(--accent)}.case-settings-popover{position:absolute;bottom:100%;right:0;margin-bottom:6px;background:#16161cf2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:.6rem .7rem;width:220px;z-index:1000;box-shadow:0 8px 32px #0006,0 2px 8px #0003}.case-settings-popover.hidden{display:none}.case-settings-popover .form-hint{margin-top:.2rem;font-size:.6rem}.case-manage-list{display:flex;flex-direction:column;gap:4px;max-height:320px;overflow-y:auto}.case-manage-item{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;background:#ffffff08;border:1px solid rgba(255,255,255,.06);border-radius:6px;transition:background var(--transition-smooth)}.case-manage-item:hover{background:#ffffff0f}.case-manage-info{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.case-manage-name{font-size:.8rem;font-weight:500;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.case-manage-path{font-size:.65rem;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.case-manage-actions{display:flex;gap:4px;margin-left:10px;flex-shrink:0}.case-manage-btn{display:flex;align-items:center;justify-content:center;width:26px;height:26px;background:#ffffff0d;border:1px solid rgba(255,255,255,.08);border-radius:4px;color:var(--text-dim);font-size:.65rem;cursor:pointer;transition:all var(--transition-smooth)}.case-manage-btn:hover:not(:disabled){background:#ffffff1a;color:var(--text)}.case-manage-btn:disabled{opacity:.25;cursor:not-allowed}.case-manage-btn-delete:hover:not(:disabled){background:#ef444426;border-color:#ef44444d;color:#ef4444}.toolbar-input{padding:.4rem .5rem;background:var(--bg-input);border:1px solid var(--accent);border-radius:4px;color:var(--text);font-size:.75rem;width:350px;max-width:50vw}.tab-count-group{display:flex;align-items:center;background:#ffffff0a;border:1px solid rgba(255,255,255,.07);border-radius:var(--btn-radius);overflow:hidden;margin:0 .25rem}.tab-count-btn{display:flex;align-items:center;justify-content:center;width:22px;height:26px;background:transparent;border:none;color:var(--text-dim);font-size:.85rem;font-weight:500;cursor:pointer;transition:all var(--transition-smooth)}.tab-count-btn:hover{background:#ffffff14;color:var(--accent-hover)}.tab-count-btn:active{background:var(--accent);color:#fff}.tab-count-input{width:24px;height:26px;background:transparent;border:none;border-left:1px solid var(--border);border-right:1px solid var(--border);color:var(--text);font-size:.75rem;font-weight:600;text-align:center;font-family:SF Mono,Monaco,monospace;-moz-appearance:textfield}.tab-count-input::-webkit-inner-spin-button,.tab-count-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.tab-count-input:focus{outline:none}.toolbar-input-sm{padding:.3rem .4rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.75rem;width:40px;text-align:center}.toolbar-input-sm:focus{outline:none;border-color:var(--accent)}.toolbar-input-sm::-webkit-inner-spin-button,.toolbar-input-sm::-webkit-outer-spin-button{opacity:1;height:16px}#dirDisplay{max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.toolbar-input:focus{outline:none}.toolbar-input.hidden{display:none}.font-size-display{font-size:.65rem;color:var(--text-muted);min-width:20px;text-align:center;font-family:SF Mono,Monaco,monospace}.btn-close{background:transparent;border:none;color:var(--text-dim);font-size:1.2rem;cursor:pointer;padding:0 .25rem;line-height:1}.btn-close:hover{color:var(--text)}.btn-icon-sm{background:transparent;border:none;color:var(--text-dim);font-size:1rem;cursor:pointer;padding:.25rem;line-height:1;border-radius:4px}.btn-icon-sm:hover{color:var(--text);background:var(--bg-hover)}.settings-section{margin-bottom:1.25rem;padding-bottom:1rem;border-bottom:1px solid var(--border)}.settings-section:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.form-row{margin-bottom:.75rem}.form-row label{display:block;font-size:.7rem;color:var(--text-dim);margin-bottom:.35rem;text-transform:uppercase;letter-spacing:.03em}.form-row input[type=text],.form-row input[type=number],.form-row textarea,.form-select{width:100%;padding:.5rem .75rem;background:#ffffff0a;border:1px solid rgba(255,255,255,.08);border-radius:var(--btn-radius);color:var(--text);font-size:.8rem;font-family:inherit;transition:border-color var(--transition-smooth),box-shadow var(--transition-smooth)}.form-row input:focus,.form-row textarea:focus,.form-select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 2px #3b82f626}.form-col{flex:1}.form-col label{display:block;font-size:.7rem;color:var(--text-dim);margin-bottom:.35rem;text-transform:uppercase;letter-spacing:.03em}.input-suffix{display:flex;align-items:center}.input-suffix input{flex:1;border-radius:4px 0 0 4px;border-right:none}.input-suffix span{padding:.5rem;background:var(--bg-hover);border:1px solid var(--border);border-radius:0 4px 4px 0;color:var(--text-muted);font-size:.75rem}.form-hint{display:block;font-size:.65rem;color:var(--text-muted);margin-top:.35rem}.preset-selector{display:flex;gap:8px;align-items:center}.preset-selector select{flex:1;min-width:0;padding:.4rem .5rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.75rem}.preset-selector select:focus{outline:none;border-color:var(--accent)}.preset-selector .btn-sm{white-space:nowrap;padding:4px 8px;font-size:.7rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);cursor:pointer;transition:all .15s}.preset-selector .btn-sm:hover{background:var(--bg-hover);border-color:var(--border-light)}.form-section-header{font-size:.7rem;font-weight:600;color:var(--text-dim);text-transform:uppercase;letter-spacing:.05em;margin:1rem 0 .5rem;padding-bottom:.25rem;border-bottom:1px solid var(--border)}.form-section-header:first-child{margin-top:0}.form-row-switch{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.form-row-switch>label:first-child{margin-bottom:0;min-width:120px}.form-row-switch .form-hint{flex-basis:100%;margin-top:.25rem}.switch{position:relative;display:inline-block;width:36px;height:20px;flex-shrink:0}.switch input{opacity:0;width:0;height:0}.switch .slider{position:absolute;cursor:pointer;inset:0;background-color:#ffffff0f;border:1px solid rgba(255,255,255,.08);transition:.2s cubic-bezier(.4,0,.2,1);border-radius:20px}.switch .slider:before{position:absolute;content:"";height:14px;width:14px;left:2px;bottom:2px;background-color:var(--text-muted);transition:.2s;border-radius:50%}.switch input:checked+.slider{background-color:var(--accent);border-color:var(--accent)}.switch input:checked+.slider:before{transform:translate(16px);background-color:#fff}.switch input:focus+.slider{box-shadow:0 0 0 2px #3b82f64d}.switch-sm{width:28px;height:16px}.switch-sm .slider:before{height:10px;width:10px;left:2px;bottom:2px}.switch-sm input:checked+.slider:before{transform:translate(12px)}.settings-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem 1rem}.settings-section-header{grid-column:1 / -1;font-size:.65rem;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);padding:.5rem 0 .25rem;border-bottom:1px solid var(--border);margin-top:.75rem}.settings-section-header:first-child{margin-top:0}.settings-item{display:flex;align-items:center;justify-content:space-between;padding:.45rem .7rem;background:#ffffff08;border:1px solid rgba(255,255,255,.06);border-radius:var(--btn-radius);font-size:.75rem;transition:background var(--transition-smooth)}.settings-item-label{color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.settings-item-multiline{align-items:center}.settings-item-text{display:flex;flex-direction:column;gap:.15rem;min-width:0}.settings-item-desc{font-size:.6rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.settings-item-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.settings-grid-3col{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}.settings-item-input{width:60px;padding:.2rem .4rem;font-size:.7rem;background:var(--bg-dark);border:1px solid var(--border);border-radius:3px;color:var(--text);text-align:right}.settings-item-input:focus{outline:none;border-color:var(--accent)}.settings-status{font-size:.6rem;padding:2px 6px;border-radius:3px;background:var(--bg-hover);color:var(--text-dim)}.settings-status.granted{background:#22c55e33;color:var(--green)}.settings-status.denied{background:#ef444433;color:var(--red)}.event-type-grid{display:grid;grid-template-columns:1fr 50px 50px 50px 50px;gap:6px 8px;align-items:center;margin-top:8px;padding:8px;background:var(--bg-dark);border-radius:4px}.event-header{font-size:.65rem;text-transform:uppercase;color:var(--text-dim);text-align:center;font-weight:500}.event-header:first-child{text-align:left}.event-label{font-size:.75rem;color:var(--text)}.event-type-grid input[type=checkbox]{justify-self:center;width:14px;height:14px;cursor:pointer}.color-picker{display:flex;gap:6px;flex-wrap:wrap}.color-swatch{width:28px;height:28px;border-radius:4px;border:2px solid transparent;background:transparent;padding:2px;cursor:pointer;transition:border-color .15s,transform .1s}.color-swatch:hover{transform:scale(1.1)}.color-swatch.selected{border-color:var(--accent)}.swatch-inner{display:block;width:100%;height:100%;border-radius:2px}.form-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem;padding:.75rem;border-top:1px solid var(--border)}.modal{display:none;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;contain:layout paint}.modal.active{display:flex}.modal-backdrop{position:absolute;inset:0;background:#0009;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}.modal-content{position:relative;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.08);border-radius:12px;width:90%;max-width:400px;box-shadow:0 16px 64px #00000080,0 4px 16px #0000004d;contain:layout style paint}.modal-content.modal-sm{max-width:340px}.modal-content.modal-lg{max-width:540px;max-height:85vh;display:flex;flex-direction:column}.modal-content.modal-lg>.modal-body{overflow-y:auto;flex:1;min-height:0}#appSettingsModal .modal-content.modal-lg{max-width:600px}.mobile-case-picker-sheet{position:fixed;bottom:0;left:0;right:0;background:#1a1a1a;border-radius:16px 16px 0 0;max-height:70vh;display:flex;flex-direction:column;z-index:1001;box-shadow:0 -4px 20px #0006}.mobile-case-picker-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid rgba(255,255,255,.1)}.mobile-case-picker-header h3{margin:0;font-size:1.1rem;font-weight:600;color:#fff}.mobile-case-picker-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:8px 0;max-height:50vh}.mobile-case-list{display:flex;flex-direction:column}.mobile-case-item{display:flex;align-items:center;gap:12px;padding:14px 20px;background:transparent;border:none;color:#e5e5e5;font-size:.95rem;text-align:left;cursor:pointer;transition:background .1s;width:100%}.mobile-case-item:hover{background:#ffffff0d}.mobile-case-item:active{background:#ffffff1a}.mobile-case-item.selected{background:#22c55e26;color:#22c55e}.mobile-case-item-icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;color:#666;flex-shrink:0}.mobile-case-item.selected .mobile-case-item-icon{color:#22c55e}.mobile-case-item-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-case-item-check{width:20px;height:20px;display:flex;align-items:center;justify-content:center;color:#22c55e;opacity:0;flex-shrink:0}.mobile-case-item.selected .mobile-case-item-check{opacity:1}.mobile-case-item-delete{width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:var(--text-dim);opacity:.4;flex-shrink:0;border-radius:4px;transition:all var(--transition-smooth)}.mobile-case-item-delete:active{opacity:1;color:#ef4444;background:#ef444426}.mobile-case-picker-footer{padding:12px 20px 16px;border-top:1px solid rgba(255,255,255,.1)}.btn-case-create-mobile{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 16px;background:var(--bg-input);border:1px solid var(--border-light);border-radius:8px;color:var(--text);font-size:.9rem;font-weight:500;cursor:pointer;transition:background .15s}.btn-case-create-mobile:hover,.btn-case-create-mobile:active{background:var(--bg-hover)}.btn-case-create-mobile svg{width:16px;height:16px}.fix-plan-modal{max-width:600px;width:95%}.fix-plan-textarea{width:100%;height:400px;font-family:SF Mono,Monaco,Menlo,monospace;font-size:.75rem;line-height:1.4;background:var(--bg-dark);color:var(--text);border:1px solid var(--border);border-radius:4px;padding:.75rem;resize:vertical}.fix-plan-stats{color:var(--text-muted);font-size:.75rem;margin-right:auto}#summary-tab{display:flex;flex-direction:column;max-height:calc(70vh - 120px);overflow:hidden}#summary-tab.hidden,#respawn-tab.hidden,#context-tab.hidden,#ralph-tab.hidden,#summary-tab.hidden .run-summary-filters,#summary-tab.hidden .run-summary-timeline,#summary-tab.hidden .run-summary-footer{display:none!important}#summary-tab .run-summary-filters{flex-shrink:0}#summary-tab .run-summary-timeline{flex:1;min-height:0;max-height:none}#summary-tab .run-summary-footer{flex-shrink:0}.run-summary-filters{display:flex;gap:.375rem;margin-bottom:.75rem;flex-wrap:wrap}.filter-btn{padding:.25rem .625rem;background:transparent;border:1px solid rgba(255,255,255,.08);border-radius:100px;color:var(--text-dim);cursor:pointer;font-size:.7rem;transition:all .15s}.filter-btn:hover{background:#ffffff0a;border-color:#ffffff26;color:var(--text)}.filter-btn.active{background:var(--accent);border-color:var(--accent);color:var(--bg)}.run-summary-timeline{max-height:400px;overflow-y:auto;padding-right:.25rem;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.1) transparent}.run-summary-timeline::-webkit-scrollbar{width:4px}.run-summary-timeline::-webkit-scrollbar-track{background:transparent}.run-summary-timeline::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:2px}.run-summary-timeline::-webkit-scrollbar-thumb:hover{background:#fff3}.timeline-event{display:flex;gap:.5rem;padding:.5rem .625rem;margin-bottom:.375rem;background:#ffffff05;border-radius:6px;border-left:2px solid var(--border);transition:background .15s;content-visibility:auto;contain-intrinsic-size:auto 40px}.timeline-event:hover{background:#ffffff0a}.timeline-event.event-success{border-left-color:var(--green)}.timeline-event.event-warning{border-left-color:var(--yellow)}.timeline-event.event-error{border-left-color:var(--red)}.timeline-event.event-info{border-left-color:var(--accent)}.event-icon{font-size:.9rem;flex-shrink:0;opacity:.8}.event-content{flex:1;min-width:0}.event-header{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem}.event-title{font-weight:500;font-size:.8rem;color:var(--text)}.event-time{font-size:.65rem;color:var(--text-muted);flex-shrink:0;font-family:SF Mono,Monaco,monospace}.event-details{font-size:.7rem;color:var(--text-dim);margin-top:.125rem}.run-summary-session-info{font-size:.7rem;color:var(--text-muted);font-family:SF Mono,Monaco,monospace;padding:.25rem 0}.run-summary-footer{display:flex;flex-direction:column;gap:.5rem;margin-top:.75rem;padding-top:.625rem;border-top:1px solid rgba(255,255,255,.06)}.run-summary-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.run-summary-actions .btn-toolbar{font-size:.7rem;padding:.25rem .5rem}.auto-refresh-label{display:flex;align-items:center;gap:.25rem;font-size:.7rem;color:var(--text-dim);cursor:pointer}.auto-refresh-label input[type=checkbox]{cursor:pointer;width:12px;height:12px}.run-summary-timeline .empty-message{color:var(--text-muted);font-size:.75rem;text-align:center;padding:2rem 1rem;margin:0}#runSummaryModal .modal-footer{display:flex;flex-direction:column;gap:.5rem;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.06)}#runSummaryModal .modal-footer .run-summary-session-info{font-size:.7rem;color:var(--text-muted);font-family:SF Mono,Monaco,monospace}.modal-warning-text{color:var(--text-dim);font-size:.85rem;margin-bottom:.5rem}.close-options{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem}.close-option{display:flex;flex-direction:column;align-items:center;text-align:center;padding:.75rem 1rem;background:var(--bg-hover);border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:all .15s;text-align:left}.close-option:hover{background:var(--bg-card);border-color:var(--accent)}.close-option-danger{border-color:var(--red);background:#ef44441a}.close-option-danger:hover{background:#ef444433;border-color:var(--red)}.close-option-title{font-weight:500;font-size:.9rem;color:var(--text)}.close-option-danger .close-option-title{color:var(--red)}.close-option-desc{font-size:.75rem;color:var(--text-muted);margin-top:.15rem}.modal-footer-cancel{display:flex;justify-content:center;padding-top:.5rem;border-top:1px solid var(--border)}.modal-session-name{font-family:SF Mono,Monaco,monospace;font-size:.8rem;color:var(--accent-hover);background:var(--bg-input);padding:.5rem .75rem;border-radius:4px;border:1px solid var(--border)}.session-respawn-section{padding-top:0;margin-top:0}.session-respawn-status{display:flex;align-items:center;gap:.4rem;font-size:.75rem;padding:.25rem .5rem;background:var(--bg-input);border-radius:4px}.session-respawn-status .respawn-status-indicator{width:6px;height:6px;border-radius:50%;background:var(--text-muted)}.session-respawn-status .respawn-status-text{color:var(--text-dim)}.session-respawn-status.active .respawn-status-indicator{background:var(--green);animation:pulse 1.5s infinite}.session-respawn-status.active .respawn-status-text{color:var(--green)}.checkbox-inline{display:flex;align-items:center;gap:.35rem;cursor:pointer;font-size:.8rem;color:var(--text-dim)}.checkbox-inline input[type=checkbox]{accent-color:var(--accent)}.checkbox-inline:hover{color:var(--text)}.input-suffix-sm{display:flex;align-items:center}.input-suffix-sm input{width:80px;padding:.35rem .5rem;font-size:.75rem}.input-suffix-sm span{padding:.35rem .4rem;font-size:.7rem}.duration-presets{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.duration-preset-btn{padding:.4rem .7rem;font-size:.75rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-dim);cursor:pointer;transition:all .15s}.duration-preset-btn:hover{border-color:var(--border-light);color:var(--text)}.duration-preset-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}.duration-custom{display:flex;align-items:center;gap:.35rem}.duration-custom-input{display:none}.duration-custom-input.visible{display:flex}.duration-custom-input input{width:60px}.respawn-header{display:flex;align-items:center;justify-content:center;gap:1rem;margin-top:.75rem;padding-top:.75rem;border-top:1px solid rgba(34,197,94,.2)}.respawn-header .respawn-actions{margin:0;padding:0;border:none}.respawn-options-row{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.25rem}.auto-resume-box{display:flex;flex-direction:column;gap:.3rem;margin:.75rem 0;padding:.6rem .75rem;background:#3b82f612;border:1px solid rgba(59,130,246,.35);border-radius:6px}.auto-resume-box .checkbox-inline{font-size:.85rem;font-weight:500;color:var(--text)}.auto-resume-box .form-hint{margin-top:0}.respawn-loop-box{margin:.75rem 0;padding:.6rem .75rem;background:#22c55e0d;border:1px solid rgba(34,197,94,.3);border-radius:6px}.respawn-loop-title{font-size:.85rem;font-weight:500;color:var(--text);margin-bottom:.3rem}.respawn-loop-hint{display:block;margin-top:0;margin-bottom:.5rem}.respawn-loop-box .form-section-header{border-bottom-color:#22c55e33}.respawn-loop-box .checkbox-inline{font-size:.7rem}.auto-resume-status{display:none;font-size:.7rem;font-weight:600;color:var(--accent-hover)}.auto-resume-status.active{display:block}.respawn-actions{display:flex;gap:.5rem}.modal-tabs{display:flex;gap:.5rem;padding:0 1rem .75rem;border-bottom:1px solid var(--border)}.modal-tab-btn{padding:.5rem 1rem;font-size:.8rem;background:transparent;border:1px solid var(--border);border-radius:4px;color:var(--text-dim);cursor:pointer;transition:all .15s}.modal-tab-btn:hover{background:var(--bg-input);color:var(--text)}.modal-tab-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}.modal-tab-content.hidden{display:none!important}.context-settings-grid{display:flex;flex-direction:column;gap:.75rem;margin-bottom:.75rem}.context-setting{padding:.875rem;background:#ffffff05;border:1px solid var(--border);border-radius:6px}.context-setting-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.625rem}.context-setting-header .checkbox-inline span{font-weight:500}.context-setting-header .input-suffix-sm{flex-shrink:0}.context-setting-header .input-suffix-sm input{width:70px}.context-setting input[type=text]{width:100%;padding:.375rem .5rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.75rem}.context-setting input[type=text]:focus{outline:none;border-color:var(--accent)}.context-setting .form-hint{margin-top:.5rem}.ralph-limits-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin-bottom:.5rem}@media(max-width:500px){.ralph-limits-grid{grid-template-columns:1fr 1fr}}.ralph-limits-grid .form-col input[type=number]{width:100%;padding:.375rem .5rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.8rem}.ralph-limits-grid .form-col .form-hint{font-size:.6rem}.ralph-config-actions{display:flex;gap:.5rem;margin-top:.75rem;padding-top:.75rem;border-top:1px solid var(--border)}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.25rem;border-bottom:1px solid rgba(255,255,255,.06)}.modal-header h3{font-size:.95rem;font-weight:600}.modal-header-actions{display:flex;align-items:center;gap:.25rem}.modal-close{background:transparent;border:none;color:var(--text-dim);font-size:1.5rem;cursor:pointer;line-height:1}.modal-close:hover{color:var(--text)}.modal-body{padding:1rem}.shortcuts-grid{display:grid;grid-template-columns:auto 1fr;gap:.5rem 1rem;font-size:.8rem}.shortcuts-grid>div:nth-child(odd){text-align:right}.shortcuts-grid>div:nth-child(2n){color:var(--text-dim)}kbd{display:inline-block;padding:.15rem .45rem;background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:5px;font-family:SF Mono,Monaco,monospace;box-shadow:0 1px 2px #0003;font-size:.7rem;color:var(--text)}.token-stats-modal{max-width:560px;max-height:85vh;overflow:hidden;display:flex;flex-direction:column}.token-stats-modal .modal-body{overflow-y:auto;padding:1rem}.stats-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin-bottom:1.25rem}.stat-card{background:#ffffff08;border:1px solid var(--border);padding:.75rem;border-radius:8px;text-align:center}.stat-card-label{display:block;font-size:.65rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:.25rem}.stat-card-value{display:block;font-size:1.1rem;font-weight:600;color:var(--text);font-family:SF Mono,Monaco,monospace}.stat-card-cost{display:block;font-size:.7rem;color:var(--accent-hover);margin-top:.15rem}.stats-chart-container{margin-bottom:1.25rem}.stats-chart-label,.stats-table-label{font-size:.7rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:.5rem}.stats-chart{display:flex;align-items:flex-end;gap:4px;height:80px;padding:0 4px}.stats-chart .bar{flex:1;background:linear-gradient(to top,var(--accent),var(--green));border-radius:3px 3px 0 0;min-height:3px;transition:opacity .15s;position:relative}.stats-chart .bar:hover{opacity:.8}.stats-chart .bar:after{content:attr(data-tooltip);position:absolute;bottom:100%;left:50%;transform:translate(-50%);padding:.25rem .5rem;background:var(--bg-card);border:1px solid var(--border);border-radius:4px;font-size:.65rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:10}.stats-chart .bar:hover:after{opacity:1}.stats-chart-days{display:flex;gap:4px;padding:0 4px;margin-top:.35rem}.stats-chart-days span{flex:1;text-align:center;font-size:.6rem;color:var(--text-muted)}.stats-table-container{max-height:200px;overflow-y:auto}.stats-table{width:100%;font-size:.75rem}.stats-table-header,.stats-table-row{display:grid;grid-template-columns:1fr 1fr 1fr .8fr;gap:.5rem;padding:.5rem .25rem;border-bottom:1px solid var(--border)}.stats-table-header{color:var(--text-muted);font-size:.65rem;text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--bg-card)}.stats-table-row:last-child{border-bottom:none}.stats-table-row .cell{font-family:SF Mono,Monaco,monospace}.stats-table-row .cell-date{color:var(--text-dim)}.stats-table-row .cell-cost{color:var(--accent-hover)}.stats-no-data{text-align:center;color:var(--text-muted);padding:2rem 1rem;font-size:.8rem}.header-tokens.clickable{cursor:pointer;transition:color .15s}.header-tokens.clickable:hover{color:var(--text)}.toast-container{position:fixed;top:calc(var(--header-height) + .5rem);right:.5rem;display:flex;flex-direction:column;gap:.5rem;z-index:10000;pointer-events:none}.toast{background:var(--bg-card);border:1px solid var(--border);border-radius:6px;padding:.6rem 1rem;font-size:.8rem;color:var(--text);box-shadow:0 4px 12px #0006;transform:translate(100%);opacity:0;transition:all .2s ease;pointer-events:auto}.toast.show{transform:translate(0);opacity:1}.toast-success{border-color:#22c55e66}.toast-error{border-color:#ef444466}.toast-warning{border-color:#eab30866}.toast-info{border-color:#3b82f666}.btn-icon-header.btn-notifications{position:relative;width:32px;height:32px;font-size:1.1rem;margin-left:0;margin-right:2px}.btn-icon-header.btn-notifications:hover{transform:none}.notification-badge{position:absolute;top:2px;right:2px;min-width:16px;height:16px;padding:0 4px;background:var(--red);color:#fff;font-size:.6rem;font-weight:700;border-radius:8px;display:flex;align-items:center;justify-content:center;pointer-events:none;animation:notif-badge-pulse 2s ease-in-out infinite}@keyframes notif-badge-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}.notification-drawer{position:fixed;top:var(--header-height);right:0;width:340px;height:calc(100vh - var(--header-height));height:calc(100dvh - var(--header-height));background:var(--bg-card);border-left:1px solid var(--border);z-index:10001;display:flex;flex-direction:column;transform:translate(100%);transition:transform .2s ease;box-shadow:-4px 0 16px #0000004d}.notification-drawer.open{transform:translate(0)}.notif-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--border);flex-shrink:0}.notif-drawer-title{font-size:.85rem;font-weight:600;color:var(--text)}.notif-drawer-actions{display:flex;gap:4px}.btn-notif-action{background:none;border:1px solid var(--border);color:var(--text-dim);width:26px;height:26px;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.75rem;transition:all .15s}.btn-notif-action:hover{background:var(--bg-hover);color:var(--text);border-color:var(--border-light)}.notif-drawer-list{flex:1;overflow-y:auto;padding:6px}.notif-drawer-empty{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-muted);font-size:.8rem}.notif-item{padding:10px 12px;margin-bottom:4px;border-radius:6px;border-left:3px solid var(--border-light);background:var(--bg-dark);cursor:pointer;transition:background .15s;animation:notif-slide-in .2s ease;content-visibility:auto;contain-intrinsic-size:auto 60px}.notif-item:hover{background:var(--bg-hover)}.notif-item.unread{background:#3b82f60d}.notif-item-critical{border-left-color:var(--red)}.notif-item-warning{border-left-color:var(--yellow)}.notif-item-info{border-left-color:var(--accent)}.notif-item-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.notif-item-title{font-size:.78rem;font-weight:600;color:var(--text)}.notif-item-count{font-size:.65rem;color:var(--text-muted);margin-left:6px}.notif-item-time{font-size:.65rem;color:var(--text-muted);white-space:nowrap}.notif-item-message{font-size:.72rem;color:var(--text-dim);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.notif-item-session{display:inline-block;margin-top:4px;padding:1px 6px;background:var(--bg-hover);border:1px solid var(--border);border-radius:3px;font-size:.65rem;color:var(--text-dim)}@keyframes notif-slide-in{0%{transform:translate(20px);opacity:0}to{transform:translate(0);opacity:1}}.session-tab .tab-badge{display:flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;background:var(--yellow);border-radius:8px;font-size:.65rem;font-weight:600;color:#000;animation:pulse 1.5s infinite}.session-tab .tab-badge.completed{background:var(--green);animation:none}.session-tab .tab-subagent-badge{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:2px;height:16px;padding:0 5px;border-radius:8px;font-size:.6rem;cursor:pointer;background:var(--accent);color:#fff;margin-left:4px;transition:transform .1s,background .15s}@media(hover:hover){.session-tab .tab-subagent-badge:hover{background:var(--accent-hover);transform:scale(1.05)}}.session-tab .tab-subagent-badge .subagent-label{font-size:.55rem;font-weight:600;letter-spacing:.03em}.subagent-dropdown{display:none;position:fixed;min-width:180px;max-width:280px;background:var(--bg-card);border:1px solid var(--border);border-radius:6px;box-shadow:0 4px 16px #0006;z-index:10000;overflow:hidden;padding:4px 0}.subagent-dropdown.open{display:block;animation:dropdownFadeIn .1s ease-out}@keyframes dropdownFadeIn{0%{opacity:0;transform:translate(-50%) translateY(-4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.subagent-dropdown.pinned{border-color:var(--accent)}.subagent-dropdown-header{display:none}.subagent-dropdown-item{display:flex;align-items:center;gap:6px;padding:6px 10px;cursor:pointer;transition:background .1s}@media(hover:hover){.subagent-dropdown-item:hover{background:var(--bg-hover)}.subagent-dropdown-item:hover .subagent-dropdown-name{color:var(--accent-hover)}.subagent-dropdown-item:hover .subagent-dropdown-close{opacity:.6}.subagent-dropdown-close:hover{opacity:1;color:var(--red)}}@media(hover:none){.subagent-dropdown-item:active{background:var(--bg-hover)}.subagent-dropdown-close{opacity:.6}}.subagent-dropdown-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--text-muted)}.subagent-dropdown-status.active{background:var(--green);box-shadow:0 0 4px var(--green)}.subagent-dropdown-status.idle{background:var(--yellow)}.subagent-dropdown-status.completed{background:var(--accent)}.subagent-dropdown-name{flex:1;font-size:.72rem;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.subagent-dropdown-close{font-size:.9rem;color:var(--text-muted);cursor:pointer;padding:0 2px;opacity:0;transition:opacity .1s,color .1s}.task-empty{padding:1rem;text-align:center;color:var(--text-muted);font-size:.8rem}.task-tree{font-size:.75rem}.task-node{border-left:2px solid var(--border);padding-left:.75rem;margin-left:.5rem;margin-bottom:.25rem}.task-node:first-child{border-left:none;margin-left:0;padding-left:0}.task-item{display:flex;align-items:flex-start;gap:.5rem;padding:.4rem .5rem;background:var(--bg-input);border-radius:4px;margin-bottom:.25rem}.task-status-icon{flex-shrink:0;width:14px;height:14px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.6rem}.task-status-icon.running{background:var(--yellow);animation:pulse 1.5s infinite}.task-status-icon.completed{background:var(--green);color:#fff}.task-status-icon.failed{background:var(--red);color:#fff}.task-info{flex:1;min-width:0}.task-description{color:var(--text);word-break:break-word}.task-meta{display:flex;gap:.5rem;font-size:.65rem;color:var(--text-muted);margin-top:.2rem}.task-type{color:var(--accent)}.task-children{margin-top:.25rem}.task-toggle-btn{position:relative}.task-toggle-btn .badge{position:absolute;top:-4px;right:-4px;min-width:14px;height:14px;padding:0 3px;background:var(--yellow);border-radius:7px;font-size:.6rem;font-weight:600;color:#000;display:flex;align-items:center;justify-content:center}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--border-light)}.process-empty{padding:1rem;text-align:center;color:var(--text-muted);font-size:.8rem}.process-item{display:flex;align-items:center;gap:.75rem;padding:.6rem .75rem;background:var(--bg-input);border-radius:4px;margin-bottom:.5rem}.process-item:hover{background:var(--bg-hover)}.process-item-clickable{cursor:pointer;transition:border-color .15s,background .15s;border:1px solid transparent}.process-item-clickable:hover{border-color:var(--accent)}.process-info{flex:1;min-width:0}.process-name{font-size:.8rem;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.process-meta{display:flex;gap:.75rem;font-size:.7rem;color:var(--text-muted);margin-top:.2rem}.process-stat{display:flex;align-items:center;gap:.25rem}.process-stat.memory{color:var(--accent-hover)}.process-stat.cpu{color:var(--green)}.process-stat.children{color:var(--yellow)}.process-actions{display:flex;gap:.25rem}.process-mode{font-size:.6rem;padding:2px 6px;border-radius:3px;background:var(--bg-hover);color:var(--text-muted);text-transform:uppercase}.process-mode.shell{background:#eab30833;color:var(--yellow)}.monitor-status-badge{font-size:.55rem;font-weight:700;padding:2px 6px;border-radius:3px;text-transform:uppercase;letter-spacing:.5px;white-space:nowrap;min-width:52px;text-align:center}.monitor-status-badge.status-idle{background:#eab30833;color:var(--yellow)}.monitor-status-badge.status-working{background:#4ade8033;color:var(--green);animation:pulse-working 2s ease-in-out infinite}.monitor-status-badge.status-stopped{background:#ef444433;color:var(--red, #ef4444)}@keyframes pulse-working{0%,to{opacity:1}50%{opacity:.6}}.monitor-model-badge{font-size:.55rem;padding:1px 4px;border-radius:2px;font-weight:600;text-transform:uppercase}.monitor-model-badge.opus{background:#a855f733;color:#c084fc}.monitor-model-badge.sonnet{background:#3b82f633;color:#60a5fa}.monitor-model-badge.haiku{background:#4ade8033;color:#4ade80}.process-stat.tokens{color:var(--accent-hover)}.process-stat.cost{color:#f59e0b}.process-stat.todo-progress{color:#c084fc}.monitor-panel{position:fixed;bottom:var(--toolbar-height);right:.5rem;width:380px;max-width:calc(100vw - 1rem);max-height:80vh;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.07);border-bottom:none;border-radius:10px 10px 0 0;box-shadow:0 -8px 32px #0006,0 -2px 8px #0003;z-index:100;transform:translateY(100%);transition:transform .2s ease,width .2s ease;display:flex;flex-direction:column}.monitor-panel.open{transform:translateY(0)}.monitor-panel.detached{bottom:auto;right:auto;top:100px;left:calc(50% - 300px);width:600px;height:500px;max-height:none;border-radius:8px;border-bottom:1px solid var(--border);box-shadow:0 8px 32px #00000080,0 0 0 1px #ffffff0d;transform:none;resize:both;overflow:hidden;min-width:350px;min-height:250px}.monitor-panel.detached .monitor-panel-header{cursor:move;background:linear-gradient(180deg,var(--bg-hover) 0%,var(--bg-card) 100%);user-select:none}.monitor-panel.detached .monitor-resize-handle{display:block}.monitor-panel.detached .monitor-section-body{max-height:none}.monitor-panel-header{display:flex;align-items:center;justify-content:space-between;padding:.4rem 1rem;border-bottom:1px solid var(--border);font-size:.85rem;font-weight:500;flex-shrink:0}.monitor-panel-title{font-weight:600;font-size:.8rem;color:var(--text)}.monitor-panel-actions{display:flex;align-items:center;gap:.5rem}.monitor-panel-body{flex:1;overflow-y:auto;padding:0}.monitor-resize-handle{display:none;position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 50%,var(--border-light) 50%);border-radius:0 0 8px}.monitor-resize-handle:before{content:"";position:absolute;bottom:3px;right:3px;width:8px;height:8px;border-right:2px solid var(--text-muted);border-bottom:2px solid var(--text-muted)}.monitor-section{border-bottom:1px solid var(--border)}.monitor-section:last-child{border-bottom:none}.monitor-section-header{display:flex;align-items:center;justify-content:space-between;padding:.5rem 1rem;background:var(--bg-input);font-size:.75rem;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.monitor-section-body{padding:.5rem;max-height:25vh;overflow-y:auto}.monitor-empty{padding:1rem;text-align:center;color:var(--text-muted);font-size:.8rem}.task-stats{font-size:.65rem;color:var(--text-dim);padding:.15rem .4rem;background:var(--bg-card);border-radius:8px}@media(max-width:600px){.header-brand{padding-right:.4rem;margin-right:.3rem}.header-brand .logo{font-size:.75rem}.connection-text{display:none}.toolbar-left .toolbar-group:not(:first-child){display:none}.monitor-panel{width:100%;max-width:100%;border-radius:8px 8px 0 0}}.subagents-panel{position:fixed;bottom:var(--toolbar-height);right:.5rem;width:500px;max-width:calc(100vw - 1rem);max-height:50vh;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.07);border-bottom:none;border-radius:10px 10px 0 0;z-index:91;transform:translateY(calc(100% - 36px));transition:transform .2s ease,width .2s ease;display:flex;flex-direction:column}.subagents-panel.open{transform:translateY(0);max-height:65vh}.subagents-panel.hidden{display:none}.subagents-panel.detached{bottom:auto;right:auto;top:80px;left:calc(50% - 350px);width:700px;height:500px;max-height:none;border-radius:8px;border-bottom:1px solid var(--border);box-shadow:0 8px 32px #00000080,0 0 0 1px #ffffff0d;transform:none;resize:both;overflow:hidden;min-width:400px;min-height:300px}.subagents-panel.detached .subagents-panel-header{cursor:move;background:linear-gradient(180deg,var(--bg-hover) 0%,var(--bg-card) 100%);user-select:none}.subagents-panel.detached .subagents-resize-handle{display:block}.subagents-panel-header{display:flex;align-items:center;justify-content:space-between;padding:.4rem 1rem;border-bottom:1px solid var(--border);flex-shrink:0}.subagents-panel-title{font-weight:600;font-size:.8rem;color:var(--text);display:flex;align-items:center;gap:.5rem}.subagents-panel-actions{display:flex;align-items:center;gap:.5rem}.subagents-panel-body{flex:1;overflow-y:auto;padding:.5rem}.subagents-resize-handle{display:none;position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:se-resize}.subagents-resize-handle:after{content:"";position:absolute;bottom:3px;right:3px;width:8px;height:8px;border-right:2px solid var(--text-muted);border-bottom:2px solid var(--text-muted)}@media(max-width:600px){.subagents-panel{width:100%;max-width:100%;left:0;right:0;border-radius:8px 8px 0 0}}.subagent-container{display:flex;gap:.5rem;height:100%;min-height:280px}.subagent-list{flex:0 0 200px;overflow-y:auto;border-right:1px solid var(--border);padding-right:.5rem}.subagent-detail{flex:1;overflow-y:auto;padding-left:.5rem}.subagent-empty{color:var(--text-dim);font-size:.75rem;text-align:center;padding:1rem}.subagent-badge{background:var(--accent);color:#fff;font-size:.65rem;padding:.1rem .4rem;border-radius:8px;margin-left:.5rem}.subagent-item{padding:.5rem;border-radius:6px;background:var(--bg-input);margin-bottom:.4rem;cursor:pointer;transition:background .15s;content-visibility:auto;contain-intrinsic-size:auto 48px}.subagent-item:hover{background:var(--bg-card)}.subagent-item.selected{background:var(--bg-card);border:1px solid var(--accent)}.subagent-header{display:flex;align-items:center;gap:.4rem;margin-bottom:.3rem}.subagent-icon{font-size:.9rem}.subagent-id{font-family:var(--font-mono);font-size:.75rem;color:#fff}.subagent-status{font-size:.6rem;padding:.1rem .3rem;border-radius:4px;margin-left:auto}.subagent-status.active{background:var(--success);color:#fff}.subagent-status.idle{background:var(--warning);color:#000}.subagent-status.completed{background:var(--text-muted);color:#fff}.subagent-window-btn{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:.1rem .3rem;font-size:.75rem;margin-left:auto}.subagent-window-btn:hover{color:var(--accent)}.subagent-kill-btn{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:.1rem .3rem;font-size:.7rem;opacity:.6;transition:opacity .15s,color .15s}.subagent-kill-btn:hover{color:var(--red);opacity:1}.subagent-meta{display:flex;gap:.5rem;font-size:.65rem;color:var(--text-muted)}.subagent-last-tool{color:var(--accent)}.subagent-detail-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--border)}.subagent-detail-header .subagent-id{font-size:.85rem;font-weight:600}.subagent-transcript-btn{margin-left:auto;font-size:.65rem;padding:.2rem .5rem;background:var(--bg-card);border:1px solid var(--border);border-radius:4px;color:var(--text);cursor:pointer}.subagent-transcript-btn:hover{background:var(--bg-hover)}.subagent-detail-stats{display:flex;gap:1rem;font-size:.7rem;color:var(--text-muted);margin-bottom:.5rem}.subagent-activity-log{font-family:var(--font-mono);font-size:.7rem;max-height:150px;overflow-y:auto}.subagent-activity{display:flex;gap:.4rem;padding:.2rem 0;border-bottom:1px solid var(--border-subtle)}.subagent-activity .time{color:var(--text-muted);flex:0 0 60px}.subagent-activity .icon{flex:0 0 20px}.subagent-activity .name{color:var(--accent);flex:0 0 80px}.subagent-activity .detail{color:var(--text-dim);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.subagent-activity.tool .icon{color:var(--accent)}.subagent-activity.progress .icon{color:var(--warning)}.subagent-activity.message .icon{color:var(--text)}.subagent-model-badge{font-size:.55rem;padding:.1rem .35rem;border-radius:4px;font-weight:600;text-transform:uppercase;letter-spacing:.3px}.subagent-model-badge.haiku{background:#4ade80;color:#052e16}.subagent-model-badge.sonnet{background:#60a5fa;color:#1e3a5f}.subagent-model-badge.opus{background:#c084fc;color:#3b0764}.subagent-activity.progress.hook .icon,.activity-line.hook-line .tool-icon{color:#f59e0b}.subagent-activity.tool-result .icon{color:var(--success)}.subagent-activity.tool-result.error .icon{color:var(--red)}.activity-line.result-line .tool-icon{color:var(--success)}.activity-line.result-line.error .tool-icon{color:var(--red)}.activity-line.result-line .tool-detail{color:var(--text-dim);font-style:italic}.tool-expand-btn{background:transparent;border:1px solid var(--border);border-radius:3px;color:var(--text-muted);cursor:pointer;font-size:.6rem;padding:.1rem .3rem;margin-left:.3rem;transition:all .15s}.tool-expand-btn:hover{background:var(--bg-hover);color:var(--text)}.tool-params-expanded{background:var(--bg-dark);border-left:2px solid var(--accent);margin:.3rem 0 .3rem 2rem;padding:.4rem .6rem;border-radius:0 4px 4px 0;font-size:.65rem;max-height:150px;overflow-y:auto}.tool-params-expanded pre{margin:0;white-space:pre-wrap;word-break:break-all;color:var(--text-dim)}.subagent-window{position:fixed;width:420px;height:350px;min-width:280px;min-height:180px;max-width:90vw;max-height:80vh;background:var(--bg-card);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 32px #0006;z-index:1000;display:flex;flex-direction:column;overflow:hidden;resize:both;contain:layout paint}.subagent-window:after{content:"";position:absolute;bottom:4px;right:4px;width:12px;height:12px;background:linear-gradient(135deg,transparent 50%,var(--border-light) 50%,var(--border-light) 60%,transparent 60%,transparent 70%,var(--border-light) 70%,var(--border-light) 80%,transparent 80%);pointer-events:none;opacity:.6}.subagent-window-header{display:flex;align-items:center;padding:.5rem .75rem;background:var(--bg-input);border-bottom:1px solid var(--border);cursor:move}.subagent-window-title{display:flex;align-items:center;gap:.4rem;flex:1}.subagent-window-title .icon{font-size:1rem}.subagent-window-title .id{font-family:var(--font-mono);font-size:.8rem;color:#fff}.subagent-window-title .status{font-size:.6rem;padding:.1rem .3rem;border-radius:4px}.subagent-window-title .status.active{background:var(--green);color:#fff}.subagent-window-title .status.idle{background:var(--yellow);color:#000}.subagent-window-title .status.completed{background:var(--accent);color:#fff}.subagent-window-actions{display:flex;gap:.3rem}.subagent-window-actions button{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:.2rem .4rem;font-size:.9rem}.subagent-window-actions button:hover{color:var(--text)}.subagent-window-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:.5rem;font-family:var(--font-mono);font-size:.75rem;background:#111;color:#c8c8c8;min-height:0;scroll-behavior:smooth}.subagent-window-body::-webkit-scrollbar{width:6px}.subagent-window-body::-webkit-scrollbar-track{background:transparent}.subagent-window-body::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.subagent-window-body::-webkit-scrollbar-thumb:hover{background:var(--border-light)}.subagent-window-body .activity-line{display:flex;gap:.3rem;padding:.15rem 0;align-items:baseline}.subagent-window-body .activity-line .time{color:#888;flex:0 0 auto;white-space:nowrap}.subagent-window-body .activity-line .tool-icon{flex:0 0 auto;opacity:.9}.subagent-window-body .activity-line .tool-name{color:#b0b0b0;flex:0 0 auto;white-space:nowrap}.subagent-window-body .activity-line .tool-detail{color:#d0d0d0;flex:1;overflow:hidden;text-overflow:ellipsis}.subagent-window-body .message-line{padding:.3rem 0;color:#c8c8c8}.subagent-window-body .progress-line{color:#a0a0a0;font-style:italic}.subagent-window-parent{background:var(--bg-darker);padding:4px 12px;font-size:11px;color:var(--text-muted);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:6px}.subagent-window-parent .parent-label{opacity:.7}.subagent-window-parent .parent-name{color:var(--accent);cursor:pointer;font-weight:500}.subagent-window-parent .parent-name:hover{text-decoration:underline}.subagent-window.spawning{pointer-events:none}.connection-lines-svg{position:fixed;top:0;left:0;width:100vw;height:100vh;height:100dvh;pointer-events:none;z-index:999}.connection-line{stroke:#3b82f6;stroke-width:3;stroke-dasharray:5 3;fill:none;opacity:.9;filter:drop-shadow(0 0 2px rgba(0,0,0,.8)) drop-shadow(0 0 4px rgba(59,130,246,.8)) drop-shadow(0 0 8px rgba(59,130,246,.5));transition:opacity .2s,stroke-width .2s,filter .2s}.connection-line:hover{opacity:1;stroke-width:3.5;filter:drop-shadow(0 0 2px rgba(0,0,0,.9)) drop-shadow(0 0 6px rgba(59,130,246,1)) drop-shadow(0 0 12px rgba(59,130,246,.7))}.connection-line.spawning-line{stroke-dasharray:1000;stroke-dashoffset:1000}.connection-line.wizard-connection{stroke:#60a5fa;stroke-width:3;filter:drop-shadow(0 0 2px rgba(0,0,0,.8)) drop-shadow(0 0 5px #60a5fa) drop-shadow(0 0 10px #60a5fa);stroke-dasharray:8 4;animation:wizard-pulse 1.5s ease-in-out infinite}@keyframes wizard-pulse{0%,to{opacity:.75}50%{opacity:1}}.connection-line.plan-to-subagent-line{stroke:#3b82f6;stroke-width:3;filter:drop-shadow(0 0 2px rgba(0,0,0,.8)) drop-shadow(0 0 4px rgba(59,130,246,.8)) drop-shadow(0 0 8px rgba(59,130,246,.5));stroke-dasharray:5 3;animation:plan-subagent-pulse 1.2s ease-in-out infinite}.connection-line.plan-to-subagent-line:hover{stroke-width:3.5;filter:drop-shadow(0 0 2px rgba(0,0,0,.9)) drop-shadow(0 0 6px rgba(59,130,246,1)) drop-shadow(0 0 12px rgba(59,130,246,.7))}@keyframes plan-subagent-pulse{0%,to{opacity:.8}50%{opacity:1}}.project-insights-panel{position:fixed;right:20px;top:calc(var(--header-height) + 10px);width:450px;height:350px;min-width:300px;min-height:200px;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.07);border-radius:12px;box-shadow:0 16px 64px #0006,0 4px 16px #0003;z-index:1000;display:none;flex-direction:column;overflow:hidden;resize:both}.project-insights-panel.visible{display:flex}.project-insights-header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--bg-input);border-bottom:1px solid var(--border);border-radius:8px 8px 0 0;flex-shrink:0}.project-insights-title{font-size:.85rem;font-weight:600;color:var(--text)}.project-insights-body{flex:1;overflow-y:auto;padding:.5rem}.project-insights-resize-handle{position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:se-resize;opacity:.5}.project-insights-resize-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:8px;height:8px;border-right:2px solid var(--text-muted);border-bottom:2px solid var(--text-muted)}.project-insight-item{display:flex;flex-direction:column;padding:.5rem .6rem;border-radius:4px;background:var(--bg-input);margin-bottom:.4rem}.project-insight-item:last-child{margin-bottom:0}.project-insight-command{display:flex;align-items:center;gap:.4rem;font-family:var(--font-mono);font-size:.8rem;color:var(--text)}.project-insight-command .icon{font-size:1rem}.project-insight-command .cmd{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.project-insight-paths{display:flex;flex-direction:column;gap:.25rem;margin-top:.4rem;padding-left:1.4rem}.project-insight-filepath{cursor:pointer;color:var(--accent);font-family:var(--font-mono);font-size:.75rem;text-decoration:underline;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.project-insight-filepath:hover{color:var(--accent-hover)}.project-insight-timeout{font-size:.7rem;color:var(--text-muted);margin-left:auto}.project-insight-status{font-size:.7rem;padding:.15rem .35rem;border-radius:3px;margin-left:.3rem}.project-insight-status.running{background:var(--success);color:#fff}.project-insight-status.completed{background:var(--text-muted);color:#fff}.file-browser-panel{position:fixed;top:calc(var(--header-height) + 10px);right:20px;width:280px;height:calc(100vh - var(--header-height) - var(--toolbar-height) - 40px);height:calc(100dvh - var(--header-height) - var(--toolbar-height) - 40px);max-height:600px;min-width:200px;min-height:300px;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.07);border-radius:12px;box-shadow:0 8px 32px #0006,0 2px 8px #0003;z-index:100;display:none;flex-direction:column;overflow:hidden;resize:both}.file-browser-panel.visible{display:flex}.file-browser-header{display:flex;align-items:center;justify-content:space-between;padding:.4rem .6rem;background:var(--bg-input);border-bottom:1px solid var(--border);flex-shrink:0;cursor:move;user-select:none}.file-browser-title{font-size:.8rem;font-weight:600;color:var(--text)}.file-browser-actions{display:flex;gap:.25rem}.file-browser-search{padding:.4rem;border-bottom:1px solid var(--border);flex-shrink:0}.file-browser-search input{width:100%;padding:.3rem .5rem;font-size:.75rem;background:var(--bg-dark);border:1px solid var(--border);border-radius:4px;color:var(--text)}.file-browser-search input:focus{outline:none;border-color:var(--accent)}.file-browser-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:.25rem 0}.file-browser-body::-webkit-scrollbar{width:6px}.file-browser-body::-webkit-scrollbar-track{background:transparent}.file-browser-body::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.file-browser-body::-webkit-scrollbar-thumb:hover{background:var(--border-light)}.file-browser-status{padding:.25rem .5rem;font-size:.65rem;color:var(--text-muted);border-top:1px solid var(--border);flex-shrink:0}.file-browser-empty{padding:1rem;text-align:center;color:var(--text-muted);font-size:.75rem}.file-browser-loading{padding:1rem;text-align:center;color:var(--text-dim);font-size:.75rem}.file-tree-item{display:flex;align-items:center;gap:.35rem;padding:.2rem .5rem;cursor:pointer;font-size:.75rem;white-space:nowrap;user-select:none;transition:background .1s}.file-tree-item:hover{background:var(--bg-hover)}.file-tree-item.selected{background:#3b82f626}.file-tree-item.hidden-by-filter{display:none}.file-tree-icon{width:1rem;text-align:center;flex-shrink:0;font-size:.9rem}.file-tree-expand{width:.75rem;color:var(--text-muted);font-size:.6rem;flex-shrink:0;transition:transform .15s}.file-tree-expand.expanded{transform:rotate(90deg)}.file-tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;color:var(--text)}.file-tree-name.directory{color:var(--accent-hover);font-weight:500}.file-tree-size{font-size:.65rem;color:var(--text-muted);margin-left:auto;padding-left:.5rem}.file-tree-download{display:none;margin-left:auto;padding:0 4px;color:#888;text-decoration:none;font-size:12px;flex-shrink:0}.file-tree-item:hover .file-tree-download{display:inline}.file-tree-download:hover{color:#4fc3f7}.file-tree-item[data-depth="0"]{padding-left:.5rem}.file-tree-item[data-depth="1"]{padding-left:1.25rem}.file-tree-item[data-depth="2"]{padding-left:2rem}.file-tree-item[data-depth="3"]{padding-left:2.75rem}.file-tree-item[data-depth="4"]{padding-left:3.5rem}.file-tree-item[data-depth="5"]{padding-left:4.25rem}.file-tree-item[data-depth="6"]{padding-left:5rem}.file-tree-item[data-depth="7"]{padding-left:5.75rem}.file-tree-item[data-depth="8"]{padding-left:6.5rem}.file-tree-item[data-depth="9"]{padding-left:7.25rem}.file-preview-overlay{position:fixed;inset:0;background:#0009;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);z-index:2000;display:none;align-items:center;justify-content:center}.file-preview-overlay.visible{display:flex}.file-preview-window{width:80vw;max-width:900px;height:80vh;max-height:700px;background:#131316f2;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.08);border-radius:12px;box-shadow:0 16px 64px #00000080,0 4px 16px #0000004d;display:flex;flex-direction:column;overflow:hidden}.file-preview-header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--bg-input);border-bottom:1px solid var(--border);flex-shrink:0}.file-preview-title{font-family:var(--font-mono);font-size:.85rem;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-preview-actions{display:flex;gap:.25rem}.file-preview-body{flex:1;overflow:auto;padding:0;background:#111}.file-preview-body pre{margin:0;padding:.75rem;font-family:var(--font-mono);font-size:.8rem;line-height:1.5;color:#d4d4d4;white-space:pre-wrap;word-break:break-all}.file-preview-body pre code{font-family:inherit}.file-preview-body img{max-width:100%;max-height:100%;object-fit:contain}.file-preview-body video{max-width:100%;max-height:100%}.file-preview-body .binary-message{padding:2rem;text-align:center;color:var(--text-muted)}.file-preview-footer{padding:.35rem .75rem;font-size:.7rem;color:var(--text-muted);border-top:1px solid var(--border);flex-shrink:0}.log-viewer-window{position:fixed;width:550px;height:400px;min-width:350px;min-height:200px;background:var(--bg-card);border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow-lg);z-index:2000;display:flex;flex-direction:column;overflow:hidden;resize:both;contain:layout paint}.log-viewer-window-header{display:flex;align-items:center;padding:.5rem .75rem;background:var(--bg-input);border-bottom:1px solid var(--border);cursor:move}.log-viewer-window-title{display:flex;align-items:center;gap:.4rem;flex:1}.log-viewer-window-title .icon{font-size:1rem}.log-viewer-window-title .filename{font-family:var(--font-mono);font-size:.8rem;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.log-viewer-window-title .status{font-size:.6rem;padding:.1rem .3rem;border-radius:4px;margin-left:.5rem}.log-viewer-window-title .status.streaming{background:var(--success);color:#fff;animation:pulse 2s infinite}.log-viewer-window-title .status.disconnected{background:var(--text-muted);color:#fff}.log-viewer-window-title .status.error{background:var(--error);color:#fff}@keyframes pulse{0%,to{opacity:1}50%{opacity:.6}}.log-viewer-window-actions{display:flex;gap:.3rem}.log-viewer-window-actions button{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:.2rem .4rem;font-size:.9rem}.log-viewer-window-actions button:hover{color:var(--text)}.log-viewer-window-body{flex:1;overflow-y:auto;padding:.5rem;font-family:var(--font-mono);font-size:.75rem;background:var(--bg-dark);white-space:pre-wrap;word-break:break-all;color:var(--text);line-height:1.4}.log-viewer-window-body .log-line{padding:.1rem 0;content-visibility:auto;contain-intrinsic-size:auto 20px}.log-viewer-window-body .log-error{color:var(--error)}.log-viewer-window-body .log-info{color:var(--text-muted);font-style:italic}.image-popup-window{position:fixed;width:600px;height:500px;min-width:300px;min-height:250px;max-width:90vw;max-height:90vh;background:var(--bg-card);border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden;resize:both;z-index:3000;contain:layout paint}.image-popup-header{display:flex;align-items:center;padding:.5rem .75rem;background:var(--bg-input);border-bottom:1px solid var(--border);cursor:move}.image-popup-title{display:flex;align-items:center;gap:.4rem;flex:1;min-width:0}.image-popup-title .icon{font-size:1rem;flex-shrink:0}.image-popup-title .filename{font-family:var(--font-mono);font-size:.8rem;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.image-popup-title .session-badge{font-size:.6rem;padding:.1rem .4rem;border-radius:4px;background:var(--accent);color:#fff;flex-shrink:0}.image-popup-title .size-badge{font-size:.6rem;padding:.1rem .3rem;border-radius:4px;background:var(--text-muted);color:#fff;flex-shrink:0}.image-popup-actions{display:flex;gap:.3rem;flex-shrink:0}.image-popup-actions button{background:transparent;border:none;color:var(--text-muted);cursor:pointer;padding:.2rem .4rem;font-size:.9rem}.image-popup-actions button:hover{color:var(--text)}.image-popup-body{flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#1a1a1a;padding:.5rem}.image-popup-body img{max-width:100%;max-height:100%;object-fit:contain;cursor:pointer;transition:transform .1s ease}.image-popup-body img:hover{transform:scale(1.02)}.image-popup-body .image-error{color:var(--error);font-size:.85rem;padding:1rem;text-align:center}.xterm-link-layer .xterm-link{text-decoration:underline;text-decoration-style:dotted;cursor:pointer}.xterm .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-link-decoration{cursor:pointer}.wizard-progress{display:flex;justify-content:center;gap:1.5rem;padding:.5rem .75rem;background:var(--bg-dark);border-bottom:1px solid var(--border)}.wizard-step{display:flex;align-items:center;gap:.5rem;color:var(--text-muted);font-size:.8rem;transition:color .2s}.wizard-step.active{color:var(--accent)}.wizard-step.completed{color:var(--green)}.wizard-step-number{width:20px;height:20px;display:flex;align-items:center;justify-content:center;background:var(--bg-input);border:1px solid var(--border);border-radius:50%;font-size:.7rem;font-weight:600}.wizard-step.active .wizard-step-number{background:var(--accent);border-color:var(--accent);color:#fff}.wizard-step.completed .wizard-step-number{background:var(--green);border-color:var(--green);color:#fff}.wizard-step-label{font-weight:500}.wizard-page{min-height:180px}.wizard-page.hidden{display:none}.wizard-footer{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem;border-top:1px solid var(--border);background:var(--bg-card)}.wizard-footer-right{display:flex;gap:.5rem}.modal-wizard{width:480px;max-width:95vw;max-height:70vh;display:flex;flex-direction:column}.modal-wizard.draggable{position:absolute;transform:none;cursor:default}.modal-wizard .modal-body{overflow-y:auto;flex:1;min-height:0}.modal-wizard .wizard-footer{flex-shrink:0}.wizard-page-compact{min-height:auto;padding:.5rem 0}.wizard-step-intro{text-align:center;margin-bottom:.75rem;color:var(--text-dim);font-size:.9rem}.wizard-step-intro p{margin:0}.wizard-inline-row{display:flex;gap:1rem;margin-top:.75rem}.wizard-inline-field{flex:1}.wizard-inline-field-small{flex:0 0 auto}.wizard-inline-field label{display:block;font-size:.8rem;color:var(--text-dim);margin-bottom:.25rem}.iteration-presets-compact{display:flex;gap:.25rem}.iteration-presets-compact .iteration-preset-btn{padding:.35rem .6rem;font-size:.75rem;min-width:36px}.plan-section{padding:1rem;text-align:center}.plan-actions{display:flex;gap:.5rem;justify-content:center}.existing-plan-badge{font-size:.7rem;background:var(--accent);color:#fff;padding:.1rem .4rem;border-radius:3px;margin-left:.5rem;font-weight:400}.existing-plan-card{background:var(--bg-input);border:1px solid var(--accent);border-radius:6px;padding:1rem;text-align:left}.existing-plan-header{display:flex;align-items:center;gap:.5rem;font-weight:500;margin-bottom:.75rem}.existing-plan-icon{font-size:1.2rem}.existing-plan-stats{display:flex;gap:1rem;margin-bottom:1rem;font-size:.85rem}.existing-plan-stats .stat{display:flex;align-items:center;gap:.25rem}.existing-plan-stats .stat.pending{color:var(--yellow)}.existing-plan-stats .stat.completed{color:var(--green)}.existing-plan-stats .stat.total{color:var(--text-muted)}.existing-plan-actions{display:flex;gap:.5rem}.plan-loading-state{padding:1.5rem 1rem;text-align:center}.plan-loading-content{display:flex;align-items:center;justify-content:center;gap:1rem;margin-bottom:.75rem}.plan-spinner{width:28px;height:28px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite;flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.plan-loading-text{display:flex;flex-direction:column;align-items:flex-start;text-align:left}.plan-loading-title{font-weight:500;color:var(--text)}.plan-loading-time{font-size:.8rem;color:var(--text-muted);font-family:SF Mono,Monaco,monospace}.plan-loading-hint{color:var(--text-dim);font-size:.85rem;margin:0 0 1rem}.plan-error-msg{color:var(--red);margin-bottom:1rem}.plan-option-group{display:flex;align-items:center;gap:.5rem}.plan-option-group label{font-size:.8rem;color:var(--text-dim)}.plan-option-group select{padding:.3rem .5rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.8rem}.plan-detail-btns{display:flex;gap:.25rem}.plan-detail-btn{padding:.3rem .6rem;font-size:.75rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-dim);cursor:pointer;transition:all .15s}.plan-detail-btn:hover{border-color:var(--border-light)}.plan-detail-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}.plan-editor-header{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem;font-weight:500;font-size:.9rem}.plan-stats{font-weight:400;font-size:.8rem;color:var(--text-muted);margin-left:.5rem}.plan-editor-actions{display:flex;gap:.35rem;flex-wrap:wrap;align-items:center}.plan-items-list{display:flex;flex-direction:column;gap:.35rem;max-height:280px;overflow-y:auto;margin-bottom:.5rem}.plan-loading-actions{display:flex;gap:.5rem;justify-content:center}.plan-autostart-toggle{margin-top:1.25rem;padding-top:1rem;border-top:1px solid var(--border)}.plan-autostart-label{display:flex;align-items:center;gap:.5rem;cursor:pointer;justify-content:center}.plan-autostart-label input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent);cursor:pointer}.plan-autostart-text{font-size:.85rem;color:var(--text)}.plan-autostart-label:hover .plan-autostart-text{color:var(--accent)}.existing-wizard-files-section{padding:1rem}.existing-wizard-card{background:var(--bg-dark);border:1px solid var(--accent);border-radius:8px;padding:1rem}.existing-wizard-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.existing-wizard-icon{font-size:1.2rem}.existing-wizard-title{font-weight:600;color:var(--text)}.existing-wizard-desc{font-size:.85rem;color:var(--text-dim);margin:0 0 .75rem}.existing-wizard-agents{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:1rem}.existing-wizard-agent{background:#60a5fa33;color:var(--accent);padding:.2rem .5rem;border-radius:4px;font-size:.75rem;font-weight:500}.existing-wizard-actions{display:flex;gap:.5rem;justify-content:center}.plan-cancel-btn{color:var(--red)}.plan-stopped-indicator{display:flex;align-items:center;justify-content:center;gap:.5rem;margin-bottom:1rem;padding:.75rem;background:var(--surface);border-radius:6px;border:1px solid var(--border)}.plan-stopped-icon{color:var(--red);font-size:1rem}.plan-stopped-text{font-weight:500;color:var(--text)}.plan-skip-hint{font-size:.75rem;color:var(--text-muted);text-align:center;margin-top:.75rem}.plan-skip-hint strong{color:var(--text-dim)}.plan-subagent-window{position:fixed;width:280px;background:var(--bg-card);border:1px solid var(--accent);border-radius:8px;box-shadow:0 4px 20px #0006,0 0 20px #60a5fa33;overflow:hidden;animation:planSubagentSpawn .3s ease-out}@keyframes planSubagentSpawn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}.plan-subagent-header{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;background:linear-gradient(135deg,#60a5fa33,#60a5fa1a);border-bottom:1px solid var(--border);cursor:grab;user-select:none}.plan-subagent-header:active{cursor:grabbing}.plan-subagent-icon{font-size:1rem}.plan-subagent-title{flex:1;font-weight:500;font-size:.8rem;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plan-subagent-model{font-size:.65rem;padding:.15rem .4rem;background:#7c3aed;color:#fff;border-radius:3px;text-transform:uppercase;font-weight:600}.plan-subagent-body{padding:.75rem}.plan-subagent-status{display:flex;align-items:center;gap:.5rem;margin-bottom:.35rem}.plan-subagent-status.running .plan-subagent-spinner{width:14px;height:14px;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}.plan-subagent-status.completed .plan-subagent-status-text{color:var(--green)}.plan-subagent-status.failed .plan-subagent-status-text{color:var(--red)}.plan-subagent-status-text{font-size:.8rem;font-weight:500}.plan-subagent-detail{font-size:.7rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plan-subagent-prompt-link{display:flex;align-items:center;gap:.5rem;cursor:pointer;padding:.15rem .3rem;margin:-.15rem -.3rem;border-radius:4px;transition:background .15s ease}.plan-subagent-prompt-link:hover{background:#ffffff1a}.plan-subagent-status-text.clickable{cursor:pointer;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}.plan-subagent-status-text.clickable:hover{text-decoration-style:solid;color:var(--accent)}.ralph-version-info{display:flex;align-items:center;gap:.35rem;font-size:.7rem;color:var(--text-muted);margin-left:auto}.ralph-version-info .version-badge{background:var(--bg-card);padding:.1rem .25rem;border-radius:2px;font-family:SF Mono,Monaco,monospace}.ralph-version-info .rollback-btn{background:none;border:none;color:var(--accent);cursor:pointer;font-size:.65rem;padding:.1rem .25rem}.ralph-version-info .rollback-btn:hover{text-decoration:underline}.textarea-with-assist{position:relative}.textarea-with-assist textarea{width:100%;padding:.6rem;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:.85rem;font-family:SF Mono,Monaco,Courier New,monospace;resize:vertical;min-height:80px}.textarea-with-assist textarea:focus{outline:none;border-color:var(--accent)}.iteration-presets{display:flex;gap:.35rem;flex-wrap:wrap}.iteration-preset-btn{padding:.5rem 1rem;font-size:.8rem;font-weight:500;background:var(--bg-input);border:1px solid var(--border);border-radius:4px;color:var(--text-dim);cursor:pointer;transition:all .15s;min-width:50px}.iteration-preset-btn:hover{border-color:var(--border-light);color:var(--text)}.iteration-preset-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}.case-select-inline{display:flex;gap:.5rem}.case-select-inline select{flex:1}.ralph-preview-section{margin-bottom:1rem}.ralph-preview-section>label{display:block;font-size:.7rem;color:var(--text-dim);margin-bottom:.35rem;text-transform:uppercase;letter-spacing:.03em}.ralph-prompt-preview{background:var(--bg-dark);border:1px solid var(--border);border-radius:4px;padding:.5rem .75rem;font-family:SF Mono,Monaco,Courier New,monospace;font-size:.75rem;color:var(--text-dim);max-height:120px;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.ralph-prompt-preview .preview-highlight{color:var(--accent);font-weight:500}.ralph-config-summary{background:var(--bg-input);border-radius:4px;padding:.75rem;margin-bottom:1rem}.config-summary-row{display:flex;justify-content:space-between;padding:.35rem 0;font-size:.8rem}.config-summary-row:not(:last-child){border-bottom:1px solid var(--border)}.config-label{color:var(--text-dim)}.config-summary-row code{background:var(--bg-dark);padding:.15rem .4rem;border-radius:3px;font-size:.75rem;color:var(--green)}.advanced-options{margin-top:1rem}.advanced-options summary{cursor:pointer;font-size:.8rem;color:var(--text-dim);padding:.5rem 0;border-top:1px solid var(--border)}.advanced-options summary:hover{color:var(--text)}.advanced-options[open] summary{margin-bottom:.75rem}.advanced-options-content{padding-left:.5rem}.btn-response-viewer-header{display:inline-flex!important}.btn-response-viewer-header.btn-response-viewer-header--hidden{display:none!important}.response-viewer{display:none;position:fixed;bottom:0;left:0;right:0;max-height:88vh;background:#14141f;border-top:1px solid #2a2a3a;border-radius:14px 14px 0 0;box-shadow:0 -8px 32px #00000073;z-index:5000;flex-direction:column;transform:translateY(100%);transition:transform .28s cubic-bezier(.22,1,.36,1)}.response-viewer.visible{display:flex;transform:translateY(0)}.response-viewer-header{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid #2a2a3a;flex-shrink:0;font-size:14px;font-weight:600;color:#e8e8ec;letter-spacing:.2px}.response-viewer-actions{display:flex;align-items:center;gap:8px}.response-viewer-more{background:#2a2a4a;border:1px solid #444;color:#aaa;font-size:12px;padding:3px 10px;border-radius:4px;cursor:pointer}.response-viewer-more:active{background:#3a3a5a}.response-viewer-close{background:none;border:none;color:#888;font-size:22px;cursor:pointer;padding:0 4px;line-height:1}.rv-message{margin:0 0 18px;padding:14px 16px 16px;border-radius:10px;border:1px solid #252538;border-left-width:3px;background:#181826;position:relative}.rv-message:last-child{margin-bottom:6px}.rv-message:has(.rv-role-user),.rv-message.rv-msg-user{border-left-color:#7aa2ff;background:#16182a}.rv-message:has(.rv-role-assistant),.rv-message.rv-msg-assistant{border-left-color:#6ddb7f;background:#161f1a}.rv-role{display:inline-block;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:1px;margin-bottom:10px;padding:2px 8px;border-radius:10px;background:#ffffff0a}.rv-role-user{color:#7aa2ff;background:#7aa2ff1f}.rv-role-assistant{color:#6ddb7f;background:#6ddb7f1f}.rv-text,.response-viewer-body>:not(.rv-message){word-break:normal;overflow-wrap:anywhere;line-height:1.7}.rv-text p,.response-viewer-body>p{margin:0 0 .85em}.rv-text p:last-child,.response-viewer-body>p:last-child{margin-bottom:0}.rv-text h1,.rv-text h2,.rv-text h3,.rv-text h4,.response-viewer-body>h1,.response-viewer-body>h2,.response-viewer-body>h3,.response-viewer-body>h4{color:#f2f2f6;margin:1.4em 0 .5em;line-height:1.3;font-weight:700;letter-spacing:-.01em}.rv-text h1:first-child,.rv-text h2:first-child,.response-viewer-body>h1:first-child,.response-viewer-body>h2:first-child{margin-top:0}.rv-text h1,.response-viewer-body>h1{font-size:1.55em;padding-bottom:.3em;border-bottom:1px solid #2d2d40}.rv-text h2,.response-viewer-body>h2{font-size:1.3em;color:#ffd27a}.rv-text h3,.response-viewer-body>h3{font-size:1.13em;color:#bfc8ff}.rv-text h4,.response-viewer-body>h4{font-size:1em;color:#c9c9d5;text-transform:uppercase;letter-spacing:.05em}.rv-text code,.response-viewer-body>:not(pre) code{background:#262638;color:#ffb4a2;padding:1px 6px;border-radius:4px;font-family:Fira Code,JetBrains Mono,SF Mono,Menlo,Monaco,monospace;font-size:.9em}.rv-text pre,.response-viewer-body pre{background:#0f0f1a;border:1px solid #2a2a3d;border-radius:8px;padding:14px 16px;overflow-x:auto;margin:1em 0;-webkit-overflow-scrolling:touch;box-shadow:inset 0 0 0 1px #ffffff05;position:relative}.rv-text pre code,.response-viewer-body pre code{background:none;color:#e6e6f0;padding:0;font-family:Fira Code,JetBrains Mono,SF Mono,Menlo,Monaco,monospace;font-size:12.5px;line-height:1.55;white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;tab-size:4}.rv-text .rv-diagram-wrap,.response-viewer-body .rv-diagram-wrap{position:relative;max-width:var(--rv-content-max, 720px);margin:1em auto}.rv-text .rv-diagram-wrap>pre.rv-diagram,.response-viewer-body .rv-diagram-wrap>pre.rv-diagram{margin:0;padding-right:44px}.rv-text pre.rv-diagram code,.response-viewer-body pre.rv-diagram code{white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}.rv-text pre.rv-diagram.rv-nowrap code,.response-viewer-body pre.rv-diagram.rv-nowrap code{white-space:pre;overflow-wrap:normal;word-break:normal}.rv-text pre.rv-diagram.rv-nowrap,.response-viewer-body pre.rv-diagram.rv-nowrap{background:linear-gradient(to left,#0f0f1a 0,#0f0f1a00 28px) right / 28px 100% no-repeat,linear-gradient(to left,#7aa2ff2e 0,#0f0f1a00 28px) right / 28px 100% no-repeat,#0f0f1a}.rv-wrap-toggle{position:absolute;top:6px;right:6px;width:28px;height:24px;padding:0;border:1px solid #2f2f45;border-radius:5px;background:#141420eb;color:#8b8b97;font-size:11px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:color .15s,border-color .15s;z-index:2}.rv-wrap-toggle:hover,.rv-wrap-toggle:active{color:#e0e0ec;border-color:#4a4a65}.rv-wrap-toggle:before{content:"\21b5";font-size:13px}.rv-diagram-wrap:has(>pre.rv-nowrap) .rv-wrap-toggle:before,.rv-diagram-wrap.rv-wrap-nowrap .rv-wrap-toggle:before{content:"\2922"}.rv-text .rv-code-wrap:not(.rv-diagram-wrap),.response-viewer-body .rv-code-wrap:not(.rv-diagram-wrap){position:relative;margin:1em 0}.rv-text .rv-code-wrap:not(.rv-diagram-wrap)>pre,.response-viewer-body .rv-code-wrap:not(.rv-diagram-wrap)>pre{margin:0;padding-right:44px}.rv-text .rv-code-wrap.rv-diagram-wrap>pre.rv-diagram,.response-viewer-body .rv-code-wrap.rv-diagram-wrap>pre.rv-diagram{padding-right:76px}.rv-code-actions{position:absolute;top:6px;right:6px;display:inline-flex;gap:4px;z-index:2}.rv-code-actions .rv-wrap-toggle{position:static;top:auto;right:auto}.rv-copy-btn{width:28px;height:24px;padding:0;border:1px solid #2f2f45;border-radius:5px;background:#141420eb;color:#8b8b97;font-size:13px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:color .15s,border-color .15s}.rv-copy-btn:hover,.rv-copy-btn:active{color:#e0e0ec;border-color:#4a4a65}.rv-copy-btn:before{content:"\2398"}.rv-copy-btn.rv-copied{color:#9ece6a;border-color:#3a5a3a}.rv-copy-btn.rv-copied:before{content:"\2713"}.rv-copy-btn.rv-copy-failed{color:#f7768e;border-color:#5a3a3a}.rv-copy-btn.rv-copy-failed:before{content:"\2715"}.rv-text ul,.rv-text ol,.response-viewer-body>ul,.response-viewer-body>ol{margin:.6em 0;padding-left:1.5em}.rv-text li,.response-viewer-body>ul>li,.response-viewer-body>ol>li{margin-bottom:.3em}.rv-text li>p{margin:.2em 0}.rv-text blockquote,.response-viewer-body>blockquote{border-left:3px solid #5c7cfa;background:#5c7cfa0f;margin:.8em 0;padding:.5em 14px;color:#b8b8c8;border-radius:0 6px 6px 0}.rv-text strong,.response-viewer-body>p strong,.response-viewer-body>li strong{color:#fff;font-weight:700}.rv-text em,.response-viewer-body em{color:#e0e0ec}.rv-text a,.response-viewer-body a{color:#7aa2ff;text-decoration:none;border-bottom:1px solid rgba(122,162,255,.35)}.rv-text a:hover,.response-viewer-body a:hover{border-bottom-color:#7aa2ff}.rv-table-wrap{margin:1em 0;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid #2a2a3d;border-radius:8px;background:#12121d}.rv-text table,.response-viewer-body>table,.rv-table-wrap>table{border-collapse:collapse;margin:0;width:100%;font-size:.92em;line-height:1.55}.rv-text th,.rv-text td,.response-viewer-body>table th,.response-viewer-body>table td,.rv-table-wrap th,.rv-table-wrap td{border-bottom:1px solid #252538;border-right:1px solid #252538;padding:8px 12px;text-align:left;vertical-align:top;white-space:normal}.rv-text th:last-child,.rv-text td:last-child,.response-viewer-body>table th:last-child,.response-viewer-body>table td:last-child,.rv-table-wrap th:last-child,.rv-table-wrap td:last-child{border-right:none}.rv-text tr:last-child td,.response-viewer-body>table tr:last-child td,.rv-table-wrap tr:last-child td{border-bottom:none}.rv-text th,.response-viewer-body>table th,.rv-table-wrap th{background:#20202e;color:#f0f0f5;font-weight:600;border-bottom:2px solid #2f2f45;white-space:nowrap}.rv-text tbody tr:nth-child(2n) td,.response-viewer-body>table tbody tr:nth-child(2n) td,.rv-table-wrap tbody tr:nth-child(2n) td{background:#ffffff06}.rv-text tbody tr:hover td,.response-viewer-body>table tbody tr:hover td,.rv-table-wrap tbody tr:hover td{background:#7aa2ff0f}.rv-text hr,.response-viewer-body>hr{border:none;border-top:1px solid #2d2d40;margin:1.5em 0}.response-viewer-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:20px 22px 28px;font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,PingFang SC,Hiragino Sans GB,Segoe UI,Helvetica Neue,Helvetica,Arial,Noto Sans CJK SC,sans-serif;font-size:15px;line-height:1.7;color:#d8d8e0;--rv-content-max: 720px}.response-viewer-body>*{max-width:var(--rv-content-max);margin-left:auto;margin-right:auto}.response-viewer-body>pre,.response-viewer-body>table,.response-viewer-body>.rv-message{max-width:var(--rv-content-max)}.response-viewer-body:empty:after{content:"No response yet";color:#555;font-style:italic}.response-viewer-backdrop{display:none;position:fixed;inset:0;background:#00000080;z-index:4999}.response-viewer-backdrop.visible{display:block}#cjkInput{display:none;flex-shrink:0;width:100%;font-family:Fira Code,Cascadia Code,JetBrains Mono,SF Mono,Monaco,monospace;font-size:14px;background:#1a1a2e;color:#e0e0e0;border:1px solid #333;border-top:none;padding:6px 10px;outline:none;resize:none;line-height:1.4;box-sizing:border-box}#cjkInput:focus{border-color:#339af0;background:#111}#cjkInput::placeholder{color:#495057;font-size:12px}.touch-device #cjkInput.cjk-input-visible{position:fixed;left:var(--safe-area-left);right:var(--safe-area-right);bottom:calc(var(--safe-area-bottom) + 40px);z-index:52;display:block;min-height:44px;max-height:96px;border:1px solid rgba(80,120,190,.55);border-left:none;border-right:none;background:#101827;color:#f3f4f6;box-shadow:0 -8px 20px #00000059;transition:transform .15s ease-out;will-change:transform}.touch-device.keyboard-visible #cjkInput.cjk-input-visible{bottom:calc(var(--safe-area-bottom) + 84px)}body.touch-device.cjk-input-visible .main{padding-bottom:calc(84px + var(--safe-area-bottom))}.orchestrator-panel{background:var(--glass-bg);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--glass-border);font-size:.75rem;flex-shrink:0;overflow:hidden;position:relative;contain:layout style paint}.orchestrator-header{display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid var(--border);background:var(--bg-secondary)}.orchestrator-title{font-weight:600;color:var(--text-primary);font-size:.8rem}.orchestrator-state-badge{display:inline-block;padding:1px 8px;border-radius:10px;color:#fff;font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em}.orchestrator-actions{display:flex;gap:4px;margin-left:auto}.orchestrator-close-btn{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:1rem;padding:0 4px;line-height:1}.orchestrator-close-btn:hover{color:var(--text-primary)}.orch-btn{padding:2px 8px;border:1px solid var(--border);border-radius:4px;background:var(--bg-input);color:var(--text-primary);cursor:pointer;font-size:.7rem}.orch-btn:hover{background:var(--bg-hover)}.orch-btn-primary{background:#3b82f6;color:#fff;border-color:#3b82f6}.orch-btn-primary:hover{background:#2563eb}.orch-btn-warn{background:#f59e0b;color:#000;border-color:#f59e0b}.orch-btn-warn:hover{background:#d97706}.orch-btn-danger{background:#ef4444;color:#fff;border-color:#ef4444}.orch-btn-danger:hover{background:#dc2626}.orchestrator-body{max-height:300px;overflow-y:auto;padding:8px 10px}.orch-empty{color:var(--text-secondary);text-align:center;padding:12px}.orch-planning{display:flex;flex-direction:column;gap:8px;color:#f59e0b;padding:12px}.orch-planning>.orch-spinner{display:inline-block}.orch-progress-log{display:flex;flex-direction:column;gap:3px;font-size:.8em;color:var(--text-secondary);max-height:200px;overflow-y:auto}.orch-progress-item{padding:2px 0;line-height:1.3}.orch-progress-phase{color:#f59e0b;font-weight:600;margin-right:4px}.orch-spinner{width:14px;height:14px;border:2px solid #f59e0b33;border-top-color:#f59e0b;border-radius:50%;animation:orch-spin .8s linear infinite}@keyframes orch-spin{to{transform:rotate(360deg)}}.orch-goal{margin-bottom:6px;color:var(--text-secondary);line-height:1.3}.orch-progress-bar{position:relative;height:18px;background:var(--bg-input);border-radius:4px;overflow:hidden;margin-bottom:8px}.orch-progress-fill{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg,#3b82f6,#22c55e);transition:width .3s ease;border-radius:4px}.orch-progress-bar span{position:relative;display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-primary);font-size:.65rem;font-weight:600;z-index:1}.orch-phases{display:flex;flex-direction:column;gap:2px}.orch-phase{border:1px solid var(--border);border-radius:4px;overflow:hidden}.orch-phase-active{border-color:#3b82f6}.orch-phase-passed{opacity:.7}.orch-phase-skipped{opacity:.5}.orch-phase-failed{border-color:#ef4444}.orch-phase-header{display:flex;align-items:center;gap:6px;padding:4px 8px;background:var(--bg-secondary)}.orch-phase-icon{width:14px;text-align:center}.orch-phase-name{flex:1;color:var(--text-primary);font-weight:500}.orch-phase-tasks,.orch-phase-duration{color:var(--text-secondary);font-size:.65rem}.orch-phase-actions{display:flex;gap:2px}.orch-phase-btn{padding:1px 6px;border:1px solid var(--border);border-radius:3px;background:var(--bg-input);color:var(--text-secondary);cursor:pointer;font-size:.6rem}.orch-phase-btn:hover{background:var(--bg-hover);color:var(--text-primary)}.orch-phase-tasks-list{padding:4px 8px 4px 26px;border-top:1px solid var(--border)}.orch-task{display:flex;align-items:flex-start;gap:4px;padding:2px 0;line-height:1.3}.orch-task-icon{width:12px;text-align:center;flex-shrink:0;margin-top:1px}.orch-task-prompt{color:var(--text-primary);word-break:break-word}.orch-task-error{color:#ef4444;font-size:.6rem;margin-left:auto}.orch-task-completed .orch-task-prompt{color:var(--text-secondary)}.orch-task-failed .orch-task-icon{color:#ef4444}.orch-verify-pass{color:#22c55e;padding:2px 8px;font-size:.65rem}.orch-verify-fail{color:#ef4444;padding:2px 8px;font-size:.65rem}.orch-stats{display:flex;flex-wrap:wrap;gap:12px;padding:6px 0;margin-top:6px;border-top:1px solid var(--border);color:var(--text-secondary);font-size:.65rem}.orch-error{color:#ef4444;padding:4px 0;margin-top:4px;font-size:.7rem}#terminalContainer.drag-active{outline:2px dashed #4a9eff;outline-offset:-2px;position:relative}#terminalContainer.drag-active:after{content:"Drop image here";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#4a9eff14;color:#4a9eff;font-size:1.2rem;pointer-events:none;z-index:100}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/web/public/sw.js.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";(function(e){const s=/^\x1b\[[\?>=]?[\d;]*[cnR]$/,i=/^\x1b\][\d;]*[^\x07\x1b]*(?:\x07|\x1b\\)$/;function l(o){return s.test(o)||i.test(o)}function r(o){return l(o)}e.CodemanTerminalInput={isTerminalQueryResponse:l,shouldSuppressTerminalQueryResponse:r,USER_SCROLL_STICKY_SUPPRESS_MS:1500}})(window),Object.assign(CodemanApp.prototype,{initTerminal(){const e=parseInt(localStorage.getItem("codeman-scrollback")),s=Number.isFinite(e)&&e>0?Math.max(e,DEFAULT_SCROLLBACK):DEFAULT_SCROLLBACK;if(this.terminal=new Terminal({theme:{background:"#0d0d0d",foreground:"#e0e0e0",cursor:"#e0e0e0",cursorAccent:"#0d0d0d",selection:"rgba(255, 255, 255, 0.3)",black:"#0d0d0d",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd43b",blue:"#339af0",magenta:"#cc5de8",cyan:"#22b8cf",white:"#e0e0e0",brightBlack:"#495057",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#5c7cfa",brightMagenta:"#da77f2",brightCyan:"#66d9e8",brightWhite:"#ffffff"},fontFamily:'"Fira Code", "Cascadia Code", "JetBrains Mono", "SF Mono", Monaco, monospace',fontSize:MobileDetection.getDeviceType()==="mobile"?10:14,lineHeight:1.2,cursorBlink:!1,cursorStyle:"block",scrollback:s,allowTransparency:!0,allowProposedApi:!0}),this.fitAddon=new FitAddon.FitAddon,this.terminal.loadAddon(this.fitAddon),typeof Unicode11Addon<"u")try{const t=new Unicode11Addon.Unicode11Addon;this.terminal.loadAddon(t),this.terminal.unicode.activeVersion="11"}catch{}const i=document.getElementById("terminalContainer");this.terminal.open(i),this.terminal.attachCustomKeyEventHandler(t=>{if(t.isComposing||t.keyCode===229||t.altKey&&t.key>="0"&&t.key<="9")return!1;if((t.ctrlKey||t.metaKey)&&t.key==="v"&&t.type==="keydown")return this.activeSessionId&&this._handleImagePaste&&this._handleImagePaste(),!1;if(t.key==="Enter"&&(t.shiftKey||t.ctrlKey)&&t.type==="keydown"){if(this.activeSessionId)if(this._localEchoEnabled){const c=this._localEchoOverlay?.pendingText||"";this._localEchoOverlay?.clear(),this._localEchoOverlay?.suppressBufferDetection(),this._flushedOffsets?.delete(this.activeSessionId),this._flushedTexts?.delete(this.activeSessionId),c&&(this._pendingInput+=c,a()),setTimeout(()=>{fetch(`/api/sessions/${this.activeSessionId}/send-key`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t.ctrlKey?"C-Enter":"S-Enter"})})},c?80:0)}else fetch(`/api/sessions/${this.activeSessionId}/send-key`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t.ctrlKey?"C-Enter":"S-Enter"})});return!1}return!0});{const t=i.querySelector(".xterm-helper-textarea");if(t&&MobileDetection.isTouchDevice()){let c=!1,u=0;t.addEventListener("compositionstart",()=>{c=!0}),t.addEventListener("compositionend",()=>{c=!1}),t.addEventListener("keydown",h=>{!h.isComposing&&h.keyCode!==229&&(u=Date.now())}),t.addEventListener("input",h=>{if(c||h.isComposing||h.inputType!=="insertText"||!h.data||Date.now()-u<50)return;const d=h.data,p=this._localEchoOverlay?.pendingText||"";Promise.resolve().then(()=>{if(this._lastTerminalData?.data===d&&performance.now()-this._lastTerminalData.time<100){t.value="";return}const _=this._localEchoOverlay?.pendingText||"";if(this._localEchoEnabled&&_.length>p.length&&_.endsWith(d)){t.value="";return}const g=t.value;!g||g.trim()===""&&d!==" "||(this.terminal._core.coreService.triggerDataEvent(d,!0),t.value="")})})}}this._webglAddon=null;const n=new URLSearchParams(location.search);if(n.get("webgl")==="force")try{localStorage.removeItem("codeman-webgl-disabled")}catch{}const l=(()=>{try{const t=localStorage.getItem("codeman-webgl-disabled");if(!t)return!1;const{at:c}=JSON.parse(t);return Date.now()-c>WEBGL_FALLBACK.STICKY_EXPIRY_MS?(localStorage.removeItem("codeman-webgl-disabled"),!1):!0}catch{return!1}})(),r=MobileDetection.getDeviceType()!=="desktop"||n.has("nowebgl")||l;if(l&&console.log("[CRASH-DIAG] WebGL sticky-disabled from prior stalls \u2014 DOM renderer in use. Re-enable: ?webgl=force"),!r)if(typeof WebglAddon<"u")this._initWebGL();else{const t=document.createElement("script");t.src="vendor/xterm-addon-webgl.min.js",t.onload=()=>this._initWebGL(),t.onerror=()=>console.warn("[CRASH-DIAG] Failed to load WebGL addon \u2014 using canvas renderer"),document.head.appendChild(t)}this._localEchoOverlay=new LocalEchoOverlay(this.terminal),MobileDetection.isTouchDevice()&&(this.terminal.onCursorMove(()=>this._syncMobileHelperTextareaToCursor()),this.terminal.onRender(()=>this._syncMobileHelperTextareaToCursor())),this._cjkInput=null,typeof CjkInput<"u"&&(this._cjkInput=CjkInput.init({send:t=>{this._handleCjkInput(t)}})),MobileDetection.getDeviceType()==="mobile"&&document.body.classList.contains("safari-browser")?requestAnimationFrame(()=>{this.fitAddon.fit(),requestAnimationFrame(()=>this.fitAddon.fit())}):this.fitAddon.fit(),this.registerFilePathLinkProvider(),i.addEventListener("wheel",t=>{t.preventDefault();const c=Math.round(t.deltaY/25)||(t.deltaY>0?1:-1);this._noteTerminalUserScroll(c),this.terminal.scrollLines(c)},{passive:!1});{const t=()=>this.terminal._core?._renderService?.dimensions?.css?.cell?.height||13;let c=0,u=0,h=0,d=null,p=!1;const _=b=>{const E=h?(b-h)/16.67:1;if(h=b,!p&&Math.abs(u)>.3){const T=Math.round(u/t());T!==0&&this.terminal.scrollLines(T),u*=.92,d=requestAnimationFrame(_)}else p?d=requestAnimationFrame(_):(d=null,u=0)};let g=0,v=!1;i.addEventListener("touchstart",b=>{b.touches.length===1&&(c=b.touches[0].clientY,u=0,g=0,p=!0,v=!1,h=0,d&&(cancelAnimationFrame(d),d=null))},{passive:!0}),i.addEventListener("touchmove",b=>{if(b.touches.length===1&&p){b.preventDefault(),v=!0;const E=b.touches[0].clientY,T=c-E;g+=T,u=T*1.2,c=E;const I=t(),S=Math.trunc(g/I);S!==0&&(this._noteTerminalUserScroll(S),this.terminal.scrollLines(S),g-=S*I)}},{passive:!1}),i.addEventListener("touchend",()=>{if(p=!1,!d&&Math.abs(u)>.3&&(d=requestAnimationFrame(_)),!v&&this.terminal){const b=document.getElementById("cjkInput");b?.classList.contains("cjk-input-visible")?b.focus():(this._syncMobileHelperTextareaToCursor(),this.terminal.focus())}},{passive:!0}),i.addEventListener("touchcancel",()=>{p=!1,u=0,g=0},{passive:!0})}this.showWelcome(),this.initImageInput(),this._chunkedWriteGen=0,this._bufferLoadSeq=0,this._bufferLoadOwner=null,this._lastUserScrollUpAt=null,this._resizeTimeout=null,this._lastResizeDims=null;const f=40,y=10,m=()=>{this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,this.fitAddon&&this.fitAddon.fit(),this.flickerFilterBuffer&&(this.flickerFilterTimeout&&(clearTimeout(this.flickerFilterTimeout),this.flickerFilterTimeout=null),this.flushFlickerBuffer());const t=typeof KeyboardHandler<"u"&&KeyboardHandler.keyboardVisible;if(this.activeSessionId&&!t){const c=this.fitAddon.proposeDimensions(),u=c?Math.max(c.cols,f):f,h=c?Math.max(c.rows,y):y;if(!this._lastResizeDims||u!==this._lastResizeDims.cols||h!==this._lastResizeDims.rows){const d=this.activeSessionId?this.sessions.get(this.activeSessionId):null;d&&d.mode!=="shell"&&this.terminal&&this.isTerminalAtBottom()&&this.terminal.write("\x1B[3J\x1B[H\x1B[2J"),this._lastResizeDims={cols:u,rows:h};const p=typeof MobileDetection<"u"&&MobileDetection.getDeviceType?MobileDetection.getDeviceType():"desktop";let _=!1;if(this._wsReady&&this._wsSessionId===this.activeSessionId)try{this._ws.send(JSON.stringify({t:"z",c:u,r:h,v:p})),_=!0}catch{}_||fetch(`/api/sessions/${this.activeSessionId}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cols:u,rows:h,viewportType:p})}).catch(()=>{})}}this.updateConnectionLines(),this._localEchoOverlay?.hasPending&&this._localEchoOverlay.rerender()},300)};window.addEventListener("resize",m),this.terminalResizeObserver&&this.terminalResizeObserver.disconnect(),this.terminalResizeObserver=new ResizeObserver(m),this.terminalResizeObserver.observe(i),this._pendingInput="",this._inputFlushTimeout=null,this._lastKeystrokeTime=0;const a=()=>{if(this._inputFlushTimeout=null,this._pendingInput&&this.activeSessionId){const t=this._pendingInput,c=this.activeSessionId;this._pendingInput="",this._sendInputAsync(c,t)}};this.terminal.onData(t=>{if(!(window.cjkActive||document.activeElement?.id==="cjkInput")&&this.activeSessionId){if(window.CodemanTerminalInput?.shouldSuppressTerminalQueryResponse(t))return;if(this._lastTerminalData={data:t,time:performance.now()},this._localEchoEnabled){if(t==="\x7F"){if(this._localEchoOverlay?.removeChar()==="flushed"){const{count:h,text:d}=this._localEchoOverlay.getFlushed();this._flushedOffsets?.has(this.activeSessionId)&&(h===0?(this._flushedOffsets.delete(this.activeSessionId),this._flushedTexts?.delete(this.activeSessionId)):(this._flushedOffsets.set(this.activeSessionId,h),this._flushedTexts?.set(this.activeSessionId,d))),this._pendingInput+=t,a()}return}if(/^[\r\n]+$/.test(t)){const u=this._localEchoOverlay?.pendingText||"";this._localEchoOverlay?.clear(),this._localEchoOverlay?.suppressBufferDetection(),this._flushedOffsets?.delete(this.activeSessionId),this._flushedTexts?.delete(this.activeSessionId),this._inputFlushTimeout&&(clearTimeout(this._inputFlushTimeout),this._inputFlushTimeout=null),u&&(this._pendingInput+=u,a()),setTimeout(()=>{this._pendingInput+="\r",a()},80);return}if(t.length>1&&t.charCodeAt(0)>=32){this._localEchoOverlay?.appendText(t);return}if(t.charCodeAt(0)<32){if(t.length>1&&t.charCodeAt(0)===27){this._pendingInput+=t,a();return}if(this._restoringFlushedState){this._pendingInput+=t,a();return}if(t===" "){const h=this._localEchoOverlay?.pendingText||"";this._localEchoOverlay?.clear(),this._flushedOffsets?.delete(this.activeSessionId),this._flushedTexts?.delete(this.activeSessionId),h&&(this._pendingInput+=h),this._pendingInput+=t,this._inputFlushTimeout&&(clearTimeout(this._inputFlushTimeout),this._inputFlushTimeout=null);let d="";try{const _=this._localEchoOverlay?.findPrompt?.();if(_){const g=this.terminal.buffer.active,v=g.getLine(g.viewportY+_.row);v&&(d=v.translateToString(!0).slice(_.col+2).trimEnd())}}catch{}this._tabCompletionBaseText=d,a(),this._tabCompletionSessionId=this.activeSessionId,this._tabCompletionRetries=0,this._tabCompletionFallback&&clearTimeout(this._tabCompletionFallback);const p=this;this._tabCompletionFallback=setTimeout(()=>{if(p._tabCompletionFallback=null,!p._tabCompletionSessionId||p._tabCompletionSessionId!==p.activeSessionId)return;const _=p._localEchoOverlay;!_||_.pendingText||p.terminal.write("",()=>{if(!p._tabCompletionSessionId)return;_.resetBufferDetection();const g=_.detectBufferText();g&&g!==p._tabCompletionBaseText&&(p._tabCompletionSessionId=null,p._tabCompletionRetries=0,p._tabCompletionBaseText=null,_.rerender())})},300);return}const u=this._localEchoOverlay?.pendingText||"";this._localEchoOverlay?.clear(),this._localEchoOverlay?.suppressBufferDetection(),this._flushedOffsets?.delete(this.activeSessionId),this._flushedTexts?.delete(this.activeSessionId),u&&(this._pendingInput+=u),this._pendingInput+=t,this._inputFlushTimeout&&(clearTimeout(this._inputFlushTimeout),this._inputFlushTimeout=null),a();return}if(t.length===1&&t.charCodeAt(0)>=32){this._localEchoOverlay?.addChar(t);return}}if(this._pendingInput+=t,t.charCodeAt(0)<32||t.length>1){this._inputFlushTimeout&&(clearTimeout(this._inputFlushTimeout),this._inputFlushTimeout=null),a();return}const c=performance.now();c-this._lastKeystrokeTime>50?(this._inputFlushTimeout&&(clearTimeout(this._inputFlushTimeout),this._inputFlushTimeout=null),this._lastKeystrokeTime=c,a()):(this._lastKeystrokeTime=c,this._inputFlushTimeout||(this._inputFlushTimeout=setTimeout(a,0)))}})},registerFilePathLinkProvider(){const e=this;let s=-1;this.terminal.registerLinkProvider({provideLinks(i,n){i!==s&&(s=i,console.debug("[LinkProvider] Checking line:",i));const r=e.terminal.buffer.active.getLine(i-1);if(!r){n(void 0);return}const o=r.translateToString(!0);if(!o||!o.includes("/")){n(void 0);return}const f=[],y=/https?:\/\/[^\s"'<>|;&)\]\x00-\x1f]+/g,m=(d,p)=>{const _=d.replace(/[.,;:!?)]+$/,""),g=o.indexOf(_,p);g!==-1&&(f.some(v=>v.range.start.x===g+1)||f.push({text:_,range:{start:{x:g+1,y:i},end:{x:g+_.length+1,y:i}},decorations:{pointerCursor:!0,underline:!0},activate(v,b){window.open(b,"_blank","noopener,noreferrer")}}))},a=/\b(tail|cat|head|less|grep|watch|vim|nano)\s+(?:[^\s\/]+\s+){0,4}(\/[^\s"'<>|;&\n\x00-\x1f]+)/g,t=/(\/(?:home|tmp|var|etc|opt)[^\s"'<>|;&\n\x00-\x1f]*\.(?:log|txt|json|md|yaml|yml|csv|xml|sh|py|ts|js))\b/g,c=/Bash\([^)]*?(\/(?:home|tmp|var|etc|opt)[^\s"'<>|;&\)\n\x00-\x1f]+)/g,u=(d,p)=>{const _=o.indexOf(d,p);_!==-1&&(f.some(g=>g.range.start.x===_+1)||f.push({text:d,range:{start:{x:_+1,y:i},end:{x:_+d.length+1,y:i}},decorations:{pointerCursor:!0,underline:!0},activate(g,v){e.openLogViewerWindow(v,e.activeSessionId)}}))};let h;for(y.lastIndex=0;(h=y.exec(o))!==null;)m(h[0],h.index);for(a.lastIndex=0;(h=a.exec(o))!==null;)u(h[2],h.index);for(t.lastIndex=0;(h=t.exec(o))!==null;)u(h[1],h.index);for(c.lastIndex=0;(h=c.exec(o))!==null;)u(h[1],h.index);f.length>0&&console.debug("[LinkProvider] Found links:",f.map(d=>d.text)),n(f.length>0?f:void 0)}}),console.log("[LinkProvider] File path link provider registered")},showWelcome(){const e=document.getElementById("welcomeOverlay");e&&(e.classList.add("visible"),this.loadTunnelStatus(),this.loadHistorySessions())},hideWelcome(){const e=document.getElementById("welcomeOverlay");e&&e.classList.remove("visible");const s=document.getElementById("welcomeQr");s&&(clearTimeout(this._welcomeQrShrinkTimer),s.classList.remove("expanded"))},async _fetchHistorySessions(){const i=(await(await fetch("/api/history/sessions")).json()).data?.sessions||[];if(i.length===0)return[];const n=new Map;for(const r of i){const o=r.projectKey||r.workingDir;n.has(o)||n.set(o,[]),n.get(o).push(r)}const l=[];for(const[,r]of n)l.push(...r.slice(0,3));return l.sort((r,o)=>new Date(o.lastModified)-new Date(r.lastModified)),l},_resolveCaseLabel(e,s){if(!e)return"";let i=null;for(const n of s||[])if(!(!n||!n.path)){if(e===n.path)return`#${n.name}`;if(e.startsWith(n.path+"/")){const l=n.path.length;(!i||l>i.len)&&(i={name:n.name,suffix:e.slice(l),len:l})}}return i?`#${i.name}${i.suffix}`:e.split("/").pop()||e},_shortenHomePath(e){return(e||"").replace(/^\/home\/[^/]+\//,"~/").replace(/^\/Users\/[^/]+\//,"~/")},_buildHistoryItem(e,s,i){const n=i?.showViewAll!==!1,l=e.sizeBytes<1024?`${e.sizeBytes}B`:e.sizeBytes<1048576?`${(e.sizeBytes/1024).toFixed(0)}K`:`${(e.sizeBytes/1048576).toFixed(1)}M`,r=new Date(e.lastModified),o=r.toLocaleDateString("en",{month:"short",day:"numeric"})+" "+r.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",hour12:!1}),f=this._shortenHomePath(e.workingDir),y=this._resolveCaseLabel(e.workingDir,s),m=document.createElement("div");m.className="history-item",m.title=e.workingDir;const a=document.createElement("div");a.className="history-item-main",a.addEventListener("click",()=>this.resumeHistorySession(e.sessionId,e.workingDir));const t=document.createElement("div");t.className="history-item-text";const c=document.createElement("span");c.className="history-item-title",c.textContent=e.firstPrompt||f;const u=document.createElement("span");u.className="history-item-subtitle",y.startsWith("#")&&u.classList.add("is-case"),u.textContent=y,t.append(c,u);const h=document.createElement("span");h.className="history-item-meta",h.textContent=o;const d=document.createElement("button");d.className="history-item-expand",d.type="button",d.setAttribute("aria-label","Show details"),d.setAttribute("aria-expanded","false"),d.textContent="\u22EF",a.append(t,h,d);const p=document.createElement("div");p.className="history-item-detail",p.hidden=!0;const _=document.createElement("div");_.className="history-detail-row";const g=document.createElement("span");g.className="history-detail-label",g.textContent="Prompt";const v=document.createElement("span");v.className="history-detail-value history-detail-prompt",v.textContent=e.firstPrompt||"(no prompt captured)",_.append(g,v);const b=document.createElement("div");b.className="history-detail-row";const E=document.createElement("span");E.className="history-detail-label",E.textContent="Path";const T=document.createElement("span");T.className="history-detail-value history-detail-path",T.textContent=f,b.append(E,T);const I=document.createElement("div");if(I.className="history-detail-row history-detail-meta",I.textContent=`${o} \xB7 ${l} \xB7 ${e.sessionId.slice(0,8)}`,p.append(_,b,I),n&&e.projectKey){const S=document.createElement("div");S.className="history-detail-row history-detail-actions";const w=document.createElement("button");w.type="button",w.className="history-view-all-btn",w.textContent="View all in this folder",w.addEventListener("click",x=>{x.stopPropagation(),this.openFolderHistoryModal(e.projectKey,e.workingDir,s)}),S.appendChild(w),p.appendChild(S)}return d.addEventListener("click",S=>{S.stopPropagation();const w=m.classList.toggle("expanded");p.hidden=!w,d.setAttribute("aria-expanded",w?"true":"false")}),m.append(a,p),m},_HISTORY_INITIAL_COUNT:4,async loadHistorySessions(){const e=document.getElementById("historySessions"),s=document.getElementById("historyList");if(!(!e||!s))try{const i=Array.isArray(this.cases)&&this.cases.length>0?Promise.resolve(this.cases):fetch("/api/cases").then(o=>o.ok?o.json():null).then(o=>o?.data||[]).catch(()=>[]),[n,l]=await Promise.all([this._fetchHistorySessions(30),i]);if(n.length===0){e.style.display="none";return}s.replaceChildren();const r=this._HISTORY_INITIAL_COUNT;for(let o=0;o<Math.min(r,n.length);o++)s.appendChild(this._buildHistoryItem(n[o],l));if(n.length>r){const o=document.createElement("button");o.className="history-show-more",o.textContent=`Show ${n.length-r} more`,o.addEventListener("click",()=>{for(let f=r;f<n.length;f++)s.insertBefore(this._buildHistoryItem(n[f],l),o);o.remove()}),s.appendChild(o)}e.style.display=""}catch(i){console.error("[loadHistorySessions]",i),e.style.display="none"}},_FOLDER_HISTORY_PAGE_SIZE:20,openFolderHistoryModal(e,s,i){this._closeFolderHistoryModal();const n=document.createElement("div");n.className="modal active folder-history-modal",n.id="folderHistoryModal";const l=document.createElement("div");l.className="modal-backdrop",l.addEventListener("click",()=>this._closeFolderHistoryModal());const r=document.createElement("div");r.className="modal-content modal-lg";const o=document.createElement("div");o.className="modal-header";const f=document.createElement("h3");f.textContent="Folder History";const y=document.createElement("div");y.className="folder-history-subtitle",y.textContent=this._shortenHomePath(s);const m=document.createElement("button");m.className="modal-close",m.setAttribute("aria-label","Close"),m.innerHTML="×",m.addEventListener("click",()=>this._closeFolderHistoryModal()),o.append(f,m);const a=document.createElement("div");a.className="modal-body";const t=document.createElement("div");t.className="folder-history-list",t.setAttribute("data-loading","true"),t.textContent="Loading...",a.append(y,t),r.append(o,a),n.append(l,r),document.body.appendChild(n),this._folderHistoryState={projectKey:e,workingDir:s,cases:i||[],offset:0,total:null,list:t},this._folderHistoryEscHandler=c=>{c.key==="Escape"&&this._closeFolderHistoryModal()},document.addEventListener("keydown",this._folderHistoryEscHandler),this._loadFolderHistoryPage()},async _loadFolderHistoryPage(){const e=this._folderHistoryState;if(!e)return;const{projectKey:s,cases:i,list:n}=e,l=this._FOLDER_HISTORY_PAGE_SIZE,r=e.offset,o=n.querySelector(".folder-history-more");o&&o.remove(),r===0&&(n.replaceChildren(),n.removeAttribute("data-loading"));try{const f=`/api/history/sessions?projectKey=${encodeURIComponent(s)}&offset=${r}&limit=${l}`,m=await(await fetch(f)).json(),a=m.data?.sessions||[];if(e.total=typeof m.data?.total=="number"?m.data.total:a.length+r,r===0&&a.length===0){const t=document.createElement("div");t.className="folder-history-empty",t.textContent="No conversations found in this folder.",n.appendChild(t);return}for(const t of a)n.appendChild(this._buildHistoryItem(t,i,{showViewAll:!1}));if(e.offset=r+a.length,e.offset<e.total){const t=e.total-e.offset,c=document.createElement("button");c.className="history-show-more folder-history-more",c.textContent=`Show ${Math.min(l,t)} more (${t} remaining)`,c.addEventListener("click",()=>this._loadFolderHistoryPage()),n.appendChild(c)}}catch(f){console.error("[loadFolderHistoryPage]",f);const y=document.createElement("div");y.className="folder-history-empty",y.textContent="Failed to load folder history.",n.appendChild(y)}},_closeFolderHistoryModal(){const e=document.getElementById("folderHistoryModal");e&&e.remove(),this._folderHistoryEscHandler&&(document.removeEventListener("keydown",this._folderHistoryEscHandler),this._folderHistoryEscHandler=null),this._folderHistoryState=null},async resumeHistorySession(e,s){document.getElementById("runModeMenu")?.classList.remove("active"),this._closeFolderHistoryModal();try{this.terminal.clear(),this.terminal.writeln(`\x1B[1;32m Resuming conversation ${e.slice(0,8)}...\x1B[0m`);const i=s.split("/").pop()||"session";let n=1;for(const[,u]of this.sessions){const h=u.name&&u.name.match(/^w(\d+)-/);if(h){const d=parseInt(h[1]);d>=n&&(n=d+1)}}const l=`w${n}-${i}`,o=(this.cases||[]).find(u=>u.path===s)?.name||s.split("/").pop()||"",f=this.loadAppSettingsFromStorage(),y=this.buildEnvOverrides(this.getCaseSettings(o),f),m=this.getEffortSetting(f),t=await(await fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workingDir:s,name:l,resumeSessionId:e,...Object.keys(y).length>0?{envOverrides:y}:{},...m?{effort:m}:{}})})).json();if(!t.success)throw new Error(t.error);const c=t.data.session.id;await fetch(`/api/sessions/${c}/interactive`,{method:"POST"}),this.terminal.writeln(`\x1B[90m Session ${l} ready\x1B[0m`),await this.selectSession(c),this.terminal.focus()}catch(i){this.terminal.writeln(`\x1B[1;31m Error: ${i.message}\x1B[0m`)}},isTerminalAtBottom(){if(!this.terminal)return!0;const e=this.terminal.buffer.active;return e.viewportY>=e.baseY-2},_noteTerminalUserScroll(e){e<0?this._lastUserScrollUpAt=performance.now():this.isTerminalAtBottom()&&(this._lastUserScrollUpAt=null)},_hasRecentUserScrollUp(){return typeof this._lastUserScrollUpAt!="number"?!1:performance.now()-this._lastUserScrollUpAt<window.CodemanTerminalInput.USER_SCROLL_STICKY_SUPPRESS_MS},batchTerminalWrite(e){if(this._isLoadingBuffer){this._loadBufferQueue&&this._loadBufferQueue.push(e);return}if(this.writeFrameScheduled||(this._wasAtBottomBeforeWrite=this.isTerminalAtBottom()),(this.activeSessionId?this.sessions.get(this.activeSessionId):null)?.flickerFilterEnabled??!1){if(e.includes("\x1B[2J")||e.includes("\x1B[H\x1B[J")||e.includes("\x1B[H")&&e.includes("\x1B[?25l")){this.flickerFilterActive=!0,this.flickerFilterBuffer+=e,this.flickerFilterTimeout&&clearTimeout(this.flickerFilterTimeout),this.flickerFilterTimeout=setTimeout(()=>{this.flickerFilterTimeout=null,this.flushFlickerBuffer()},SYNC_WAIT_TIMEOUT_MS);return}if(this.flickerFilterActive){this.flickerFilterBuffer+=e;return}}this.pendingWrites.push(e),this.writeFrameScheduled||(this.writeFrameScheduled=!0,this._safeYield(()=>{this.flushPendingWrites(),this.writeFrameScheduled=!1}))},flushFlickerBuffer(){this.flickerFilterBuffer&&(this.pendingWrites.push(this.flickerFilterBuffer),this.flickerFilterBuffer="",this.flickerFilterActive=!1,this.writeFrameScheduled||(this.writeFrameScheduled=!0,this._safeYield(()=>{this.flushPendingWrites(),this.writeFrameScheduled=!1})))},_updateLocalEchoState(){const e=this.loadAppSettingsFromStorage(),s=this.activeSessionId?this.sessions.get(this.activeSessionId):null,n=!!((e.localEchoEnabled??MobileDetection.isTouchDevice())&&s);this._localEchoEnabled&&!n&&this._localEchoOverlay?.clear(),this._localEchoEnabled=n,this._localEchoOverlay&&s&&(s.mode==="opencode"?this._localEchoOverlay.setPrompt({type:"custom",offset:3,find:l=>{try{const r=l.buffer.active,o=r.cursorY,f=r.getLine(r.viewportY+o);if(!f)return null;const m=f.translateToString(!0).indexOf("\u2503");return m>=0?{row:o,col:m}:null}catch{return null}}}):s.mode==="shell"?(this._localEchoOverlay.clear(),this._localEchoEnabled=!1):this._localEchoOverlay.setPrompt({type:"custom",offset:0,find:l=>{try{const r=l.buffer.active;for(let o=l.rows-1;o>=0;o--){const f=r.getLine(r.viewportY+o);if(!f)continue;const m=f.translateToString(!0).lastIndexOf("\u276F");if(m>=0)return{row:o,col:m+2}}return{row:Math.max(0,Math.min(l.rows-1,r.cursorY)),col:Math.max(0,Math.min(l.cols-1,r.cursorX))}}catch{return null}}}))},_handleCjkInput(e){if(!this.activeSessionId)return;const s=this.activeSessionId,i=this.sessions.get(s);if(!!!(this._localEchoEnabled&&this._localEchoOverlay&&i?.mode!=="shell")){this._sendInputAsync(s,e);return}if(e==="\x7F"){if(this._localEchoOverlay.removeChar()==="flushed"){const{count:r,text:o}=this._localEchoOverlay.getFlushed();this._flushedOffsets?.has(s)&&(r===0?(this._flushedOffsets.delete(s),this._flushedTexts?.delete(s)):(this._flushedOffsets.set(s,r),this._flushedTexts?.set(s,o))),this._sendInputAsync(s,e)}return}if(/[\r\n]+$/.test(e)){const l=e.replace(/[\r\n]+$/g,"");l&&this._localEchoOverlay.appendText(l);const r=this._localEchoOverlay.pendingText||"";this._localEchoOverlay.clear(),this._localEchoOverlay.suppressBufferDetection(),this._flushedOffsets?.delete(s),this._flushedTexts?.delete(s),r&&this._sendInputAsync(s,r),setTimeout(()=>this._sendInputAsync(s,"\r"),r?80:0);return}if(e.length>1&&e.charCodeAt(0)===27){this._sendInputAsync(s,e);return}if(e.length===1&&e.charCodeAt(0)<32){const l=this._localEchoOverlay.pendingText||"";this._localEchoOverlay.clear(),this._localEchoOverlay.suppressBufferDetection(),this._flushedOffsets?.delete(s),this._flushedTexts?.delete(s),l&&this._sendInputAsync(s,l),this._sendInputAsync(s,e);return}this._localEchoOverlay.appendText(e)},flushPendingWrites(){if(this.pendingWrites.length===0||!this.terminal)return;const e=performance.now(),s=this.pendingWrites.join("");this.pendingWrites=[];const i=s.length;i>16384&&_crashDiag.log(`FLUSH: ${(i/1024).toFixed(0)}KB`);const l=(this.activeSessionId&&this.sessions?this.sessions.get(this.activeSessionId):null)?.mode==="codex"?32768:65536;let r=!1;const o=this._hasRecentUserScrollUp()&&this.terminal.buffer?.active?this.terminal.buffer.active.viewportY:null;i<=l?this.terminal.write(s):(this.terminal.write(s.slice(0,l)),this.pendingWrites.push(s.slice(l)),r=!0,this.writeFrameScheduled||(this.writeFrameScheduled=!0,this._safeYield(()=>{this.flushPendingWrites(),this.writeFrameScheduled=!1}))),o!==null&&this.terminal.buffer?.active?.viewportY!==o&&typeof this.terminal.scrollToLine=="function"&&this.terminal.scrollToLine(o);const f=r?l:i,y=performance.now()-e;if((y>100||r)&&console.warn(`[CRASH-DIAG] flushPendingWrites: ${y.toFixed(0)}ms, ${(f/1024).toFixed(0)}KB written${r?", rest deferred":""} (total ${(i/1024).toFixed(0)}KB)`),this._wasAtBottomBeforeWrite&&!this._hasRecentUserScrollUp()&&this.terminal.scrollToBottom(),this._localEchoOverlay?.hasPending&&this._localEchoOverlay.rerender(),this._tabCompletionSessionId&&this._tabCompletionSessionId===this.activeSessionId&&this._localEchoOverlay&&!this._localEchoOverlay.pendingText){const m=this._localEchoOverlay,a=this;this.terminal.write("",()=>{if(!a._tabCompletionSessionId)return;m.resetBufferDetection();const t=m.detectBufferText();t?t===a._tabCompletionBaseText?(m.undoDetection(),a._tabCompletionRetries=(a._tabCompletionRetries||0)+1,a._tabCompletionRetries>60&&(a._tabCompletionSessionId=null,a._tabCompletionRetries=0)):(a._tabCompletionSessionId=null,a._tabCompletionRetries=0,a._tabCompletionBaseText=null,a._tabCompletionFallback&&(clearTimeout(a._tabCompletionFallback),a._tabCompletionFallback=null),m.rerender()):(a._tabCompletionRetries=(a._tabCompletionRetries||0)+1,a._tabCompletionRetries>60&&(a._tabCompletionSessionId=null,a._tabCompletionRetries=0))})}},_safeYield(e){let s=!1;const i=()=>{s||(s=!0,e())};requestAnimationFrame(i),setTimeout(i,50),this._workerYield(i)},_workerYield(e){try{if(this._yieldWorker===void 0){const s="onmessage=()=>setTimeout(()=>postMessage(0),0);",i=new Blob([s],{type:"application/javascript"}),n=URL.createObjectURL(i);this._yieldWorker=new Worker(n),URL.revokeObjectURL(n),this._yieldQueue=[],this._yieldWorker.onmessage=()=>{const l=this._yieldQueue.shift();l&&l()}}if(!this._yieldWorker)return;this._yieldQueue.push(e),this._yieldWorker.postMessage(0)}catch{this._yieldWorker=null}},scrollToLastNonEmptyLine(){if(!this.terminal?.buffer?.active){this.terminal?.scrollToBottom?.();return}const e=this.terminal.buffer.active,s=e.baseY+e.length;let i=-1;for(let n=s-1;n>=0;n--)if(e.getLine(n)?.translateToString(!0).trim()){i=n;break}if(i>=0&&typeof this.terminal.scrollToLine=="function"){let n=Math.max(0,i-this.terminal.rows+2);const l=Math.max(0,i);for(;n<l&&!e.getLine(n)?.translateToString(!0).trim();)n++;this.terminal.scrollToLine(n)}else this.terminal.scrollToBottom()},chunkedTerminalWrite(e,s=TERMINAL_CHUNK_SIZE,i){const n=++this._chunkedWriteGen,l=this._beginBufferLoad(i);return new Promise(r=>{if(!e||e.length===0){this._finishBufferLoad(l),r();return}const o=e.replace(DEC_SYNC_STRIP_RE,""),f=()=>{this._chunkedWriteGen===n&&this._finishBufferLoad(l),r()};if(o.length<=s){this.terminal.write(o,f);return}let y=0;const m=performance.now();let a=0;const t=()=>{if(this._chunkedWriteGen!==n){r();return}if(y>=o.length){const d=performance.now()-m;console.log(`[CRASH-DIAG] chunkedTerminalWrite complete: ${o.length} bytes in ${a} chunks, ${d.toFixed(0)}ms total`),this._safeYield(f);return}const c=performance.now(),u=o.slice(y,y+s);this.terminal.write(u);const h=performance.now()-c;a++,h>50&&console.warn(`[CRASH-DIAG] chunk #${a} write took ${h.toFixed(0)}ms (${u.length} bytes at offset ${y})`),y+=s,this._safeYield(t)};this._safeYield(t)})},_beginBufferLoad(e){this._bufferLoadSeq===void 0&&(this._bufferLoadSeq=0);const s=e===void 0?`buffer-${++this._bufferLoadSeq}`:e;return this._bufferLoadOwner=s,this._isLoadingBuffer=!0,this._loadBufferQueue=[],s},_finishBufferLoad(e){return e!==void 0&&this._bufferLoadOwner!==e?!1:(this._isLoadingBuffer=!1,this._loadBufferQueue=null,this._bufferLoadOwner=null,!0)},clearTerminal(){this.terminal.clear()},async restoreTerminalSize(){if(!this.activeSessionId){this.showToast("No active session","warning");return}const e=this.getTerminalDimensions();if(!e){this.showToast("Could not determine terminal size","error");return}try{await this.sendResize(this.activeSessionId),this.showToast(`Terminal restored to ${e.cols}x${e.rows}`,"success")}catch(s){console.error("Failed to restore terminal size:",s),this.showToast("Failed to restore terminal size","error")}},sendPendingCtrlL(e){},async copyTerminal(){try{const e=this.terminal.buffer.active;let s="";for(let i=0;i<e.length;i++){const n=e.getLine(i);n&&(s+=n.translateToString(!0)+`
|
|
2
|
+
`)}await navigator.clipboard.writeText(s.replace(/\n+$/,`
|
|
3
|
+
`)),this.showToast("Copied to clipboard","success")}catch{this.showToast("Failed to copy","error")}},_syncMobileHelperTextareaToCursor(){if(!(!MobileDetection.isTouchDevice()||!this.terminal?.element))try{const e=this.terminal.element,s=this.terminal.element.querySelector(".xterm-cursor"),i=this.terminal.element.querySelector(".xterm-screen");if(!(e instanceof HTMLElement)||!(s instanceof HTMLElement)||!(i instanceof HTMLElement))return;const n=s.getBoundingClientRect(),l=i.getBoundingClientRect();if(!n.width&&!n.height)return;const r=Math.max(0,Math.round(n.left-l.left)),o=Math.max(0,Math.round(n.top-l.top));e.style.setProperty("--xterm-helper-left",`${r}px`),e.style.setProperty("--xterm-helper-top",`${o}px`)}catch{}},increaseFontSize(){const e=this.terminal.options.fontSize||14;this.setFontSize(Math.min(e+2,24))},decreaseFontSize(){const e=this.terminal.options.fontSize||14;this.setFontSize(Math.max(e-2,10))},setFontSize(e){this.terminal.options.fontSize=e,document.getElementById("fontSizeDisplay").textContent=e,this.fitAddon.fit(),localStorage.setItem("codeman-font-size",e),this._localEchoOverlay?.refreshFont()},loadFontSize(){const e=localStorage.getItem("codeman-font-size");if(e){const s=parseInt(e,10);s>=10&&s<=24&&(this.terminal.options.fontSize=s,document.getElementById("fontSizeDisplay").textContent=s)}},getTerminalDimensions(){const i=this.fitAddon?.proposeDimensions();return i?{cols:Math.max(i.cols,40),rows:Math.max(i.rows,10)}:null},async sendResize(e,s={}){this.fitAddon&&this.fitAddon.fit();const i=this.getTerminalDimensions();if(!i)return!1;const n=this._lastResizeDims,l=!n||n.cols!==i.cols||n.rows!==i.rows;this._lastResizeDims={cols:i.cols,rows:i.rows};const r=typeof MobileDetection<"u"&&MobileDetection.getDeviceType?MobileDetection.getDeviceType():window.innerWidth<430?"mobile":window.innerWidth<768?"tablet":"desktop";if(!s.forceHttp&&this._wsReady&&this._wsSessionId===e)try{return this._ws.send(JSON.stringify({t:"z",c:i.cols,r:i.rows,v:r})),l}catch{}return await fetch(`/api/sessions/${e}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...i,viewportType:r})}),l},async sendInput(e){this.activeSessionId&&await fetch(`/api/sessions/${this.activeSessionId}/input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e,useMux:!0})})},toggleDirInput(){const e=document.querySelector("#dirDisplay").parentElement,s=document.getElementById("dirInput");s.classList.contains("hidden")&&(s.classList.remove("hidden"),e.style.display="none",s.focus())},hideDirInput(){const e=document.querySelector("#dirDisplay").parentElement,s=document.getElementById("dirInput");setTimeout(()=>{s.classList.add("hidden"),e.style.display="";const i=s.value.trim();document.getElementById("dirDisplay").textContent=i||"No directory"},100)}});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-routes.d.ts","sourceRoot":"","sources":["../../../src/web/routes/session-routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"session-routes.d.ts","sourceRoot":"","sources":["../../../src/web/routes/session-routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA6C1C,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AA0CjG;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA0C1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CA0BvE;AAWD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,OAAO,CAiBhF;AAGD,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAC/D,IAAI,CA2jDN"}
|
|
@@ -12,7 +12,7 @@ import { randomBytes } from 'node:crypto';
|
|
|
12
12
|
import { ApiErrorCode, createErrorResponse, getErrorMessage, } from '../../types.js';
|
|
13
13
|
import { Session } from '../../session.js';
|
|
14
14
|
import { SseEvent } from '../sse-events.js';
|
|
15
|
-
import { CreateSessionSchema, SessionNameSchema, SessionColorSchema, RunPromptSchema, SessionInputWithLimitSchema, ResizeSchema, AutoClearSchema, AutoCompactSchema, ImageWatcherSchema, FlickerFilterSchema, QuickRunSchema, QuickStartSchema, } from '../schemas.js';
|
|
15
|
+
import { CreateSessionSchema, SessionNameSchema, SessionColorSchema, RunPromptSchema, SessionInputWithLimitSchema, ResizeSchema, AutoClearSchema, AutoCompactSchema, AutoResumeSchema, ImageWatcherSchema, FlickerFilterSchema, QuickRunSchema, QuickStartSchema, } from '../schemas.js';
|
|
16
16
|
import { autoConfigureRalph, CASES_DIR, findSessionOrFail, parseBody, persistAndBroadcastSession, SETTINGS_PATH, validatePathWithinBase, } from '../route-helpers.js';
|
|
17
17
|
import { AUTH_COOKIE_NAME } from '../middleware/auth.js';
|
|
18
18
|
import { writeHooksConfig, updateCaseModel, stripCaseEnvKeys } from '../../hooks-config.js';
|
|
@@ -31,6 +31,30 @@ const CLAUDE_BANNER_PATTERN = /\x1b\[1mClaud/;
|
|
|
31
31
|
// eslint-disable-next-line no-control-regex
|
|
32
32
|
const CTRL_L_PATTERN = /\x0c/g;
|
|
33
33
|
const LEADING_WHITESPACE_PATTERN = /^[\s\r\n]+/;
|
|
34
|
+
/**
|
|
35
|
+
* Match xterm alternate-screen mode toggles + the standalone scrollback-erase.
|
|
36
|
+
*
|
|
37
|
+
* - DECSET/DECRST 47, 1047, 1049 = enter/exit alternate screen buffer
|
|
38
|
+
* (1049 also saves cursor and clears the alt buffer).
|
|
39
|
+
* - CSI 3 J = erase saved lines (scrollback).
|
|
40
|
+
*
|
|
41
|
+
* Codex emits `\x1b[?1049h` and clear-scrollback sequences during startup and
|
|
42
|
+
* on repaint. xterm.js obeys them by switching to the alt buffer (no native
|
|
43
|
+
* scrollback) and wiping saved lines, so the user's conversation history
|
|
44
|
+
* disappears on every tab switch / pane refresh. Stripping these from the
|
|
45
|
+
* replayed byte stream keeps everything in the main buffer with scrollback
|
|
46
|
+
* intact. Mirrors the live-stream strip in Session._handleTerminalOutput.
|
|
47
|
+
*/
|
|
48
|
+
// eslint-disable-next-line no-control-regex
|
|
49
|
+
const ALT_SCREEN_TOGGLE_PATTERN = /\x1b\[\?(?:47|1047|1049)[hl]/g;
|
|
50
|
+
// eslint-disable-next-line no-control-regex
|
|
51
|
+
const ERASE_SCROLLBACK_PATTERN = /\x1b\[3J/g;
|
|
52
|
+
// Mouse-tracking enables (X10/button/any-event/UTF-8/SGR/alt-scroll) — once on,
|
|
53
|
+
// xterm.js forwards wheel events to the app instead of scrolling the viewport.
|
|
54
|
+
// Live streams are stripped at the source, but buffers persisted BEFORE that
|
|
55
|
+
// strip existed can still carry them; strip on replay for parity.
|
|
56
|
+
// eslint-disable-next-line no-control-regex
|
|
57
|
+
const MOUSE_TRACKING_PATTERN = /\x1b\[\?(?:1000|1001|1002|1003|1005|1006|1007)[hl]/g;
|
|
34
58
|
/**
|
|
35
59
|
* Strip redundant Ink spinner/status-bar redraw frames from the terminal buffer.
|
|
36
60
|
* Ink (Claude Code's TUI) uses absolute cursor positioning (CSI n d = VPA) to animate
|
|
@@ -783,7 +807,16 @@ export function registerSessionRoutes(app, ctx) {
|
|
|
783
807
|
// During long thinking phases, Ink rewrites the same rows thousands of times
|
|
784
808
|
// (500KB+). Without stripping, tail mode returns only spinner frames and
|
|
785
809
|
// the terminal appears empty when switching tabs.
|
|
786
|
-
|
|
810
|
+
let strippedBuffer = stripInkRedrawBloat(rawBuffer);
|
|
811
|
+
// Strip alt-screen toggles and scrollback-erase from codex byte streams.
|
|
812
|
+
// xterm.js obeys them by switching to its scrollback-less alt buffer and
|
|
813
|
+
// wiping saved lines, so conversation history disappears on tab switch.
|
|
814
|
+
if (session.mode === 'codex') {
|
|
815
|
+
strippedBuffer = strippedBuffer
|
|
816
|
+
.replace(ALT_SCREEN_TOGGLE_PATTERN, '')
|
|
817
|
+
.replace(ERASE_SCROLLBACK_PATTERN, '')
|
|
818
|
+
.replace(MOUSE_TRACKING_PATTERN, '');
|
|
819
|
+
}
|
|
787
820
|
if (tailBytes > 0 && strippedBuffer.length > tailBytes) {
|
|
788
821
|
// Fast path: tail from the end, skip expensive banner search on full 2MB buffer.
|
|
789
822
|
// Banner is near the top and gets discarded by tail anyway.
|
|
@@ -857,6 +890,23 @@ export function registerSessionRoutes(app, ctx) {
|
|
|
857
890
|
},
|
|
858
891
|
};
|
|
859
892
|
});
|
|
893
|
+
// ========== Auto-Resume (usage-limit pause) ==========
|
|
894
|
+
app.post('/api/sessions/:id/auto-resume', async (req) => {
|
|
895
|
+
const { id } = req.params;
|
|
896
|
+
const body = parseBody(AutoResumeSchema, req.body, 'Invalid request body');
|
|
897
|
+
const session = findSessionOrFail(ctx, id);
|
|
898
|
+
session.setAutoResume(body.enabled);
|
|
899
|
+
persistAndBroadcastSession(ctx, session);
|
|
900
|
+
return {
|
|
901
|
+
success: true,
|
|
902
|
+
data: {
|
|
903
|
+
autoResume: {
|
|
904
|
+
enabled: session.autoResumeEnabled,
|
|
905
|
+
resumeAt: session.autoResumeAt ?? undefined,
|
|
906
|
+
},
|
|
907
|
+
},
|
|
908
|
+
};
|
|
909
|
+
});
|
|
860
910
|
// ========== Image Watcher ==========
|
|
861
911
|
app.post('/api/sessions/:id/image-watcher', async (req) => {
|
|
862
912
|
const { id } = req.params;
|