/* The workspace is scoped so the previous UI remains available during rollout. */
body:has(.ws-app) { visibility: visible !important; opacity: 1 !important; height: min(100dvh, var(--workspace-height, 100dvh)) !important; min-height: 0 !important; }
body:has(.ws-app) #loading-screen { display: none; }
body:has(.ws-app) > .flex-1 { min-height: 0; overflow: hidden; }
body:has(.ws-app), .ws-app, .ws-dialog, .ws-settings-dialog { --ws-bg: #fff; --ws-panel: #f7f7f8; --ws-raised: #fff; --ws-text: #242526; --ws-muted: #6b6d72; --ws-line: #e6e7e9; --ws-hover: #ededee; --ws-accent: #207c6b; --ws-active: #e2eeea; color: var(--ws-text); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; letter-spacing: 0; }
.dark body:has(.ws-app), .dark .ws-app, .dark .ws-dialog, .dark .ws-settings-dialog { --ws-bg: #202122; --ws-panel: #191a1c; --ws-raised: #292a2d; --ws-text: #ededee; --ws-muted: #a5a7ad; --ws-line: #383a3e; --ws-hover: #303135; --ws-accent: #78c9b1; --ws-active: #253f37; }
.ws-app *, .ws-dialog *, .ws-settings-dialog * { box-sizing: border-box; letter-spacing: 0; }
.ws-app [hidden], .ws-dialog [hidden], .ws-settings-dialog [hidden] { display: none !important; }
.ws-app { display: flex; flex: 1; min-height: 0; height: 100%; width: 100%; overflow: hidden; background: var(--ws-bg); }
.ws-app button, .ws-dialog button, .ws-settings-dialog button { cursor: pointer; }
.ws-app button:disabled, .ws-dialog button:disabled { cursor: wait; opacity: .55; }
.ws-app :focus-visible, .ws-dialog :focus-visible, .ws-settings-dialog :focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 3px; }
.ws-app .lucide, .ws-dialog .lucide, .ws-settings-dialog .lucide { width: 19px; height: 19px; stroke-width: 1.7; flex-shrink: 0; }
.ws-icon { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: transparent; color: var(--ws-text); flex-shrink: 0; position: relative; }
.ws-icon:hover, .ws-icon.is-active { background: var(--ws-hover); }
[data-tooltip]::after { display: none; content: attr(data-tooltip); position: absolute; z-index: 120; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px; padding: 6px 9px; background: #27282b; color: #fff; font-size: 12px; line-height: 1.4; border-radius: 4px; pointer-events: none; }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { display: block; }
.ws-navigation { display: flex; flex-shrink: 0; background: var(--ws-panel); min-height: 0; z-index: 45; }
.ws-rail { width: 60px; border-right: 1px solid var(--ws-line); display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 12px 8px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.ws-rail .lucide { width: 22px; height: 22px; }
.ws-rail > [data-tooltip]::after { left: 48px; top: 5px; transform: none; }
.ws-rail-divider { height: 1px; background: var(--ws-line); width: 27px; margin: 3px 0; }
.ws-panel { width: 304px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--ws-line); overflow: hidden; }
.ws-panel-heading { height: 62px; padding: 10px 15px 10px 20px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ws-panel-heading h2 { font-size: 14px; font-weight: 650; margin: 0; flex: 1; }
.ws-panel-actions { display: flex; }
.ws-panel-heading .ws-icon { width: 32px; height: 32px; }
.ws-panel-view { overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 0 12px 20px; min-height: 0; }
.ws-panel-status { font-size: 12px; color: #bd353d; padding: 0 16px; background: var(--ws-panel); }
.ws-panel-status:not(:empty) { padding: 12px 16px; border-top: 1px solid var(--ws-line); }
.ws-app.ws-collapsed .ws-panel { width: 0; opacity: 0; border-color: transparent; visibility: hidden; }
.ws-project-section { border-bottom: 1px solid var(--ws-line); padding-bottom: 12px; margin-bottom: 13px; }
.ws-project-section summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px; font-weight: 600; list-style: none; }
.ws-project-section summary .lucide:last-child { width: 13px; margin-left: auto; }
.ws-project-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; }
.ws-project-row:hover { background: var(--ws-hover); }
.ws-project-row label { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; cursor: pointer; }
.ws-project-row label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-project-row .ws-icon { width: 28px; height: 28px; }
.ws-project-row input, .ws-checkbox { accent-color: var(--ws-accent); width: 16px; height: 16px; border-color: var(--ws-muted); border-radius: 3px; }
.ws-text-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; padding: 8px; background: none; border: 0; font-size: 13px; color: var(--ws-text); border-radius: 6px; }
.ws-text-button:hover { background: var(--ws-hover); }
.ws-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ws-line); background: var(--ws-bg); border-radius: 7px; min-height: 38px; padding: 0 10px; margin: 4px 0 14px; }
.ws-search .lucide { width: 16px; color: var(--ws-muted); }
.ws-search input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 8px 0; background: transparent; color: var(--ws-text); box-shadow: none !important; font-size: 13px; }
.ws-list-group { margin: 18px 8px 7px; font-size: 11px; font-weight: 500; color: var(--ws-muted); }
.ws-chat-row { display: flex; position: relative; min-height: 42px; align-items: center; border-radius: 7px; }
.ws-chat-row > a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 42px; padding: 10px 38px 10px 8px; color: var(--ws-text); text-decoration: none; border-radius: 7px; font-size: 13px; background: transparent !important; }
.ws-chat-row > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chat-row > a .lucide { width: 17px; height: 17px; color: var(--ws-muted); }
.ws-chat-row:has([aria-current='true']), .ws-chat-row:hover { background: var(--ws-hover); }
.ws-chat-actions { position: absolute; right: 3px; top: 4px; }
.ws-chat-actions > .ws-icon { width: 36px; height: 36px; }
.ws-chat-actions > summary::-webkit-details-marker, .ws-help-menu > summary::-webkit-details-marker { display: none; }
.ws-row-menu { position: fixed; inset: auto; margin: 0; padding: 5px; background: var(--ws-raised); border: 1px solid var(--ws-line); box-shadow: 0 6px 25px #0002; border-radius: 7px; width: 200px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; z-index: 150; }
.ws-row-menu::backdrop { background: transparent; }
.ws-row-menu button { min-height: 44px; }
.ws-row-menu button, .ws-account-menu > button, .ws-account-menu a, .ws-account-menu form button, .ws-help-menu summary { width: 100%; background: none; border: 0; padding: 9px 10px; display: flex; gap: 10px; align-items: center; text-align: left; color: var(--ws-text); border-radius: 5px; text-decoration: none; font-size: 13px; }
.ws-row-menu button:hover, .ws-account-menu button:hover, .ws-account-menu a:hover, .ws-help-menu summary:hover { background: var(--ws-hover); }
.ws-account { margin-top: auto; position: relative; }
.ws-avatar { display: flex; justify-content: center; align-items: center; height: 36px; width: 36px; border-radius: 50%; background: #207c6b; color: white; font-weight: 600; font-size: 12px; border: 0; }
.ws-account-menu { position: absolute; bottom: 48px; left: 0; width: 250px; max-height: calc(100dvh - 90px); overflow-y: auto; padding: 5px; background: var(--ws-raised); border: 1px solid var(--ws-line); border-radius: 8px; box-shadow: 0 8px 35px #0002; z-index: 75; }
.ws-account-identity { padding: 10px; border-bottom: 1px solid var(--ws-line); margin-bottom: 5px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.ws-account-identity span { color: var(--ws-muted); font-size: 12px; }
.ws-help-menu summary { list-style: none; cursor: pointer; }
.ws-help-menu summary .lucide:last-child { margin-left: auto; width: 13px; }
.ws-help-menu[open] summary .lucide:last-child { transform: rotate(90deg); }
.ws-help-menu > div { padding-left: 33px; }
.ws-help-menu button { padding: 8px; width: 100%; text-align: left; border-radius: 4px; }
.ws-main { --ws-header-height: 64px; position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; isolation: isolate; background: var(--ws-bg) !important; }
.ws-header, .dark .ws-header { position: absolute; inset: 0 0 auto; pointer-events: none; display: flex; align-items: center; gap: 12px; padding: 10px 22px; height: var(--ws-header-height); flex-shrink: 0; background: transparent !important; border: 0; z-index: 35; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Reference: app.europeanartistbank.com/home, .dash-bottom-nav-gradient.
   Mirror its masked backdrop and tint toward the top. Intermediate blur levels
   soften the content progressively across the compact header. Each filter has
   its own mask; masking their parent would isolate them from the chat backdrop.
   Keep the layers outside the header so controls and open menus remain sharp. */
.ws-header-glass {
  position: absolute;
  inset: 0 0 auto;
  height: var(--ws-header-height);
  z-index: 30;
  pointer-events: none;
  user-select: none;
}
.ws-header-glass > span, .ws-header-glass::after { position: absolute; inset: 0; pointer-events: none; }
.ws-header-glass > span {
  -webkit-backdrop-filter: blur(var(--ws-blur)) saturate(110%);
  backdrop-filter: blur(var(--ws-blur)) saturate(110%);
  -webkit-mask-image: linear-gradient(to top, transparent var(--ws-blur-start), #000 var(--ws-blur-end));
  mask-image: linear-gradient(to top, transparent var(--ws-blur-start), #000 var(--ws-blur-end));
}
.ws-header-glass > span:nth-child(1) { --ws-blur: 1px; --ws-blur-start: 0%; --ws-blur-end: 25%; }
.ws-header-glass > span:nth-child(2) { --ws-blur: 2px; --ws-blur-start: 12.5%; --ws-blur-end: 37.5%; }
.ws-header-glass > span:nth-child(3) { --ws-blur: 4px; --ws-blur-start: 25%; --ws-blur-end: 50%; }
.ws-header-glass > span:nth-child(4) { --ws-blur: 8px; --ws-blur-start: 37.5%; --ws-blur-end: 62.5%; }
.ws-header-glass > span:nth-child(5) { --ws-blur: 16px; --ws-blur-start: 50%; --ws-blur-end: 75%; }
.ws-header-glass > span:nth-child(6) { --ws-blur: 42px; --ws-blur-start: 62.5%; --ws-blur-end: 87.5%; }
.ws-header-glass::after {
  content: '';
  background: linear-gradient(to top,
    transparent,
    color-mix(in srgb, var(--ws-bg) 8%, transparent) 22%,
    color-mix(in srgb, var(--ws-bg) 20%, transparent) 44%,
    color-mix(in srgb, var(--ws-bg) 42%, transparent) 68%,
    color-mix(in srgb, var(--ws-bg) 72%, transparent) 86%,
    color-mix(in srgb, var(--ws-bg) 94%, transparent));
}
.ws-brand { font-size: 15px; font-weight: 700; white-space: nowrap; }
.ws-model { min-width: 0; }
.ws-model #model-select-container { margin-top: 0; }
.ws-model #model-select-container > .relative > button { width: auto; max-width: 260px; min-height: 38px; border: 1px solid var(--ws-line); padding: 7px 10px; color: var(--ws-text); gap: 8px; }
.ws-model #model-select-container > .relative > button > span { width: auto; max-width: 210px; }
.ws-header-tools { margin-left: auto; display: flex; gap: 3px; }
.ws-header-tools .ws-icon { width: 36px; height: 36px; }
.ws-header-tools .ws-icon[data-ws-action='private-chat'] { border: 1px solid var(--ws-line); margin-left: 5px; }
.ws-header-tools .ws-icon.is-active { background: var(--ws-active); color: var(--ws-accent); border-color: var(--ws-accent); }
.ws-main #chat-window-shell { flex: 1; min-height: 0; overflow: hidden; }
.ws-chat-window { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.ws-messages { width: 100%; min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 25px max(24px, calc((100% - 850px) / 2)); scroll-padding-bottom: 24px; }
.ws-app #messages-container { padding-top: 88px !important; padding-bottom: calc(var(--ws-composer-height, 150px) + 52px) !important; scroll-padding-top: 88px; scroll-padding-bottom: calc(var(--ws-composer-height, 150px) + 52px); }
.ws-messages > div { margin-bottom: 24px; }
.ws-messages > .justify-end > div { background: var(--ws-hover) !important; color: var(--ws-text) !important; max-width: 86% !important; border-radius: 8px; transform: none; padding: 14px 18px; }
.ws-messages > .justify-end .text-white, .ws-messages > .justify-end .text-gray-100 { color: var(--ws-text) !important; }
.ws-messages > .justify-end button { color: var(--ws-muted) !important; opacity: 1; }
.ws-messages > .justify-end button svg { color: inherit !important; }
.dark .ws-main { background: var(--ws-bg) !important; }
.ws-messages > .justify-center > div, .ws-messages > [data-message-id] > div { background: transparent !important; max-width: 100% !important; transform: none !important; border-radius: 0 !important; padding: 8px 0 !important; box-shadow: none !important; }
.ws-messages .chat-content, .ws-messages .chat-message-content { font-size: var(--chat-font-size, 16px); line-height: 1.75; }
.ws-messages pre { max-width: 100%; overflow-x: auto; }
.ws-messages table { display: block; overflow-x: auto; max-width: 100%; }
.ws-messages .agent-tool-card { border-radius: 0; }
.ws-composer-wrap.chat-input-container { position: absolute !important; inset: auto auto calc(24px + env(safe-area-inset-bottom)) 50% !important; transform: translateX(-50%) !important; max-width: 850px !important; flex-shrink: 0; margin: 0; padding: 0 !important; background: transparent !important; box-shadow: none !important; z-index: 20 !important; width: calc(100% - 64px) !important; pointer-events: none; }
.ws-composer { border: 1px solid var(--ws-line); border-radius: 8px; background: var(--ws-raised); box-shadow: 0 3px 18px #0000000a; padding: 8px 10px; display: flex; flex-direction: column; width: 100%; }
.ws-composer:focus-within { border-color: color-mix(in srgb, var(--ws-muted) 45%, var(--ws-line)); box-shadow: 0 3px 18px #0000000a, 0 0 0 1px color-mix(in srgb, var(--ws-muted) 10%, transparent); }
.ws-composer textarea { width: 100%; min-height: 72px; max-height: 220px; resize: none; border: 0 !important; padding: 12px 12px 5px; background: transparent !important; color: var(--ws-text); font: inherit; font-size: var(--chat-font-size, 16px); box-shadow: none !important; outline: 0 !important; overflow-y: auto; }
.ws-composer textarea::placeholder { color: var(--ws-muted); }
.ws-composer-tools { display: flex; align-items: center; gap: 4px; }
.ws-app #prompt-form { flex-direction: column !important; align-items: stretch !important; transition: none; }
.ws-app #prompt-form [hidden] { display: none !important; }
.ws-composer-tools { width: 100%; }
.ws-composer-spacer { flex: 1; }
.ws-send { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ws-text); color: var(--ws-bg); }
.ws-send:disabled { background: var(--ws-hover); color: var(--ws-muted); opacity: 1; }
.ws-agent-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 7px 6px; color: var(--ws-muted); font-size: 12px; cursor: pointer; }
.ws-agent-toggle:has(:checked) { color: var(--ws-accent); }
.ws-agent-toggle input, .ws-memory-switch input, .ws-setting-row input[role='switch'], .ws-share-setting input[role='switch'] { appearance: none; width: 30px; height: 18px; border: 0; border-radius: 12px; position: relative; background: var(--ws-line); cursor: pointer; flex-shrink: 0; box-shadow: none !important; }
.ws-agent-toggle input::before, .ws-memory-switch input::before, .ws-setting-row input[role='switch']::before, .ws-share-setting input[role='switch']::before { content: ''; position: absolute; width: 12px; height: 12px; left: 3px; top: 3px; border: 0; border-radius: 50%; background: var(--ws-muted); transform: translateX(0); transition: transform .15s; }
.ws-agent-toggle input:checked, .ws-memory-switch input:checked, .ws-setting-row input[role='switch']:checked, .ws-share-setting input[role='switch']:checked { background: var(--ws-accent); background-image: none; }
.ws-agent-toggle input:checked::before, .ws-memory-switch input:checked::before, .ws-setting-row input[role='switch']:checked::before, .ws-share-setting input[role='switch']:checked::before { background: var(--ws-bg); transform: translateX(12px); }
.ws-composer-footer { min-height: 0; padding: 0; font-size: 10px; display: flex; gap: 8px; justify-content: space-between; color: var(--ws-muted); }
.ws-composer-footer a { margin-left: auto; color: inherit; text-decoration: none; }
.ws-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 13px; min-height: 115px; margin: 0 !important; }
.ws-welcome img.ws-bht-logo { width: min(300px, 70%); height: auto; object-fit: contain; border-radius: 0; }
.dark .ws-bht-logo { filter: brightness(0) invert(.9); }
.ws-welcome h1 { font-size: 34px; line-height: 1.2; font-weight: 650; margin: 0; }
.ws-empty-chat .ws-messages { flex: 0 0 auto; padding-top: 0; padding-bottom: 26px; }
.ws-app .ws-empty-chat #messages-container { padding-top: 0 !important; padding-bottom: 26px !important; }
.ws-empty-chat { justify-content: center; padding: 80px 0 40px; }
.ws-empty-chat .ws-composer-wrap.chat-input-container { position: relative !important; inset: auto !important; transform: none !important; align-self: center; }
.ws-selected-context { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 1px 8px; }
.ws-context-chip { display: inline-flex; gap: 5px; align-items: center; max-width: 100%; color: var(--ws-accent); font-size: 12px; }
.ws-context-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.ws-context-chip p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; margin: 0; }
.ws-context-chip .ws-icon { width: 23px; height: 23px; color: inherit; }
.ws-context-chip .lucide { width: 14px; height: 14px; }
.ws-record { padding: 13px 8px; border-bottom: 1px solid var(--ws-line); }
.ws-active-prompt { padding: 10px 8px 14px; border-bottom: 1px solid var(--ws-line); color: var(--ws-accent); }
.ws-active-prompt .ws-record-preview { color: var(--ws-muted); }
.ws-record-heading { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.ws-record-heading > .lucide { width: 17px; height: 17px; margin-top: 2px; color: var(--ws-muted); }
.ws-record-name { flex: 1; min-width: 0; margin: 0; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; text-align: left; }
button.ws-record-name { border: 0; background: none; padding: 0; color: var(--ws-text); }
.ws-record-name:hover { color: var(--ws-accent); }
.ws-record-preview { margin: 6px 0; color: var(--ws-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ws-record-actions { display: flex; align-items: center; gap: 1px; margin-top: 8px; }
.ws-record-actions .ws-icon { width: 30px; height: 30px; }
.ws-record-actions .lucide { width: 15px; height: 15px; }
.ws-record-meta { font-size: 11px; color: var(--ws-muted); flex: 1; overflow-wrap: anywhere; }
.ws-record .ws-badge { margin-left: 5px; }
.ws-badge { color: var(--ws-accent); background: var(--ws-active); font-size: 10px; line-height: 18px; padding: 1px 5px; border-radius: 3px; font-weight: 500; white-space: nowrap; }
.ws-file-filters { display: grid; gap: 8px; }
.ws-file-filters select, .ws-dialog select, .ws-setting-row select, .ws-setting-row input[type='number'] { border: 1px solid var(--ws-line); border-radius: 6px; background: var(--ws-bg); color: var(--ws-text); min-height: 36px; padding: 6px 30px 6px 9px; font-size: 12px; max-width: 100%; }
.ws-file-toolbar { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; }
.ws-file-image { width: 42px; height: 42px; flex-shrink: 0; object-fit: cover; border-radius: 5px; border: 1px solid var(--ws-line); }
.ws-progress { width: 100%; height: 4px; margin: 8px 0; accent-color: var(--ws-accent); }
.ws-error { font-size: 12px; color: #c33f45; overflow-wrap: anywhere; margin-top: 8px; }
.ws-quota { font-size: 11px; color: var(--ws-muted); padding: 15px 8px; }
.ws-pagination { display: flex; justify-content: space-between; align-items: center; color: var(--ws-muted); font-size: 12px; padding-top: 12px; }
.ws-empty-list { display: flex; align-items: center; flex-direction: column; gap: 8px; color: var(--ws-muted); padding: 32px 12px; text-align: center; font-size: 12px; }
.ws-empty-list > .lucide { width: 28px; height: 28px; opacity: .6; }
.ws-dialog, .ws-settings-dialog { border: 1px solid var(--ws-line); border-radius: 8px; background: var(--ws-raised); color: var(--ws-text); padding: 0; box-shadow: 0 20px 80px #0003; max-height: 90dvh; overscroll-behavior: contain; }
.ws-dialog { width: min(540px, calc(100% - 32px)); }
.ws-dialog::backdrop, .ws-settings-dialog::backdrop { background: #10111370; }
.ws-dialog-close { position: absolute; right: 8px; top: 8px; z-index: 1; }
#workspace-dialog-content { padding: 26px; }
.ws-dialog h2 { font-size: 19px; font-weight: 650; margin: 0 35px 22px 0; }
.ws-field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--ws-muted); margin-bottom: 18px; }
.ws-field input:not([type='checkbox']), .ws-field textarea { width: 100%; border: 1px solid var(--ws-line); border-radius: 6px; padding: 10px 12px; background: var(--ws-bg); color: var(--ws-text); font-size: 14px; }
.ws-field textarea { resize: vertical; min-height: 100px; max-height: 45dvh; }
.ws-form-footer { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 20px; }
.ws-form-footer [role='status'] { margin-right: auto; font-size: 12px; color: var(--ws-muted); }
.ws-primary, .ws-secondary, .ws-danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 1px solid transparent; padding: 8px 14px; border-radius: 6px; font-size: 13px; background: var(--ws-text); color: var(--ws-bg); }
.ws-secondary { background: transparent; color: var(--ws-text); border-color: var(--ws-line); }
.ws-danger { background: #b8323d; color: white; }
.ws-file-drop { display: flex; flex-direction: column; gap: 10px; padding: 24px; text-align: center; align-items: center; border: 1px dashed var(--ws-muted); border-radius: 7px; background: var(--ws-bg); cursor: pointer; font-size: 13px; }
.ws-file-drop { position: relative; }
.ws-file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ws-file-drop:focus-within { outline: 2px solid var(--ws-accent); outline-offset: 3px; }
.ws-pending-files { padding: 10px 0; display: grid; gap: 5px; font-size: 12px; overflow-wrap: anywhere; color: var(--ws-muted); max-height: 180px; overflow-y: auto; }
.ws-toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 36px); padding: 11px 16px; background: var(--ws-text); color: var(--ws-bg); border-radius: 7px; box-shadow: 0 3px 14px #0002; z-index: 20000; font-size: 13px; }
.ws-settings-dialog { width: min(850px, calc(100% - 32px)); height: min(650px, 86dvh); overflow: hidden; }
.ws-settings-heading { display: flex; align-items: center; gap: 9px; padding: 13px 18px 13px 26px; border-bottom: 1px solid var(--ws-line); height: 65px; }
.ws-settings-heading h2 { font-size: 18px; font-weight: 650; flex: 1; }
.ws-settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); height: calc(100% - 65px); }
.ws-settings-nav { padding: 17px 10px; border-right: 1px solid var(--ws-line); background: var(--ws-panel); }
.ws-settings-nav button { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 12px 10px; text-align: left; color: var(--ws-text); border-radius: 6px; font-size: 12px; }
.ws-settings-nav button.is-active, .ws-settings-nav button:hover { background: var(--ws-hover); }
.ws-settings-nav .lucide { width: 17px; height: 17px; }
.ws-settings-content { padding: 25px 30px; overflow-y: auto; min-width: 0; }
.ws-settings-content h3 { font-size: 15px; font-weight: 650; margin: 0 0 15px; }
.ws-setting-row { min-height: 67px; border-bottom: 1px solid var(--ws-line); display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 0; font-size: 13px; overflow-wrap: anywhere; }
.ws-setting-row > select, .ws-setting-row > input { max-width: 180px; }
.ws-setting-row > span, .ws-setting-row > strong { text-align: right; min-width: 0; }
.ws-setting-row + .ws-field { margin-top: 22px; }
.ws-setting-row input[type='range'] { accent-color: var(--ws-accent); width: 140px; max-width: 100%; }
.ws-range-control { display: flex; align-items: center; gap: 10px; max-width: 210px; }
.ws-range-control output { width: 42px; font-size: 12px; color: var(--ws-muted); text-align: right; flex-shrink: 0; }
.ws-memory-switch { font-size: 12px; min-height: 46px; padding: 5px 4px 13px; }
.ws-setting-link { display: flex; align-items: center; width: 100%; gap: 9px; padding: 17px 0; border-bottom: 1px solid var(--ws-line); font-size: 13px; }
.ws-setting-link .lucide:last-child { margin-left: auto; width: 16px; }
.ws-settings-content #gitlab-archive-settings { margin: 0; border: 0; padding: 0; }
.ws-settings-back, .ws-mobile-only { display: none; }
.ws-private-notice { padding: 12px; margin-bottom: 15px; background: var(--ws-panel); color: var(--ws-muted); border-radius: 6px; font-size: 12px; line-height: 1.6; }
@media (min-width: 768px) and (max-width: 1120px) { .ws-panel { width: 265px; } .ws-brand { display: none; } .ws-header { gap: 8px; padding: 10px 15px; } .ws-header-tools .ws-icon { width: 32px; } }
@media (max-width: 767px) {
  .ws-app { height: 100%; }
  .ws-mobile-only { display: inline-flex; }
  .ws-navigation { position: fixed; left: 0; top: 0; bottom: 0; width: min(calc(100% - 24px), 380px); transform: translateX(-102%); visibility: hidden; box-shadow: 12px 0 30px #0002; z-index: 100; }
  .ws-app.ws-mobile-open .ws-navigation { transform: translateX(0); visibility: visible; }
  .ws-app.ws-collapsed .ws-panel { width: auto; opacity: 1; visibility: visible; }
  .ws-panel { width: auto; flex: 1; }
  .ws-rail { width: 56px; padding-top: max(10px, env(safe-area-inset-top)); }
  .ws-rail .ws-icon { width: 40px; height: 44px; }
  .ws-nav-backdrop { position: fixed; inset: 0; border: 0; background: #10111375; z-index: 90; }
  .ws-main { --ws-header-height: 59px; }
  .ws-header, .dark .ws-header { padding: 8px 9px; gap: 6px; }
  .ws-header > .ws-brand { display: none; }
  .ws-header .ws-mobile-only { width: 36px; }
  .ws-header-tools { gap: 0; }
  .ws-header-tools .ws-icon { width: 31px; height: 38px; }
  .ws-header-tools .ws-icon[data-ws-action='private-chat'] { margin-left: 2px; }
  .ws-language-button { display: inline-flex; }
  .ws-model { flex: 1; }
  .ws-model #model-select-container > .relative > button { font-size: 12px; max-width: 100%; padding: 7px; }
  .ws-model #model-select-container > .relative > button > span { max-width: 95px; }
  .ws-messages { padding: 15px 16px; }
  .ws-messages > .justify-end > div { max-width: 93% !important; padding: 11px 13px; }
  .ws-composer-wrap.chat-input-container { margin: 0; width: calc(100% - 40px) !important; inset: auto auto calc(20px + env(safe-area-inset-bottom)) 50% !important; }
  .ws-composer { padding: 5px 5px 6px; }
  .ws-composer textarea { font-size: max(16px, var(--chat-font-size)); min-height: 65px; padding: 10px 8px; }
  .ws-composer-tools { gap: 1px; }
  .ws-composer-tools > .ws-icon { width: 38px; height: 44px; }
  .ws-send { width: 40px; height: 40px; margin-right: 3px; }
  .ws-agent-settings { width: 30px !important; }
  .ws-agent-toggle { gap: 5px; padding: 6px 3px; }
  .ws-agent-toggle > .lucide { display: none; }
  .ws-empty-chat { padding-bottom: 9vh; }
  .ws-welcome h1 { font-size: 28px; }
  .ws-welcome img { width: 44px; height: 44px; }
  .ws-empty-chat .ws-messages { padding-bottom: 14px; }
  .ws-settings-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .ws-settings-heading { padding: max(12px, env(safe-area-inset-top)) 12px 12px; height: 65px; }
  .ws-settings-layout { display: block; }
  .ws-settings-nav { height: 100%; padding: 15px; border: 0; }
  .ws-settings-nav button { font-size: 14px; min-height: 55px; }
  .ws-settings-content { display: none; padding: 20px; height: 100%; }
  .ws-settings-dialog.ws-settings-detail .ws-settings-nav { display: none; }
  .ws-settings-dialog.ws-settings-detail .ws-settings-content { display: block; }
  .ws-settings-dialog.ws-settings-detail .ws-settings-back { display: inline-flex; }
  .ws-setting-row { gap: 12px; }
  .ws-setting-row input[type='range'] { width: 100px; }
  .ws-dialog { max-height: 93dvh; }
  #workspace-dialog-content { padding: 24px 19px; }
  .ws-account-menu { width: min(270px, calc(100vw - 45px)); }
  [data-tooltip]::after { display: none !important; }
}
@media (max-height: 560px) { .ws-empty-chat { padding-bottom: 0; } .ws-welcome { min-height: 60px; } .ws-empty-chat .ws-messages { padding-bottom: 8px; } .ws-welcome h1 { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .ws-app *, .ws-app *::before { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Floating controls only cover their own footprint. */
.ws-header > * { pointer-events: auto; }
.ws-header-tools .ws-icon, .ws-header > .ws-icon, .ws-model #model-select-container > .relative > button { background: var(--ws-raised); box-shadow: 0 2px 12px #0000000a; }
.ws-header-tools .ws-icon:hover { background: var(--ws-hover); }
.ws-composer-wrap > * { pointer-events: auto; }
/* Whitespace and HTMX helper scripts must not paint an empty attachment tray,
   including the first frame before JavaScript initializes or a modal opens. */
.ws-composer-wrap > :is(.ws-selected-context, #document-attachment-container, #vision-attachment-container):not(:has(> :not(script, template, [hidden]))), .ws-composer-footer:has(span:empty) { display: none; }
.ws-composer-wrap > :is(.ws-selected-context, #document-attachment-container, #vision-attachment-container):has(> :not(script, template, [hidden])), .ws-composer-footer:not(:has(span:empty)) { border-radius: 8px; background: var(--ws-raised); padding: 6px 10px; margin-bottom: 6px; max-height: 100px; overflow-y: auto; }
.ws-composer-footer:not(:has(span:empty)) { margin: 6px 0 0; width: fit-content; }
.ws-composer textarea { max-height: min(220px, 30dvh); }
.ws-panel { transition: width 260ms cubic-bezier(.22,.8,.25,1), opacity 180ms, visibility 260ms; }
.ws-panel-heading, .ws-panel-view { flex-shrink: 0; }
.ws-panel-view { flex-shrink: 1; }
.ws-navigation { transition: transform 260ms cubic-bezier(.22,.8,.25,1), visibility 260ms; }
.ws-dialog[open], .ws-settings-dialog[open] { animation: ws-dialog-enter 200ms cubic-bezier(.2,.8,.2,1); }
.ws-dialog[open]::backdrop, .ws-settings-dialog[open]::backdrop { animation: ws-fade-enter 180ms ease-out; }
@keyframes ws-dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ws-fade-enter { from { opacity: 0; } to { opacity: 1; } }
.ws-timeline { position: absolute; right: 6px; top: 85px; bottom: calc(var(--ws-composer-height, 150px) + 60px); z-index: 25; display: flex; flex-direction: column; justify-content: safe center; width: 22px; overflow-y: auto; scrollbar-width: none; }
.ws-timeline button { position: relative; min-height: 22px; width: 22px; padding: 0; border: 0; background: transparent; flex: 0 0 22px; cursor: pointer; }
.ws-timeline button::after { content: ''; display: block; height: 2px; width: 10px; margin-left: auto; border-radius: 2px; background: var(--ws-muted); opacity: .45; transition: width 150ms, opacity 150ms; }
.ws-timeline button:hover::after, .ws-timeline button[aria-current='true']::after { width: 20px; background: var(--ws-accent); opacity: 1; }
.ws-timeline-preview { position: absolute; right: 35px; z-index: 26; max-width: min(320px, 70%); padding: 9px 12px; border: 1px solid var(--ws-line); border-radius: 8px; background: var(--ws-raised); color: var(--ws-text); font-size: 12px; box-shadow: 0 4px 20px #0002; pointer-events: none; }
@media (max-width: 767px) { .ws-timeline { right: 3px; width: 17px; } .ws-timeline button { width: 17px; } .ws-timeline button:hover::after, .ws-timeline button[aria-current='true']::after { width: 16px; } .ws-app #messages-container { padding-top: 78px !important; padding-right: 28px; } }
@media (max-height: 560px) { .ws-empty-chat { padding-top: 65px; padding-bottom: 20px; } .ws-welcome img.ws-bht-logo { width: 190px; } }
@media (prefers-reduced-motion: reduce) { .ws-app *, .ws-dialog, .ws-settings-dialog, .ws-dialog::backdrop, .ws-settings-dialog::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

body:has(.ws-app) { overflow: hidden; position: relative; top: var(--workspace-top, 0px); }
.ws-modal-overlay { z-index: 10000 !important; padding: 20px; background: #10111370; overflow-y: auto; color: var(--ws-text); font: 14px/1.5 system-ui, sans-serif; }
.ws-modal-overlay > .fixed { background: transparent !important; }
.ws-modal-position { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 0 !important; }
.ws-modal-card { width: min(680px, 100%) !important; max-height: calc(min(100dvh, var(--workspace-height, 100dvh)) - 40px) !important; margin: auto !important; border: 1px solid var(--ws-line); border-radius: 12px !important; background: var(--ws-raised) !important; color: var(--ws-text); box-shadow: 0 24px 80px #0004 !important; transform: none; animation: ws-dialog-enter 220ms cubic-bezier(.2,.8,.2,1); }
.ws-modal-card > .overflow-y-auto { max-height: none !important; min-height: 0; }
.ws-modal-card h2, .ws-modal-card h3 { font-size: 18px; font-weight: 650; }
.ws-modal-card :is(input:not([type='checkbox']), textarea, select) { background: var(--ws-bg) !important; color: var(--ws-text) !important; border-color: var(--ws-line) !important; border-radius: 7px; max-width: 100%; }
.ws-modal-card :is([class*='text-gray-9'], [class*='text-gray-8'], [class*='text-gray-7']) { color: var(--ws-text) !important; }
.ws-modal-card :is([class*='text-gray-6'], [class*='text-gray-5'], [class*='text-gray-4']) { color: var(--ws-muted) !important; }
.ws-modal-card :is([class*='border-gray-'], [class*='border-purple-']) { border-color: var(--ws-line) !important; }
.ws-modal-card :is([class*='bg-gray-50'], [class*='bg-gray-100'], [class*='bg-gray-800']) { background: var(--ws-panel) !important; }
.ws-modal-card :is(.bg-white, [class*='dark:bg-gray-700']) { background-color: var(--ws-raised) !important; }
.ws-modal-card :is(.bg-purple-600, .bg-blue-600, .bg-gray-600) { background: var(--ws-text) !important; color: var(--ws-bg) !important; }
.ws-modal-card :is(.text-purple-600, .text-purple-400) { color: var(--ws-accent) !important; }
.ws-modal-card .switch-track { background: var(--ws-line) !important; }
.ws-modal-card .switch-track-on { background: var(--ws-accent) !important; }
.ws-modal-card .switch-thumb { background: var(--ws-raised) !important; border: 1px solid var(--ws-muted); }
.ws-modal-card button:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 3px; }
.ws-modal-card button[aria-label='Schließen'] { border-radius: 7px; min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.ws-share-card { padding: 26px; overflow-y: auto; }
.ws-share-card > p { color: var(--ws-muted); font-size: 13px; margin: 10px 0 18px; }
.ws-share-link { display: flex; gap: 8px; margin: 18px 0; }
.ws-share-link input { min-width: 0; flex: 1; padding: 10px; border: 1px solid var(--ws-line); }
.ws-share-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--ws-line); }
.ws-share-setting small { display: block; margin-top: 4px; color: var(--ws-muted); font-size: 12px; line-height: 1.6; }
.ws-share-setting input { accent-color: var(--ws-accent); width: 30px; height: 18px; flex-shrink: 0; }
.ws-share-projects { margin: 12px 0; color: var(--ws-muted); font-size: 12px; }
.ws-share-qr { width: 180px; max-width: 100%; background: white; padding: 10px; margin: 15px auto; border-radius: 8px; }
.ws-shared-title { display: flex; align-items: center; gap: 14px; min-width: 0; border-radius: 9px; background: var(--ws-raised); padding: 8px 12px; }
.ws-shared-title img { width: 105px; height: auto; }
.ws-shared-title h1 { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-shared-title small { color: var(--ws-muted); font-size: 11px; }
.ws-readonly { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 9px 16px; border: 1px solid var(--ws-line); border-radius: 8px; color: var(--ws-muted); background: var(--ws-raised); font-size: 12px; z-index: 20; }
.ws-shared .ws-messages { max-width: none !important; margin: 0; }
.ws-shared .ws-header { gap: 8px; }
.ws-shared #prompt-form.htmx-request button[type='submit'] { pointer-events: none; opacity: .5; }
@media (max-width: 767px) { .ws-modal-overlay { padding: 12px; } .ws-modal-card { max-height: calc(min(100dvh, var(--workspace-height, 100dvh)) - 24px) !important; } .ws-modal-card > .flex:first-child { flex-wrap: wrap; gap: 8px; } .ws-share-card { padding: 22px 18px; } .ws-share-setting { gap: 12px; } .ws-shared-title img { width: 76px; } .ws-shared-title h1 { max-width: 110px; } .ws-shared-title { padding: 6px 8px; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .ws-modal-overlay, .ws-modal-card, .ws-modal-card * { animation: none !important; transition: none !important; } }

@media (min-width: 1121px) { .ws-panel > * { min-width: 303px; } }
@media (min-width: 768px) and (max-width: 1120px) { .ws-panel > * { min-width: 264px; } }
.ws-shared-title > div { min-width: 0; }
.ws-shared .ws-header-tools { flex-shrink: 0; }
body:has(.ws-app) :is(.toast-container, #toast-container) > div { background: var(--ws-raised); color: var(--ws-text); border: 1px solid var(--ws-line); border-radius: 9px; box-shadow: 0 5px 24px #0002; }
.ws-token-control { display:flex; align-items:center; gap:8px; min-width:0; flex-shrink:0; }
.ws-setting-row .ws-token-control input { width:128px; min-width:128px; padding:6px 9px; }
.ws-token-control > span { color:var(--ws-muted); font-size:12px; white-space:nowrap; }
.ws-model-setting .gw-model-select-container { min-width:0; max-width:75%; }
@media (max-width:520px) {
  .ws-token-setting { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  .ws-token-control { justify-content:space-between; }
}
