.workspace-results-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dde3eb; background: #fff; color: #334155; padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.artifact-panel { position: fixed; z-index: 1100; top: 16px; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); background: #fff; border: 1px solid #dfe4eb; border-radius: 8px; box-shadow: 0 12px 40px #172b4d26; display: flex; flex-direction: column; }
.artifact-panel[hidden] { display: none; }
.artifact-panel-header { padding: 18px 20px; border-bottom: 1px solid #e8edf2; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.artifact-panel-header h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.artifact-panel-header button { width: 36px; height: 36px; border: 0; background: #f3f5f7; border-radius: 6px; cursor: pointer; }
.artifact-panel-header button span { font: 24px/1 Arial, sans-serif; color: #475569; }
.artifact-panel-list { padding: 8px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.artifact-entry { padding: 18px 0; border-bottom: 1px solid #e8edf2; }
.artifact-entry strong { display: block; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.artifact-entry p { color: #64748b; font-size: 12px; margin: 6px 0 12px; }
.artifact-entry button, .message-revise-btn { background: #f0f6ff; color: #205ed0; border: 1px solid #d5e4ff; border-radius: 6px; padding: 8px 12px; cursor: pointer; min-height: 36px; }
.artifact-entry-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.artifact-version-editor { margin-top: 14px; }
.artifact-version-editor summary { cursor: pointer; color: #475569; font-size: 13px; padding: 8px 0; }
.artifact-version-editor label { display: block; margin: 12px 0; color: #475569; font-size: 13px; overflow-wrap: anywhere; }
.artifact-version-editor textarea { display: block; box-sizing: border-box; width: 100%; min-height: 260px; margin-top: 8px; padding: 12px; border: 1px solid #dce3eb; border-radius: 6px; resize: vertical; font: 14px/1.8 system-ui, sans-serif; color: #18212f; background: #fafbfc; }
.artifact-version-editor textarea:focus { outline: 2px solid #246bfd; outline-offset: 1px; }
.artifact-empty { padding: 28px 0; color: #64748b; line-height: 1.7; }
.artifact-storage-note { margin: 0; padding: 14px 20px; border-top: 1px solid #e8edf2; font-size: 12px; color: #64748b; line-height: 1.6; }
.artifact-storage-warning { color: #9a5700; }
.revision-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 8px; background: #f0f6ff; border-left: 3px solid #246bfd; color: #2055a8; font-size: 13px; }
.revision-context[hidden] { display: none; }
.revision-context span { min-width: 0; overflow-wrap: anywhere; }
.revision-context button { flex: 0 0 32px; height: 32px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.message-downloads { min-width: 0; }
.message-download-btn { min-width: 0; max-width: 100%; white-space: normal; }
.message-download-btn small { overflow-wrap: anywhere; }
.chat-message > div:last-child { min-width: 0; }
.attachment-chip { max-width: 100%; min-width: 0; box-sizing: border-box; }
.attachment-chip > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.attachment-chip small { display: block; margin-top: 4px; color: #526174; font-size: 12px; line-height: 1.5; }
.attachment-chip > button { flex-shrink: 0; min-width: 32px; min-height: 32px; }
body.tool-open .action-panel { box-sizing: border-box; min-width: 0; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
body.tool-open .action-panel:not(.wechat-article-panel):not(.document-tools-panel) .panel-header { padding: 16px 0 24px !important; border: 0 !important; border-bottom: 1px solid #dfe4eb !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
body.tool-open .action-panel:not(.wechat-article-panel):not(.document-tools-panel) .help-box,
body.tool-open .action-panel:not(.wechat-article-panel):not(.document-tools-panel) .file-list { border-radius: 8px !important; box-shadow: none !important; }
body.tool-open .action-panel:not(.wechat-article-panel):not(.document-tools-panel) textarea,
body.tool-open .action-panel:not(.wechat-article-panel):not(.document-tools-panel) input[type="text"],
body.tool-open .action-panel:not(.wechat-article-panel):not(.document-tools-panel) input[type="file"] { border-radius: 8px !important; }
.action-panel .panel-title { min-width: 0; }
.action-panel .panel-title h3 { font-size: 24px !important; line-height: 1.4 !important; overflow-wrap: anywhere; letter-spacing: 0 !important; }
.action-panel .panel-title p { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.action-panel textarea { box-sizing: border-box; max-width: 100%; min-height: 160px; line-height: 1.75; resize: vertical; }
.action-panel input:not([type="checkbox"]):not([type="radio"]), .action-panel select { box-sizing: border-box; max-width: 100%; min-width: 0; }
.action-panel .feature-model-control { flex-wrap: wrap; min-width: 0; }
.action-panel .feature-model-control label { min-width: 0; max-width: 100%; }
.action-panel .file-list, .action-panel .template-context-display, .action-panel .status, .action-panel .help-box { overflow-wrap: anywhere; }
.action-panel textarea:focus-visible, .action-panel select:focus-visible, .action-panel input:focus-visible { outline: 2px solid #246bfd; outline-offset: 2px; }
@media (max-width: 600px) {
  .action-panel .panel-title h3 { font-size: 22px !important; }
  .action-panel .feature-model-control label:not(.feature-model-check) { flex: 1 1 100%; }
  .action-panel .prompt-chips { display: flex; flex-wrap: wrap; }
  .action-panel .primary-btn { white-space: normal; height: auto; min-height: 48px; line-height: 1.5; }
}
.artifact-entry-actions button:focus-visible, .artifact-panel-header button:focus-visible, .workspace-results-toggle:focus-visible { outline: 2px solid #246bfd; outline-offset: 3px; }
body.workbench-theme-dark .artifact-panel { background: #242527; color: #f1f3f5; border-color: #45474b; }
body.workbench-theme-dark .artifact-panel-header,
body.workbench-theme-dark .artifact-entry,
body.workbench-theme-dark .artifact-storage-note { border-color: #45474b; }
body.workbench-theme-dark .artifact-entry p,
body.workbench-theme-dark .artifact-storage-note,
body.workbench-theme-dark .artifact-version-editor summary,
body.workbench-theme-dark .artifact-version-editor label { color: #bac2ce; }
body.workbench-theme-dark .artifact-version-editor textarea { background: #191b1e; color: #f1f3f5; border-color: #555b64; }
@media (max-width: 900px) {
  body:not(.sidebar-open) .workspace-sidebar { visibility: hidden; pointer-events: none; }
}
@media (min-width: 1200px) {
  .ai-workspace.has-artifact-panel .chat-main { margin-right: 390px; }
}
@media (max-width: 700px) {
  .artifact-panel { top: auto; right: 0; bottom: 0; width: 100%; max-height: 78dvh; border-radius: 8px 8px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .artifact-panel-header button, .artifact-entry button { min-height: 44px; }
  .workspace-results-toggle { padding: 8px; }
}
