.cx { display:grid; grid-template-columns: minmax(220px,260px) minmax(0,1fr) minmax(190px,230px); height:100%; min-height:0; color:var(--text); background:var(--glass-strong); }
.cx [hidden] { display:none !important; }
.cx button { cursor:pointer; font:inherit; }
.cx button:disabled { cursor:default; opacity:.45; }
.cx button:focus-visible,.cx input:focus-visible,.cx textarea:focus-visible,.cx select:focus-visible { outline:none; box-shadow:0 0 0 3px var(--accent-soft); border-color:var(--accent-border); }
.cx button:hover:not(:disabled) { filter:brightness(1.08); }
.cx-side,.cx-agents { min-height:0; display:flex; flex-direction:column; background:var(--glass); border-right:1px solid var(--glass-border); }
.cx-agents { border-left:1px solid var(--glass-border); border-right:0; }
.cx-side-head,.cx-agent-head,.cx-head { min-height:60px; padding:12px 15px; display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--glass-border); }
.cx-side-head strong { font-size:1.2rem; letter-spacing:-.02em; }
.cx-side-head button { width:34px; height:34px; display:grid; place-items:center; border:0; border-radius:var(--radius-sm); color:var(--text); background:var(--gradient); }
.cx svg { width:18px; height:18px; }
.cx-search-row { display:flex; margin:12px 12px 7px; background:var(--surface-input); border:1px solid var(--glass-border); border-radius:var(--radius-sm); }
.cx-search { width:100%; min-width:0; padding:9px 10px; border:0; background:transparent; color:var(--text); font:inherit; }
.cx-clear { width:34px; flex:none; border:0; background:transparent; color:var(--text-dim); }
.cx-clear svg { width:14px; height:14px; }
.cx-filters { display:flex; gap:3px; padding:0 10px 8px; }
.cx-filters button { padding:5px 7px; border:0; border-radius:var(--radius-xs); background:transparent; color:var(--text-dim); font-size:.75rem; }
.cx-filters button.active { background:var(--accent-soft); color:var(--text); }
.cx-list { min-height:100px; flex:1; overflow:auto; padding:3px 8px; scrollbar-gutter:stable; }
.cx-thread,.cx-run { display:flex; flex-direction:column; gap:3px; width:100%; margin:0 0 4px; padding:10px; text-align:left; border:1px solid transparent; border-radius:var(--radius-sm); background:transparent; color:var(--text); }
.cx-thread:hover,.cx-run:hover { background:var(--accent-soft); }
.cx-thread.active { border-color:var(--accent-border); background:var(--accent-soft); }
.cx-thread strong,.cx-run strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.84rem; font-weight:600; }
.cx-thread span,.cx-run span { font-size:.74rem; color:var(--text-dim); }
.cx-thread small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:var(--mono); color:var(--text-faint); }
.cx-more { margin:6px 12px; }
.cx-kanban { max-height:28%; min-height:95px; overflow:auto; border-top:1px solid var(--glass-border); }
.cx-section-title { padding:10px 13px 4px; color:var(--text-dim); font-size:.74rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.cx-run { padding:7px 12px; }
.cx-main { min-width:0; min-height:0; display:flex; flex-direction:column; }
.cx-head { flex:none; }
.cx-head-info { min-width:0; flex:1; }
.cx-title { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.96rem; }
.cx-meta { max-width:36vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-dim); font-size:.74rem; font-family:var(--mono); }
.cx-chat-settings { display:flex; flex-wrap:wrap; gap:2px 12px; margin-top:3px; color:var(--text-dim); font-size:.74rem; }
.cx-chat-settings span { min-width:0; overflow-wrap:anywhere; }
.cx-chat-settings strong { color:var(--text); font-family:var(--mono); font-weight:600; }
.cx-head-actions { display:flex; flex:none; gap:6px; }
.cx-head-actions button { display:flex; align-items:center; gap:5px; white-space:nowrap; }
.cx-mode-label { display:flex; align-items:center; gap:6px; color:var(--text-dim); font-size:.75rem; }
.cx-mode { min-height:34px; padding:5px 8px; border:1px solid var(--glass-border); border-radius:var(--radius-sm); background:var(--surface-input); color:var(--text); font:inherit; }
.cx-banner { min-height:22px; padding:2px 17px; color:var(--text-dim); font-size:.78rem; }
.cx-banner.error { color:var(--danger); }
.cx-scroll { min-height:0; flex:1; overflow:auto; scrollbar-gutter:stable; }
.cx-scroll:focus-visible { outline:none; box-shadow:inset 0 0 0 2px var(--accent-border); }
.cx-scroll,.cx-list,.cx-kanban,.cx-agent-list,.cx-approval pre { scrollbar-width:thin; scrollbar-color:var(--text-faint) transparent; }
.cx-scroll::-webkit-scrollbar,.cx-list::-webkit-scrollbar,.cx-kanban::-webkit-scrollbar,.cx-agent-list::-webkit-scrollbar,.cx-approval pre::-webkit-scrollbar { width:10px; height:10px; }
.cx-scroll::-webkit-scrollbar-track,.cx-list::-webkit-scrollbar-track,.cx-kanban::-webkit-scrollbar-track,.cx-agent-list::-webkit-scrollbar-track,.cx-approval pre::-webkit-scrollbar-track { background:transparent; }
.cx-scroll::-webkit-scrollbar-thumb,.cx-list::-webkit-scrollbar-thumb,.cx-kanban::-webkit-scrollbar-thumb,.cx-agent-list::-webkit-scrollbar-thumb,.cx-approval pre::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:var(--radius-lg); background:var(--text-faint); background-clip:padding-box; }
.cx-scroll::-webkit-scrollbar-thumb:hover,.cx-list::-webkit-scrollbar-thumb:hover,.cx-kanban::-webkit-scrollbar-thumb:hover,.cx-agent-list::-webkit-scrollbar-thumb:hover,.cx-approval pre::-webkit-scrollbar-thumb:hover { background:var(--accent-border); background-clip:padding-box; }
.cx-older { display:block; margin:12px auto 0; }
.cx-items { width:100%; padding:18px 22px 35px; display:flex; flex-direction:column; gap:14px; }
.cx-empty { margin:auto; padding:60px 20px; text-align:center; }
.cx-empty h2 { margin:0 0 10px; font-size:1.45rem; letter-spacing:-.02em; }
.cx-empty p,.cx-empty-small { color:var(--text-dim); font-size:.84rem; line-height:1.5; }
.cx-empty-small { padding:12px; }
.cx-item { padding:14px 17px; border:1px solid var(--glass-border); border-radius:var(--radius-md); background:var(--glass); box-shadow:inset 0 1px 0 var(--glass-border); }
.cx-item.cx-user { width:100%; background:var(--accent-soft); border-color:var(--accent-border); }
.cx-item.cx-agent { width:100%; }
.cx-item.cx-step { width:100%; border-left:3px solid var(--glass-border); }
.cx-item.cx-command-failed { border-color:color-mix(in srgb, var(--danger) 45%, var(--glass-border)); }
.cx-command-indicator { display:inline-block; width:9px; height:9px; margin-right:7px; border:2px solid var(--accent-soft); border-top-color:var(--accent); border-radius:50%; vertical-align:-1px; animation:cx-command-spin .9s linear infinite; }
@keyframes cx-command-spin { to { transform:rotate(360deg); } }
.cx-item-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; margin-bottom:7px; }
.cx-item-head strong { min-width:0; font-size:.76rem; color:var(--text-dim); }
.cx-item-meta { display:flex; align-items:center; gap:9px; margin-left:auto; color:var(--text-faint); font-size:.7rem; white-space:nowrap; }
.cx-item-token { color:var(--text-dim); }
.cx-item pre,.cx-approval pre,.cx-run-log { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-family:var(--font); line-height:1.52; font-size:.85rem; }
.cx-markdown { line-height:1.52; font-size:.85rem; }
.cx-markdown .ch-code pre { white-space:pre; overflow-x:auto; overflow-wrap:normal; font-family:var(--mono); }
.cx-step pre,.cx-run-log,.cx-approval pre { font-family:var(--mono); font-size:.77rem; }
.cx-command-preview { max-height:calc(4 * 1.52em); overflow:hidden; }
.cx-command-preview.expanded { max-height:none; overflow:visible; }
.cx-command-toggle { margin-top:9px; padding:5px 9px; font-size:.76rem !important; }
.cx-thinking { align-self:flex-start; display:flex; align-items:center; gap:5px; margin:0 0 0 4px; color:var(--text-dim); font-size:.78rem; }
.cx-thinking-dot { width:5px; height:5px; border-radius:50%; background:var(--accent); animation:cx-thinking-pulse 1.2s ease-in-out infinite; }
.cx-thinking-dot:nth-child(3) { animation-delay:.15s; }
.cx-thinking-dot:nth-child(4) { animation-delay:.3s; }
@keyframes cx-thinking-pulse { 0%,70%,100% { opacity:.35; transform:translateY(0); } 35% { opacity:1; transform:translateY(-3px); } }
.cx-approval { border:1px solid var(--warning); border-radius:var(--radius-md); padding:14px 17px; background:var(--glass); }
.cx-approval strong { color:var(--warning); }
.cx-approval pre { margin:8px 0 12px; max-height:180px; overflow:auto; }
.cx-approval-actions { display:flex; gap:8px; flex-wrap:wrap; }
.cx-question { display:flex; flex-direction:column; gap:5px; margin:10px 0; font-size:.82rem; }
.cx-question input,.cx-question select { padding:9px; border:1px solid var(--glass-border); border-radius:var(--radius-sm); background:var(--surface-input); color:var(--text); font:inherit; }
.cx-compose { flex:none; padding:8px 17px 10px; border-top:1px solid var(--glass-border); }
.cx-compose > label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.cx-compose-row { display:flex; align-items:flex-end; gap:6px; padding:5px; border:1px solid var(--glass-border); border-radius:var(--radius-md); background:var(--surface-input); }
.cx-compose-row:focus-within { border-color:var(--accent-border); box-shadow:0 0 0 3px var(--accent-soft); }
.cx-input { width:100%; min-height:36px; max-height:150px; resize:none; border:0; padding:8px 7px 5px; outline:none; background:transparent; color:var(--text); font:inherit; font-size:.88rem; }
.cx-input:focus-visible { box-shadow:none; }
.cx-send { flex:none; width:38px; height:38px; display:grid; place-items:center; border:0; border-radius:var(--radius-sm); background:var(--gradient); color:var(--text); }
.cx-stop { display:grid; place-items:center; flex:none; width:38px; height:38px; color:var(--danger); }
.cx-agent-head span { color:var(--text-dim); font-size:.78rem; }
.cx-agent-list { min-height:0; overflow:auto; padding:10px; }
.cx-agent-card { display:flex; flex-direction:column; gap:8px; padding:12px; margin-bottom:8px; border:1px solid var(--glass-border); border-radius:var(--radius-sm); }
.cx-agent-card strong { font-size:.84rem; }
.cx-agent-card span { color:var(--text-dim); font-size:.76rem; }
.cx-agent-card button { align-self:flex-start; }
.cx-new-form { display:flex; flex-direction:column; gap:12px; width:100%; min-width:0; margin-bottom:18px; }
.cx-new-form label { display:flex; flex-direction:column; gap:5px; font-size:.84rem; }
.cx-new-form input,.cx-new-form select,.cx-new-form textarea { width:100%; padding:9px; border:1px solid var(--glass-border); border-radius:var(--radius-sm); background:var(--surface-input); color:var(--text); font:inherit; }
.cx-new-form textarea { resize:none; }
.cx-mobile-nav { display:none; }
/* Die Fensterfläche ist Eigentümer der responsiven App-Anordnung. */
.wm-body:has(> .cx) { container-type:inline-size; container-name:codex; padding:0; min-height:0; overflow:hidden; }
.cx-connection { flex:none; padding:4px 15px; font-size:.75rem; color:var(--text-dim); border-bottom:1px solid var(--glass-border); }
.cx-connection.error { color:var(--warning); }
.cx-details summary { min-height:26px; cursor:pointer; color:var(--text-dim); font-size:.75rem; }
.cx-details summary:focus-visible,.cx-approval:focus-visible { outline:none; box-shadow:inset 0 0 0 2px var(--accent-border); }
.cx-jumps { display:flex; justify-content:flex-end; flex:none; gap:8px; padding:0 12px; }
.cx-keyboard-hide { display:none; }
.cx-jumps:has(button:not([hidden])) { padding-top:5px; padding-bottom:5px; }
.cx-wait-count { display:inline-grid; min-width:20px; padding:2px 5px; border-radius:var(--radius-xs); color:var(--warning); background:var(--glass); }
.cx-draft-warning,.cx-option-help { color:var(--warning); font-size:.75rem; line-height:1.4; margin:5px 0 0; }
.cx-option-help { color:var(--text-dim); }
.cx-banner:empty { display:none; }
.cx-item,.cx-approval,.cx-agent-card { min-width:0; overflow-wrap:anywhere; }
.cx-markdown { overflow-wrap:anywhere; min-width:0; }
.cx-markdown .ch-code { min-width:0; max-width:100%; }
.cx-markdown table { display:block; max-width:100%; overflow-x:auto; }
.cx-new-form input:focus-visible,.cx-new-form select:focus-visible,.cx-new-form textarea:focus-visible { outline:none; border-color:var(--accent-border); box-shadow:0 0 0 3px var(--accent-soft); }
.cx-new-form [aria-invalid="true"] { border-color:var(--danger); }
.cx-dialog { top:var(--visual-top,0px); bottom:auto; height:var(--visual-height,100dvh); padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); box-sizing:border-box; }
.cx-dialog .dlg-card { width:min(480px,100%); max-height:100%; overflow:auto; text-align:left; background:var(--glass-strong); }
.cx-dialog .dlg-actions { flex-wrap:wrap; position:sticky; bottom:0; padding-top:8px; background:var(--glass-strong); }
.cx-dialog button,.cx-dialog input,.cx-dialog select { min-height:44px; }
.cx-dialog button { min-width:44px; }
.cx-dialog .cx-new-form input,.cx-dialog .cx-new-form select,.cx-dialog .cx-new-form textarea { font-size:16px; }
@container codex (max-width:1000px) {
  .cx { display:flex; flex-direction:column; }
  .cx-mobile-nav { display:flex; flex:none; padding:4px; gap:4px; border-bottom:1px solid var(--glass-border); }
  .cx-mobile-nav button { flex:1; min-height:44px; min-width:44px; border:0; border-radius:var(--radius-sm); background:transparent; color:var(--text-dim); }
  .cx-mobile-nav button.active { color:var(--text); background:var(--accent-soft); }
  .cx-side,.cx-main,.cx-agents { display:none; flex:1; min-height:0; border:0; }
  .cx[data-view="sessions"] .cx-side,.cx[data-view="work"] .cx-main,.cx[data-view="agents"] .cx-agents { display:flex; }
  .cx-head { min-height:0; padding:6px 12px; align-items:flex-start; }
  .cx-head-info { padding-top:4px; }
  .cx-head-actions { align-items:center; }
  .cx-meta { max-width:none; white-space:normal; overflow-wrap:anywhere; }
  .cx-chat-settings { flex-direction:column; }
  .cx-mode-label { gap:0; font-size:0; }
  .cx-mode { min-height:44px; font-size:16px; max-width:110px; }
  .cx-head-actions span,.cx-open { display:none !important; }
  .cx-kanban { max-height:35%; }
  .cx-items { padding:12px; gap:12px; }
  .cx-item,.cx-approval { padding:12px; }
  .cx button,.cx summary,.cx-question input,.cx-question select { min-height:44px; min-width:44px; }
  .cx-side-head button { width:44px; height:44px; }
  .cx-clear { width:44px; }
  .cx-filters button { flex:1; font-size:.85rem; }
  .cx-search,.cx-input,.cx-question input,.cx-question select { font-size:16px; }
  .cx-input { resize:none; line-height:1.45; min-height:44px; max-height:min(150px,calc(var(--visual-height,100dvh) * .25)); }
  .cx-search { min-height:44px; }
  .cx-markdown,.cx-item pre { font-size:.95rem; }
  .cx-step pre,.cx-run-log,.cx-approval pre { font-size:.8rem; }
  .cx-compose { padding:6px 10px 8px; }
  .cx-details summary { display:flex; align-items:center; }
  .cx-details summary::before { content:'▸'; margin-right:6px; }
  .cx-details[open] summary::before { content:'▾'; }
  .cx-tail,.cx-decision { font-size:.8rem; }
}
@media (max-width:700px), (pointer:coarse) and (max-width:1000px) {
  #desktop-view:not(.mobile-overview) .wm-window.cx-window { position:fixed; left:env(safe-area-inset-left) !important; top:calc(var(--visual-top,0px) + 36px + env(safe-area-inset-top)) !important; width:calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)) !important; height:calc(var(--visual-height,100dvh) - 114px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; min-width:0; min-height:0; }
  #desktop-view:not(.mobile-overview) .wm-window.cx-window[data-visual-keyboard="true"] { top:calc(var(--visual-top,0px) + env(safe-area-inset-top)) !important; height:calc(var(--visual-height,100dvh) - env(safe-area-inset-top)) !important; }
  #desktop-view:not(.mobile-overview) .wm-window.cx-window[data-visual-keyboard="true"]:focus-within { z-index:10001 !important; }
  .cx-window .wm-titlebar { padding:0 4px 0 12px; min-height:44px; cursor:default; }
  .cx-window .wm-btn { min-width:44px; min-height:44px; }
  .cx-window .wm-btn-max,.cx-window .wm-btn-tile,.cx-window .wm-resize { display:none !important; }
  .cx-window[data-visual-keyboard="true"] .cx-details { display:none; }
  .cx-window[data-visual-keyboard="true"] .cx-head { padding:4px 12px; }
  .cx-window[data-visual-keyboard="true"] .cx-head-info { padding-top:0; }
  .cx-window[data-visual-keyboard="true"] .cx-head-actions,.cx-window[data-visual-keyboard="true"] .cx-jumps { display:none; }
  .cx-window[data-visual-keyboard="true"] .cx-keyboard-hide { display:grid; place-items:center; flex:none; }
}
@media (prefers-reduced-motion:reduce) { .cx * { scroll-behavior:auto !important; transition:none !important; animation:none !important; } }
