.message-attachments{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;margin-top:8px;width:fit-content;min-width:0;max-width:min(100%,780px)}
.message-attachments:has(>.message-attachment[open]){display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));align-items:start;width:min(100%,780px)}
.message-attachments:has(>.message-attachment:only-child){max-width:min(100%,360px)}
.message-attachments[hidden]{display:none}
.chat-message[data-role=user]>.message-attachments{justify-content:flex-end;justify-items:end}
.message-attachment{margin:0;padding:0;border:1px solid var(--line,#dce2eb);border-radius:8px;background:var(--panel,#fff);width:fit-content;min-width:0;max-width:min(100%,320px);color:var(--text,#273246)}
.message-attachment[open]{width:100%;max-width:100%;border-radius:12px}
.message-attachment>.message-attachment-toggle{display:flex;align-items:center;gap:9px;width:100%;min-width:0;min-height:48px;margin:0;padding:5px 10px;box-sizing:border-box;list-style:none;font-size:13px;line-height:20px;color:var(--text,#273246);cursor:pointer;border-radius:inherit}
.message-attachment>.message-attachment-toggle::-webkit-details-marker{display:none}
.message-attachment>.message-attachment-toggle:hover{background:var(--panel-soft,#f3f5f8)}
.message-attachment[open]>.message-attachment-toggle{border-bottom:1px solid var(--line,#dce2eb);border-radius:12px 12px 0 0}
.message-attachment-icon{flex:none;width:20px;font-size:16px;text-align:center;color:var(--accent,#3865bd)}
.message-attachment-thumbnail{position:relative;display:flex;align-items:center;justify-content:center;flex:none;width:36px;height:36px;overflow:hidden;border-radius:5px;background:var(--panel-soft,#eff2f6);pointer-events:none}
.message-attachment .message-attachment-thumbnail>img,.message-attachment .message-attachment-thumbnail>video{position:absolute;inset:0;width:36px;height:36px;max-height:36px;object-fit:cover;border-radius:5px;opacity:0}
.message-attachment-thumbnail[data-ready=true]>.message-attachment-icon{visibility:hidden}
.message-attachment-thumbnail[data-ready=true]>img,.message-attachment-thumbnail[data-ready=true]>video{opacity:1}
.message-attachment-play{position:absolute;right:2px;bottom:2px;display:grid;place-items:center;width:14px;height:14px;border-radius:50%;background:rgba(0,0,0,.65);color:#fff;font-size:7px}
.message-attachment-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.message-attachment-card{margin:0;padding:16px;min-width:0}
.message-attachment img,.message-attachment video{display:block;width:100%;max-height:330px;object-fit:contain;border-radius:8px;background:var(--panel-soft,#eff2f6)}
.message-attachment audio{width:100%}
.message-attachment figcaption{font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.message-attachment-card>video+figcaption,.message-attachment-card>audio+figcaption,.message-attachment-card>a+figcaption{padding-top:12px}
.message-attachment .message-attachment-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:8px 0 4px;font-size:14px;line-height:1.55;color:var(--text,#273246)}
.message-attachment p{margin:4px 0;color:var(--muted,#68758a)}
.message-attachment-status{display:inline-block;padding:2px 8px;border-radius:6px;background:var(--panel-soft,#f3f5f8);color:var(--muted,#68758a);font-size:11px;font-weight:500}
.message-attachment[data-state=available] .message-attachment-status{color:var(--accent,#3865bd);background:color-mix(in srgb,var(--accent,#3865bd) 9%,var(--panel,#fff))}
.message-attachment .message-attachment-notice{margin:12px 0;padding:10px 12px;border-radius:8px;background:var(--panel-soft,#f7f8fb);color:var(--muted,#68758a);line-height:1.7}
.message-attachment[data-state=missing] .message-attachment-status{color:var(--danger,#b5473c)}
.message-attachment .message-attachment-notice[hidden],.message-attachment .message-attachment-feedback[hidden]{display:none}
.message-attachment-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.message-attachment .message-attachment-action{display:inline-flex;align-items:center;justify-content:center;min-height:36px;max-width:100%;margin:0;padding:6px 12px;border:1px solid var(--line,#dce2eb);border-radius:8px;background:var(--panel,#fff);color:var(--text,#273246);font:inherit;font-weight:500;line-height:1.5;text-decoration:none;cursor:pointer}
.message-attachment .message-attachment-action:hover{background:var(--panel-soft,#f7f8fb);border-color:var(--accent,#3865bd)}
.message-attachment .message-attachment-action:focus-visible,.message-attachment summary:focus-visible{outline:2px solid var(--accent,#3865bd);outline-offset:3px}
.message-attachment .message-attachment-action:disabled{opacity:.6;cursor:wait}
.message-attachment .message-attachment-primary{color:var(--accent,#3865bd);border-color:color-mix(in srgb,var(--accent,#3865bd) 30%,var(--line,#dce2eb))}
.message-attachment .message-attachment-feedback{margin-top:8px}
.message-attachment details{margin-top:12px;padding-top:10px;border-top:1px solid var(--line,#dce2eb)}
.message-attachment details p{white-space:pre-wrap;user-select:text}
.message-attachment summary{width:fit-content;cursor:pointer;color:var(--muted,#68758a)}
@media(max-width:600px){.message-attachments:has(>.message-attachment[open]){grid-template-columns:1fr}.message-attachment-card{padding:14px}.message-attachment img,.message-attachment video{max-height:260px}.message-attachment .message-attachment-action{min-height:44px}}
.flowchart-result-card{display:grid;gap:10px;width:min(100%,560px);min-width:0;margin-top:10px;padding:12px;box-sizing:border-box;border:1px solid var(--line,#dce2eb);border-radius:12px;background:var(--panel,#fff);color:var(--text,#273246)}
.flowchart-result-card>svg{display:block;width:100%;max-width:100%;height:260px;border-radius:8px}
.flowchart-result-card>small{color:var(--muted,#68758a);font-size:12px;line-height:1.5}

.work-module-result-card{display:grid;gap:10px;width:min(100%,560px);min-width:0;margin-top:10px;padding:12px;box-sizing:border-box;border:1px solid var(--line,#dce2eb);border-radius:12px;background:var(--panel,#fff);color:var(--text,#273246)}
.work-module-result-card>svg{display:block;width:100%;max-width:100%;height:260px;border-radius:8px}
.work-module-result-card>small{color:var(--muted,#68758a);font-size:12px;line-height:1.6}
.work-module-text-preview{box-sizing:border-box;min-width:0;width:100%;max-height:320px;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid var(--line,#dce2eb);border-radius:8px;background:var(--panel-soft,#f7f8fb);color:var(--text,#273246);font:13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;user-select:text}
.work-module-result-card .message-attachment-actions{margin-top:0}
.work-module-result-card .message-attachment-action{min-height:36px;padding:6px 12px;border:1px solid var(--line,#dce2eb);border-radius:8px;background:var(--panel,#fff);color:var(--text,#273246);font:inherit;cursor:pointer}
.work-module-result-card .message-attachment-action:hover{background:var(--panel-soft,#f7f8fb)}
.work-module-result-card .message-attachment-action:disabled{opacity:.6;cursor:wait}
.work-module-result-card .message-attachment-action:focus-visible{outline:2px solid var(--accent,#3865bd);outline-offset:2px}
.work-module-result-feedback{margin:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.work-module-result-feedback:empty,#workModuleStatus:empty{display:none}
.work-module-dialog{width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto}
.work-module-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.work-module-dialog h2{margin:0;font-size:18px}
.work-module-dialog .user-feedback-body{display:grid;gap:14px;min-width:0}
.work-module-dialog label{display:grid;gap:6px;min-width:0}
.work-module-dialog select,.work-module-dialog input{box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:10px;border:1px solid var(--line,#dce2eb);border-radius:8px;background:var(--panel,#fff);color:var(--text,#273246);font:inherit}
.work-module-dialog p,.work-module-dialog small{margin:0;line-height:1.65;overflow-wrap:anywhere}
.work-module-dialog small{color:var(--muted,#68758a)}
#workModuleLaunch{min-height:42px}
@media(max-width:600px){.work-module-result-card .message-attachment-action{min-height:44px}.work-module-text-preview{max-height:260px}.work-module-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}}
