#gcodex-terminal{position:fixed;inset:0;z-index:3000;display:flex;flex-direction:column;background:#080e1d;color:#e8f0ff;font:13px system-ui,sans-serif;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}#gcodex-terminal.gt-hidden{display:none}.gt-header,.gt-nav,.gt-toolbar,.gt-row,.gt-keys,.gt-form-actions{display:flex;align-items:center;gap:8px}.gt-header{padding:13px 16px;border-bottom:1px solid #283a5d;justify-content:space-between}.gt-header strong{font-size:17px}.gt-header small{display:block;color:#94abc8;font-size:11px;margin-top:3px}.gt-header-actions{display:flex;gap:7px}#gcodex-terminal button{cursor:pointer;color:#e8f0ff;border:1px solid #324869;background:#1b2a43;border-radius:9px;padding:10px;white-space:nowrap}#gcodex-terminal button:active{background:#365885}#gcodex-terminal button.selected,#gcodex-terminal #gt-run{background:#246b97}.gt-nav{padding:9px 12px;overflow-x:auto;border-bottom:1px solid #263954;scrollbar-width:none}.gt-nav button{font-size:12px}.gt-pane{min-height:0;flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:12px}.gt-pane[hidden]{display:none}.gt-toolbar{overflow-x:auto;flex-shrink:0}.gt-toolbar button{font-size:11px}.gt-terminal-pane{padding-bottom:9px}#gt-screen{background:#030816;color:#bdecc8;border:1px solid #2d4163;border-radius:12px;padding:16px;flex:1;min-height:80px;white-space:pre-wrap;overflow:auto;word-break:break-word;font:13px/1.52 ui-monospace,SFMono-Regular,Consolas,monospace;user-select:text}#gcodex-terminal input,#gcodex-terminal textarea{width:100%;border:1px solid #345073;border-radius:9px;background:#080f20;color:#e8f0ff;padding:10px;font:16px/1.4 monospace;min-width:0}.gt-form{display:flex;flex-direction:column;gap:8px}.gt-form textarea{resize:vertical;min-height:55px;max-height:150px}.gt-form-actions{justify-content:flex-end}.gt-keys{overflow-x:auto;flex-shrink:0;padding:3px 0}.gt-keys button{min-width:44px;font-size:11px}.gt-row{width:100%}.gt-row input{flex:1}.gt-files{display:flex;flex-direction:column;gap:6px}.gt-files button{text-align:left;white-space:normal!important;word-break:break-word}.gt-record{border:1px solid #304766;border-radius:10px;padding:12px;display:flex;align-items:center;gap:8px;justify-content:space-between;margin-top:7px;word-break:break-all}.gt-record div{flex:1}.gt-hint{color:#a0b0ca}.gt-plan{border:1px solid #376d90;background:#11253d;border-radius:10px;padding:15px}#gcodex-terminal h3{font-weight:700;font-size:18px}#gcodex-terminal p{color:#b8c6de;line-height:1.6}@media(min-width:980px){#gcodex-terminal{inset:4% 6%;border:1px solid #36537b;border-radius:17px;box-shadow:0 0 0 200vw #0009;padding:0}#gt-screen{font-size:14px}}@media(max-width:650px){.gt-header{padding:10px}.gt-header strong{font-size:14px}.gt-header-actions button{font-size:11px;padding:8px}.gt-pane{padding:9px}.gt-nav button{padding:9px!important}#gt-screen{padding:11px;font-size:12px}.gt-toolbar button{padding:8px!important}.gt-keys button{padding:9px!important}}

.gt-settings-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px;padding:14px 0}.gt-settings-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#d4deea}.gt-settings-form input,.gt-settings-form select{width:100%;padding:12px;min-height:44px;border:1px solid #45546a;background:#0a1425;color:#fff;border-radius:9px}.gt-settings-form>.gt-toolbar,.gt-settings-form>#gt-profile-message{grid-column:1/-1}.gt-settings-form button{min-height:44px}.gt-settings-form [hidden]{display:none!important}@media(max-width:600px){.gt-settings-form{grid-template-columns:1fr}.gt-settings-form .gt-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px}}

