body:has(.terminal-window)>.skip-link{display:none}
main.terminal-window{height:100vh;height:100dvh;max-width:none;margin:0;padding:0;overflow:hidden;background:#17151e}
#web-terminal-host,.web-terminal{height:100%;min-width:0}
.web-terminal{position:relative;display:flex;flex-direction:column}
.terminal-toolbar{display:grid;align-items:center;grid-template-columns:minmax(0,1fr) minmax(0,clamp(105px,29vw,320px)) auto;gap:8px;padding:4px 8px;background:white}
.terminal-toolbar h1{margin:0;font-size:14px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.terminal-toolbar h1 .detail-trigger{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.terminal-toolbar select{min-width:0;min-height:30px;padding:3px 8px;font-size:12px}
.terminal-layout-controls{display:flex;gap:3px}
.terminal-layout-controls button{display:grid;place-items:center;width:30px;height:30px;padding:4px;border:1px solid var(--border);border-radius:5px;background:white;color:var(--muted)}
.terminal-layout-controls button:hover{background:#f4eff8;color:var(--purple)}
.terminal-layout-controls button[aria-pressed=true]{background:var(--purple);border-color:var(--purple);color:white}
.terminal-layout-controls svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.5}
.terminal-grid{flex:1;min-height:0;display:grid;gap:1px;background:#8c8199;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.terminal-grid[data-cols="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
.terminal-grid[data-cols="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}
.terminal-grid[data-rows="2"]{grid-template-rows:repeat(2,minmax(0,1fr))}
.terminal-quadrant{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#17151e}
.terminal-quadrant[hidden]{display:none}
.terminal-quadrant[data-drop-target]::after{content:"";position:absolute;inset:0;z-index:5;border:2px solid #c8b8ed;background:#c8b8ed14;pointer-events:none}
.terminal-tabs{display:flex;align-items:end;min-height:27px;gap:3px;background:#f7f4fa;padding:3px 4px 0}
.terminal-tablist{display:flex;align-items:end;min-width:0;overflow-x:auto;gap:3px;scrollbar-width:thin}
.terminal-tablist:empty{display:none}
.terminal-tab-item{display:flex;border:1px solid var(--border);border-bottom:0;border-radius:5px 5px 0 0;background:#eee8f4;flex:none}
.terminal-tab-item:has([aria-selected=true]){background:#17151e;border-color:#17151e}
.terminal-tab-item button,.terminal-add{min-height:23px;background:transparent;border:0;padding:2px 8px;color:#594c6a;font:600 12px system-ui}
.terminal-tab-item [role=tab]{cursor:grab}
.terminal-tab-item [aria-selected=true],.terminal-tab-item:has([aria-selected=true]) .terminal-close{color:#f4f1fa}
.terminal-tab-item .terminal-close{font-size:16px}.terminal-tab-item .terminal-close:hover{color:#dc7777}
.terminal-add{flex:none;border-radius:4px;font-size:16px;line-height:1}
.terminal-add:hover:not(:disabled){background:#eee8f4;color:var(--purple)}
.terminal-add:disabled{opacity:.45;cursor:default}
.terminal-tab-item button:focus-visible,.terminal-add:focus-visible{outline:2px solid currentColor;outline-offset:-2px}
.terminal-screen{position:relative;flex:1;min-height:0;color:#f4f1fa}
.terminal-panes,.terminal-pane{height:100%;min-width:0}
.terminal-pane{padding:3px 4px;overflow:hidden}
.terminal-pane[hidden]{display:none}.terminal-pane .xterm{height:100%}
.terminal-state{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.terminal-message{position:absolute;z-index:6;bottom:8px;left:8px;right:8px;margin:0;padding:6px 10px;border-radius:5px;background:#3d2937;color:white;font-size:12px;pointer-events:none}
.terminal-empty{position:absolute;inset:24px 12px auto;margin:0;text-align:center;color:#f4f1fa;font-size:13px}
@media(max-width:520px){
 .terminal-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,45%);gap:4px 8px}
 .terminal-layout-controls{grid-column:1/-1}
}

.terminal-tab-player{background:#494949;border-color:#494949}
.terminal-tab-player button{color:#f5f5f5}
.terminal-tab-player:has([aria-selected=true]){background:#303030;border-color:#303030}
.terminal-pane-player{background:#303030}
.terminal-tab-item [role=tab]{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.terminal-device-dialog{max-width:560px;width:calc(100% - 32px)}
.terminal-device-dialog label{display:grid;gap:6px;margin-bottom:14px}
