#terminalhubApp .windowScreen,
#terminalhubApp .restWindow { min-height: 0 !important; overflow: hidden !important; }
#terminalhubApp .terminalHubNativeHost { width: 100%; height: 100%; min-height: 0; background: #080b10; color: #d9e4f2; }
#terminalhubApp[data-size="cstm"] { width: min(1180px, calc(100vw - 72px)) !important; height: min(760px, calc(100vh - 96px)) !important; min-width: 720px !important; min-height: 480px !important; }

.th-shell, .th-shell * { box-sizing: border-box; }
.th-shell { --th-accent:#48a9ff; --th-panel:#11151c; --th-panel2:#151a22; --th-line:#29313d; --th-muted:#8f9bab; position:relative; display:flex; flex-direction:column; width:100%; height:100%; min-height:0; overflow:hidden; color:#d9e4f2; background:linear-gradient(180deg,#11151c,#080b10 58%); font-family:"Segoe UI Variable","Segoe UI",system-ui,sans-serif; }
.th-shell[data-profile="linux"] { --th-accent:#75d16b; }
.th-shell[data-profile="retro"] { --th-accent:#54f083; }
.th-shell[data-profile="git"] { --th-accent:#f05033; }
.th-shell[data-profile="python"] { --th-accent:#ffd343; }
.th-shell[data-profile="kubernetes"] { --th-accent:#65a1ff; }
.th-shell[data-profile="cloudflare"] { --th-accent:#f48120; }

.th-commandbar { min-height:48px; display:flex; align-items:center; gap:4px; padding:6px 9px; background:linear-gradient(180deg,#1a1f28,#141922); border-bottom:1px solid #2a313c; overflow-x:auto; scrollbar-width:none; }
.th-commandbar::-webkit-scrollbar { display:none; }
.th-profile-select-wrap { display:flex; align-items:center; gap:8px; min-width:142px; height:34px; padding:0 8px; border:1px solid #343d4a; border-radius:6px; background:#202630; }
.th-profile-badge,.th-mini-badge { --profile-accent:var(--th-accent); display:grid; place-items:center; min-width:22px; height:22px; padding:0 4px; border-radius:5px; background:color-mix(in srgb,var(--profile-accent) 22%,#10141a); color:var(--profile-accent); font-size:11px; font-weight:800; font-style:normal; }
.th-profile-select { width:100%; border:0; outline:0; color:#eef5ff; background:transparent; font:600 12px/1 "Segoe UI",sans-serif; cursor:pointer; }
.th-profile-select option { background:#202630; color:#fff; }
.th-separator { width:1px; align-self:stretch; margin:4px 5px; background:#303846; }
.th-btn,.th-connection-button,.th-tab-add { display:inline-flex; align-items:center; justify-content:center; gap:7px; height:34px; padding:0 10px; color:#dce6f3; border:1px solid transparent; border-radius:6px; background:transparent; font:600 12px/1 "Segoe UI",sans-serif; white-space:nowrap; cursor:pointer; }
.th-btn:hover,.th-connection-button:hover,.th-tab-add:hover { border-color:#343e4b; background:#252c37; }
.th-btn:active,.th-connection-button:active,.th-tab-add:active { transform:translateY(1px); background:#1c222b; }
.th-btn span { color:#a9bad0; font-size:17px; }
.th-spacer { flex:1 1 auto; }
.th-connection-button { min-width:105px; border-color:#303846; background:#1d232c; }
.th-status-dot { display:inline-block; width:8px; height:8px; border-radius:999px; background:#6d7684; box-shadow:0 0 0 2px rgba(255,255,255,.04); }
.th-status-dot[data-state="connected"] { background:#4cd17b; box-shadow:0 0 8px rgba(76,209,123,.55); }
.th-status-dot[data-state="configured"] { background:#49a6ff; box-shadow:0 0 8px rgba(73,166,255,.48); }
.th-status-dot[data-state="connecting"] { background:#ffd166; animation:thPulse 1s infinite; }
.th-status-dot[data-state="demo"] { background:#e9a548; }
.th-status-dot[data-state="error"] { background:#ff6577; }
@keyframes thPulse { 50% { opacity:.35; } }

.th-tabs-row { display:flex; align-items:stretch; min-height:38px; background:#0f141b; border-bottom:1px solid #28303a; }
.th-tabs { flex:1; display:flex; min-width:0; overflow-x:auto; scrollbar-width:thin; }
.th-tab { position:relative; display:flex; align-items:center; gap:7px; min-width:142px; max-width:220px; height:38px; padding:0 8px 0 10px; color:#9ca9b8; border:0; border-right:1px solid #252d38; border-bottom:2px solid transparent; background:#121821; font:500 12px/1 "Segoe UI",sans-serif; cursor:pointer; }
.th-tab:hover { color:#e5edf7; background:#19202a; }
.th-tab[aria-selected="true"] { color:#fff; background:#202731; border-bottom-color:var(--th-accent); }
.th-tab>span:nth-of-type(2) { flex:1; overflow:hidden; text-overflow:ellipsis; text-align:left; white-space:nowrap; }
.th-tab>b { display:grid; place-items:center; width:20px; height:20px; border-radius:4px; font-size:15px; font-weight:400; opacity:.7; }
.th-tab>b:hover { background:#3a414d; opacity:1; }
.th-tab-add { width:40px; height:38px; padding:0; border-radius:0; border-left:1px solid #27303b; }

.th-workspace { flex:1 1 auto; min-height:0; overflow:hidden; background:#080b10; }
.th-pane-grid { display:grid; grid-template-columns:minmax(0,1fr); width:100%; height:100%; min-height:0; }
.th-pane-grid[data-split="true"] { grid-template-columns:minmax(0,1fr) 5px minmax(0,1fr); }
.th-pane { display:flex; flex-direction:column; min-width:0; min-height:0; background:#080b10; outline:1px solid transparent; outline-offset:-1px; }
.th-pane[data-active="true"] { outline-color:color-mix(in srgb,var(--th-accent) 38%,transparent); }
.th-pane>header { display:flex; align-items:center; gap:7px; min-height:28px; padding:3px 9px; border-bottom:1px solid #202631; background:#0d1218; color:#aab6c5; font-size:11px; }
.th-pane>header strong { color:#dce5f0; font-size:11px; }
.th-pane>header small { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#768395; }
.th-terminal { flex:1; min-height:0; padding:8px 9px 5px; overflow:hidden; background:#080b10; }
.th-terminal .xterm { height:100%; }
.th-terminal .xterm-viewport { scrollbar-color:#3c4655 #080b10; scrollbar-width:thin; }
.th-split-divider { cursor:col-resize; background:linear-gradient(90deg,#181e27,#3b4656,#181e27); }

.th-statusbar { min-height:26px; display:flex; align-items:center; gap:10px; padding:0 10px; border-top:1px solid #28303a; background:#131923; color:#8f9bab; font-size:11px; white-space:nowrap; overflow:hidden; }
.th-statusbar>span { display:flex; align-items:center; gap:5px; }
.th-status-profile { color:var(--th-accent) !important; font-weight:700; }
.th-status-cwd { max-width:36%; overflow:hidden; text-overflow:ellipsis; }

.th-overlay { position:absolute; z-index:30; inset:0; background:rgba(2,5,9,.38); backdrop-filter:blur(2px); }
.th-overlay[hidden] { display:none !important; }
.th-overlay[data-overlay="search"] { inset:86px 12px auto auto; width:auto; height:auto; background:transparent; backdrop-filter:none; }
.th-search-box { display:flex; align-items:center; width:min(430px,calc(100vw - 80px)); height:38px; padding:3px; border:1px solid #4d5969; border-radius:7px; background:#252c36; box-shadow:0 12px 30px rgba(0,0,0,.45); }
.th-search-box input { flex:1; min-width:0; height:100%; padding:0 9px; border:0; outline:0; background:transparent; color:#fff; }
.th-search-box button { width:31px; height:30px; border:0; border-radius:4px; background:transparent; color:#c8d3e0; cursor:pointer; }
.th-search-box button:hover { background:#3a424e; }
.th-center-overlay { display:grid; place-items:start center; padding-top:10%; }
.th-palette,.th-settings { width:min(620px,calc(100% - 34px)); overflow:hidden; border:1px solid #4a5564; border-radius:10px; background:#202630; box-shadow:0 28px 80px rgba(0,0,0,.58); }
.th-palette>input { width:100%; height:48px; padding:0 16px; border:0; border-bottom:1px solid #39424e; outline:0; background:#252c36; color:#fff; font:14px "Segoe UI",sans-serif; }
.th-palette-list { max-height:min(420px,55vh); padding:6px; overflow:auto; }
.th-palette-list button { display:flex; align-items:center; width:100%; height:42px; padding:0 10px; color:#dce6f3; border:0; border-radius:6px; background:transparent; text-align:left; cursor:pointer; }
.th-palette-list button:hover,.th-palette-list button[data-first] { background:#303845; }
.th-palette-list button span { flex:1; }
kbd { padding:2px 6px; border:1px solid #4b5665; border-radius:4px; background:#171c24; color:#9eabba; font:10px "Segoe UI",sans-serif; }
.th-side-overlay { display:flex; justify-content:flex-end; }
.th-side-panel { width:min(390px,92%); height:100%; display:flex; flex-direction:column; border-left:1px solid #495463; background:#1c222c; box-shadow:-18px 0 55px rgba(0,0,0,.4); }
.th-side-panel header,.th-settings header { display:flex; align-items:center; gap:9px; min-height:52px; padding:8px 13px; border-bottom:1px solid #343d49; }
.th-side-panel header strong,.th-settings header>div { flex:1; }
.th-side-panel button,.th-settings button { border:1px solid #414b59; border-radius:6px; background:#282f3a; color:#dbe5f1; cursor:pointer; }
.th-side-panel header button,.th-settings header button { height:30px; padding:0 9px; }
.th-side-panel>input { margin:10px; height:36px; padding:0 10px; border:1px solid #414b58; border-radius:6px; outline:0; background:#11161e; color:#fff; }
.th-history-list { flex:1; padding:0 8px 10px; overflow:auto; }
.th-history-list>button { display:flex; align-items:flex-start; gap:10px; width:100%; padding:10px; margin:2px 0; border:0; background:transparent; text-align:left; }
.th-history-list>button:hover { background:#2b333f; }
.th-history-list>button>span:last-child { min-width:0; }
.th-history-list strong { display:block; overflow:hidden; color:#eef4fb; text-overflow:ellipsis; white-space:nowrap; }
.th-history-list small { display:block; margin-top:4px; color:#8d99a9; }

.th-settings { padding-bottom:12px; }
.th-settings header strong,.th-settings header small { display:block; }
.th-settings header small { margin-top:3px; color:#8f9baa; font-size:11px; }
.th-settings>label { display:block; margin:14px 16px; color:#cbd5e1; font-size:12px; font-weight:600; }
.th-settings>label input { display:block; width:100%; height:38px; margin-top:7px; padding:0 10px; border:1px solid #414b58; border-radius:6px; outline:0; background:#11161e; color:#fff; font-weight:400; }
.th-settings>label input:focus { border-color:var(--th-accent); }
.th-security-note { display:flex; gap:10px; margin:14px 16px; padding:12px; border:1px solid #3b4654; border-radius:8px; background:#171d25; color:#aeb9c7; font-size:11px; line-height:1.5; }
.th-security-note b { color:#7ec3ff; white-space:nowrap; }
.th-settings>footer { display:flex; justify-content:flex-end; gap:8px; padding:0 16px; }
.th-settings>footer button { min-height:34px; padding:0 13px; }
.th-settings>footer button.primary { border-color:#1976d2; background:#1268b8; color:#fff; }
.th-toast { position:absolute; z-index:60; left:50%; bottom:38px; transform:translateX(-50%); max-width:min(620px,calc(100% - 30px)); padding:9px 13px; border:1px solid #4a5665; border-radius:7px; background:#252c36; box-shadow:0 12px 35px rgba(0,0,0,.48); color:#eef5ff; font-size:12px; }

@media (max-width: 760px) {
  #terminalhubApp, #terminalhubApp[data-size="cstm"] { inset:0 !important; width:100vw !important; height:calc(100vh - 45px) !important; min-width:0 !important; min-height:0 !important; border-radius:0 !important; }
  .th-commandbar { min-height:45px; padding:5px; }
  .th-profile-select-wrap { min-width:122px; }
  .th-btn { width:36px; padding:0; }
  .th-btn b { display:none; }
  .th-connection-button { min-width:40px; width:40px; padding:0; }
  .th-connection-button span,.th-connection-button b { display:none; }
  .th-tab { min-width:125px; }
  .th-pane-grid[data-split="true"] { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) 5px minmax(0,1fr); }
  .th-split-divider { cursor:row-resize; background:linear-gradient(#181e27,#3b4656,#181e27); }
  .th-pane>header small,.th-status-engine { display:none; }
  .th-status-cwd { max-width:50%; }
  .th-terminal { padding:6px 5px 3px; }
  .th-center-overlay { padding-top:20%; }
  .th-security-note { flex-direction:column; }
}