/* V16: keep this fullscreen workspace above all studio overlays and do not obscure its fields. */
#gcodex-terminal{z-index:2147483000!important;isolation:isolate;box-sizing:border-box;height:100dvh;max-height:100dvh;overflow:hidden}
#gcodex-terminal.gt-hidden{display:none!important}
#gcodex-terminal .gt-header,#gcodex-terminal .gt-nav,#gcodex-terminal .gt-progress,#gcodex-terminal .gt-feedback{flex:0 0 auto;position:relative;z-index:2;background:#080e1d}
#gcodex-terminal .gt-pane{min-height:0;overscroll-behavior:contain;overflow-y:auto;-webkit-overflow-scrolling:touch}
#gcodex-terminal .gt-pane[hidden],#gcodex-terminal [hidden]{display:none!important}
#gcodex-terminal .gt-settings-form{padding-bottom:90px;align-content:start;}
#gcodex-terminal .gt-progress{padding:8px 16px;background:#193b58;color:#d7efff;animation:gtpulse 1.2s ease-in-out infinite}
#gcodex-terminal .gt-feedback{padding:7px 16px;color:#acc0dc;font-size:12px;max-height:75px;overflow:auto}
#gcodex-terminal button:disabled{opacity:.55;cursor:wait}
#gcodex-terminal input:focus,#gcodex-terminal select:focus,#gcodex-terminal textarea:focus{outline:2px solid #3ea8f2;outline-offset:2px}
@keyframes gtpulse{50%{opacity:.65}}
@media(min-width:980px){#gcodex-terminal{height:92dvh;max-height:92dvh}}
@media(max-width:650px){#gcodex-terminal{height:100dvh;max-height:100dvh;padding-bottom:max(env(safe-area-inset-bottom),8px)}#gcodex-terminal .gt-nav{min-height:53px}#gcodex-terminal .gt-header{min-height:64px}#gcodex-terminal .gt-settings-form{padding-bottom:110px}}

/* V18 mobile console controls + ANSI terminal */
#gt-screen{display:block;min-height:170px;flex:1 1 230px;white-space:normal;word-break:normal;overflow:hidden;padding:8px}
#gt-screen .xterm{height:100%;min-height:100%;padding:2px}
#gt-screen .xterm-viewport{overflow-y:auto!important}
#gt-screen .gt-fallback{height:100%;margin:0;white-space:pre-wrap;overflow:auto;overflow-wrap:anywhere;color:#bbefc9;font:13px/1.5 ui-monospace,monospace}
#gcodex-terminal .gt-quick{display:flex;gap:6px;overflow-x:auto;flex:0 0 auto;padding-bottom:3px}
#gcodex-terminal .gt-quick button{font-size:11px;padding:8px 10px;background:#14384c;border-color:#28617d}
#gcodex-terminal .gt-terminal-pane{gap:8px}
#gcodex-terminal .gt-keys button{font-size:12px}
@media(max-width:650px){#gt-screen{min-height:160px;padding:5px}#gcodex-terminal .gt-form textarea{min-height:45px;max-height:90px}#gcodex-terminal .gt-quick button{padding:7px}}

/* V19 compact mobile controls and in-place preferences */
#gcodex-terminal .gt-actionbar{display:flex;flex-wrap:nowrap;gap:4px;overflow-x:auto;scrollbar-width:none;padding:2px 1px;touch-action:pan-x}
#gcodex-terminal .gt-actionbar button{flex:0 0 auto;padding:6px 9px;min-height:33px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;gap:5px}
#gcodex-terminal .gt-icon{font-size:17px;line-height:1}#gcodex-terminal .gt-label{font-size:11px}
#gcodex-terminal .gt-keys{gap:4px;padding:0}#gcodex-terminal .gt-keys button{min-width:34px;min-height:30px;padding:4px 7px!important;border-radius:6px}
#gcodex-terminal .gt-quick{gap:4px}#gcodex-terminal .gt-quick button{min-height:30px;padding:5px 7px}
#gcodex-terminal .gt-terminal-pane{position:relative;gap:5px;padding:7px}#gcodex-terminal .gt-form{gap:4px}
#gcodex-terminal .gt-form-actions{gap:4px}#gcodex-terminal .gt-form-actions button{padding:5px 9px;min-height:32px}
#gcodex-terminal .gt-preferences{position:absolute;z-index:20;right:7px;top:45px;width:min(330px,calc(100% - 14px));max-height:calc(100% - 55px);overflow-y:auto;padding:13px;background:#111e32;border:1px solid #426081;border-radius:12px;box-shadow:0 12px 30px #0009}
#gcodex-terminal .gt-pref-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
#gcodex-terminal .gt-preferences label{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:12px}
#gcodex-terminal .gt-preferences input[type=range]{width:100%;accent-color:#56aceb}
#gcodex-terminal .gt-preferences input[type=checkbox]{width:18px;height:18px;accent-color:#56aceb}
#gcodex-terminal .gt-preferences select{background:#071326;color:white;padding:6px;border-radius:6px}
#gcodex-terminal .gt-preferences small{color:#9dacc1;display:block;margin-top:10px}
#gcodex-terminal #gt-screen[data-theme=black]{background:#000}#gcodex-terminal #gt-screen[data-theme=light]{background:#f6f8fa}
@media(max-width:650px){#gcodex-terminal .gt-actionbar button{min-width:35px;padding:5px 6px!important;min-height:32px}#gcodex-terminal .gt-actionbar .gt-label{display:none}#gcodex-terminal .gt-keys button{min-width:31px;padding:4px 6px!important}#gcodex-terminal .gt-terminal-pane{padding:5px;gap:4px}#gcodex-terminal #gt-screen{min-height:130px;padding:2px}#gcodex-terminal .gt-form textarea{min-height:40px;padding:7px;font-size:16px}#gcodex-terminal .gt-header{min-height:52px}#gcodex-terminal .gt-nav{min-height:40px;padding:4px 6px}}

/* V20 AI voice input */
#gcodex-terminal .gt-ai-pane{display:flex;flex-direction:column;gap:8px;min-height:0}
#gcodex-terminal .gt-ai-pane[hidden],#gcodex-terminal [hidden]{display:none!important}
#gcodex-terminal .gt-ai-header{display:flex;gap:8px;align-items:center;justify-content:space-between}
#gcodex-terminal .gt-ai-badge{font-size:10px;color:#facc15;font-weight:500}
#gcodex-terminal .gt-ai-mode{display:flex;gap:5px;background:#0b1a2c;padding:3px;border-radius:9px}
#gcodex-terminal .gt-ai-mode button{flex:1;padding:7px 9px;border-radius:7px;font-size:12px;background:#182a3f;color:#d8efff}
#gcodex-terminal .gt-ai-mode button[aria-pressed=true]{background:#176347;color:#fff}
#gcodex-terminal .gt-ai-space{flex:1;min-height:55px;overflow:auto;font-size:12px;line-height:1.5}
#gcodex-terminal .gt-ai-form{display:grid;gap:6px}
#gcodex-terminal .gt-ai-form textarea{width:100%;box-sizing:border-box;min-height:72px;font-size:16px;resize:vertical;background:#091a2c;color:#fff;border:1px solid #3c5675;border-radius:8px;padding:9px}
#gcodex-terminal .gt-voice-controls{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
#gcodex-terminal .gt-voice-controls label{font-size:11px}
#gcodex-terminal .gt-voice-controls select{background:#10263d;color:#fff;border-radius:7px;padding:6px}
#gcodex-terminal .gt-voice-transcript{border:1px solid #35576b;border-radius:8px;padding:11px;min-height:85px;max-height:30vh;overflow:auto;white-space:pre-wrap;color:#d8f4e4;font-weight:400;line-height:1.5}
#gcodex-terminal .gt-voice-actions{display:flex;gap:6px;margin-top:7px}
#gcodex-terminal .gt-voice-actions button{flex:1;padding:7px 5px}
#gcodex-terminal #gt-voice-status{font-size:11px;color:#9ac4de;font-weight:400;margin:4px 0}
@media(max-width:650px){#gcodex-terminal .gt-ai-pane{padding:8px;gap:6px}#gcodex-terminal .gt-ai-mode button{padding:6px}#gcodex-terminal .gt-voice-controls button{padding:6px 8px}}

/* V21 compact viewport adjustments */
@media(max-width:600px){#gcodex-terminal .gt-header{padding:8px 10px}#gcodex-terminal .gt-toolbar button,#gcodex-terminal .gt-keys button{padding:5px 7px;min-width:34px;min-height:34px}#gcodex-terminal .gt-nav button{padding:8px 10px}#gcodex-terminal .gt-ai-pane{padding:12px}#gcodex-terminal .gt-ai-mode{gap:6px}#gcodex-terminal .gt-voice-controls{display:flex;flex-wrap:wrap;gap:8px}#gcodex-terminal .gt-voice-controls select{max-width:180px}}

/* Board AI · Voice · SmartThings mobile controls */
#gcodex-terminal .gt-ai-header strong{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
#gcodex-terminal .gt-ai-header{flex-wrap:wrap;align-items:start;gap:7px}
#gcodex-terminal .gt-ai-badge{border:1px solid #38667f;border-radius:8px;padding:5px 8px;background:#10243c;color:#7ce3cb;max-width:100%;overflow-wrap:anywhere}
#gcodex-terminal .gt-model-label{display:flex;flex-direction:column;gap:5px;color:#d6e9ff;font-size:13px}
#gcodex-terminal .gt-model-label select{min-height:40px;border:1px solid #345a7c;border-radius:8px;background:#0d1d31;color:#fff;font-size:13px;padding:8px;width:100%}
#gcodex-terminal .gt-ai-mode button{min-width:0;white-space:normal;line-height:1.3}
#gcodex-terminal .gt-ai-space{flex:1 1 auto;min-height:120px;white-space:pre-wrap;overflow-y:auto;overflow-wrap:anywhere}
#gcodex-terminal .gt-ai-form .gt-toolbar{display:flex;gap:7px;flex-wrap:wrap;overflow:visible}
#gcodex-terminal .gt-voice-controls button{min-height:45px;flex:1}
#gcodex-terminal #gt-voice-player{display:block;width:100%;min-height:46px;margin:10px 0;color-scheme:dark}
#gcodex-terminal .gt-voice-transcript{display:block;width:100%;font-size:16px;min-height:110px;resize:vertical;border:1px solid #345a7c;background:#061525;color:#fff;box-sizing:border-box}
#gcodex-terminal .gt-voice-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:0 0 auto}
#gcodex-terminal .gt-voice-actions button{min-width:0;white-space:normal;font-size:12px;padding:9px 5px}
#gcodex-terminal .gt-smart-link{margin:6px 10px;border:1px solid #355b79;background:#0d1f32;color:#a7f3d0;border-radius:9px;padding:9px 13px;font-size:13px;flex:0 0 auto}
#gcodex-terminal .gt-smart-device{display:flex;gap:8px;align-items:center;flex-wrap:wrap;border:1px solid #2b4261;border-radius:10px;padding:10px;margin:8px 0}
#gcodex-terminal .gt-smart-device strong{flex:1 1 100px}
#gcodex-terminal .gt-smart-device button{min-height:38px}
#gcodex-terminal .gt-ai-pane{padding-bottom:max(20px,env(safe-area-inset-bottom))}
@media(max-width:650px){#gcodex-terminal .gt-ai-pane{padding:10px;gap:9px}#gcodex-terminal .gt-ai-space{min-height:110px}#gcodex-terminal .gt-ai-form textarea{min-height:100px}} 

/* Compact terminal assistant, readable Markdown, settings tucked away. */
#gcodex-terminal .gt-ai-pane{padding:8px;gap:7px}
#gcodex-terminal .gt-ai-header{flex:0 0 auto;min-height:31px}
#gcodex-terminal .gt-ai-header strong{font-size:13px}
#gcodex-terminal .gt-ai-settings{position:relative;margin-left:auto}
#gcodex-terminal .gt-ai-settings summary{cursor:pointer;list-style:none;display:grid;place-items:center;width:32px;height:32px;border:1px solid #305379;border-radius:7px;background:#142a41}
#gcodex-terminal .gt-ai-settings summary::-webkit-details-marker{display:none}
#gcodex-terminal .gt-ai-settings-content{position:absolute;z-index:100;top:36px;right:0;width:min(285px,83vw);display:grid;gap:8px;border:1px solid #42617d;border-radius:10px;padding:12px;background:#14233a;box-shadow:0 15px 30px #0009}
#gcodex-terminal .gt-ai-settings-content label{font-size:12px}
#gcodex-terminal .gt-ai-settings-content select{padding:9px;background:#0c1b30;color:#fff;border-radius:7px}
#gcodex-terminal .gt-ai-settings-content p{font-size:11px;margin:0}
#gcodex-terminal .gt-ai-space{flex:1 1 auto;min-height:50px;overflow-y:auto;font-size:13px;line-height:1.55}
#gcodex-terminal .gt-ai-space p{line-height:1.5;margin:0 0 6px}
#gcodex-terminal .gt-ai-mode{flex:0 0 auto}
#gcodex-terminal .gt-ai-form textarea{min-height:58px;max-height:130px}
#gcodex-terminal .gt-ai-form label{font-size:11px;color:#a6c0d7}
#gcodex-terminal .gt-ai-pane .gt-toolbar button{padding:7px!important}
#gcodex-terminal .gc-terminal-markdown{margin:7px 0;padding:8px 10px;border:1px solid #2e4665;border-radius:9px;background:#0f1c32}
#gcodex-terminal .gc-terminal-markdown>strong{color:#7dbcd4;font-size:11px}
#gcodex-terminal .gc-terminal-markdown>button{padding:4px 8px;font-size:11px;background:#203650}
#gcodex-terminal .gc-markdown{font-size:13px}
#gcodex-terminal #gt-voice-player{width:100%;height:43px;margin:4px 0}
#gcodex-terminal .gt-voice-transcript{min-height:60px}

/* Compact mobile workspace: SmartThings in the header; more room for terminal/AI. */
#gcodex-terminal .gt-header{gap:7px;padding:7px 10px;min-height:46px}
#gcodex-terminal .gt-header>div:first-child{min-width:0;flex:1}
#gcodex-terminal .gt-header strong{font-size:14px}
#gcodex-terminal .gt-header small{font-size:10px;line-height:1.3;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#gcodex-terminal .gt-header-actions{gap:5px;flex-shrink:0}
#gcodex-terminal .gt-header-actions button{padding:6px 9px;min-width:35px;min-height:35px;font-size:17px}
#gcodex-terminal .gt-header-actions .gt-header-smart{color:#92e5cc;border-color:#276c74}
#gcodex-terminal .gt-nav{padding:4px 7px;min-height:38px;gap:5px}
#gcodex-terminal .gt-nav button{padding:7px 9px!important}
#gcodex-terminal .gt-feedback{font-size:11px;padding:4px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#gcodex-terminal .gt-ai-pane{padding:6px 9px;gap:5px}
#gcodex-terminal .gt-ai-header{min-height:29px}
#gcodex-terminal .gt-ai-mode{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 43px;gap:5px;padding:3px;margin:0}
#gcodex-terminal .gt-ai-mode>button{min-width:0;padding:6px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;min-height:35px}
#gcodex-terminal .gt-ai-mode .gt-ai-settings{display:block;position:relative;min-width:0;margin:0}
#gcodex-terminal .gt-ai-mode .gt-ai-settings summary{width:100%;height:35px;padding:0;font-size:17px}
#gcodex-terminal .gt-ai-settings-content{right:0;top:39px;width:min(285px,88vw)}
#gcodex-terminal .gt-ai-space{flex:1 1 auto;min-height:150px;max-width:100%;padding:4px;line-height:1.42;font-size:13px;white-space:normal}
#gcodex-terminal .gt-ai-space .gc-terminal-markdown{padding:7px 9px;margin:5px 0;overflow-wrap:anywhere;word-break:normal;white-space:normal}
#gcodex-terminal .gt-ai-space .gc-terminal-markdown pre{white-space:pre;overflow-x:auto;max-width:100%;font-size:12px}
#gcodex-terminal .gt-ai-space .gc-terminal-markdown code{overflow-wrap:normal}
#gcodex-terminal .gt-ai-space p{margin:0 0 5px;line-height:1.45}
#gcodex-terminal #gt-ai-text-wrap{flex:0 0 auto}
#gcodex-terminal #gt-ai-input{min-height:45px!important;height:58px;max-height:105px;padding:7px 9px;font-size:14px;resize:vertical}
#gcodex-terminal .gt-ai-form{gap:3px}
#gcodex-terminal .gt-ai-form .gt-toolbar button{padding:6px 9px!important}
#gcodex-terminal #gt-voice-status{font-size:10px;margin:2px 0}
#gcodex-terminal .gt-terminal-pane{padding:5px;gap:4px}
#gcodex-terminal #gt-screen{flex:1;min-height:180px}
@media(max-width:650px){#gcodex-terminal .gt-header-actions .gt-header-disconnect span{display:none}#gcodex-terminal .gt-header-actions .gt-header-disconnect{font-size:19px}}
