/* Composer-only reference-video treatment; no page layout or document typography. */
@keyframes attachment-arrive{from{opacity:0;transform:translateY(5px) scale(.98)}to{opacity:1;transform:none}}
@keyframes attachment-rotate{to{transform:rotate(360deg)}}
body #chatAttachments .chat-attachment,
body #projectChatMaterials .project-chat-material{
  position:relative;display:flex;align-items:center;gap:9px;flex:0 0 auto;
  min-height:58px;max-width:min(272px,100%);padding:9px 11px;
  border:1px solid #e3e7ee;border-radius:11px;background:#fff;
  box-shadow:0 2px 5px rgba(32,48,75,.025);color:var(--ink);
  animation:attachment-arrive .22s cubic-bezier(.2,.7,.2,1) both;
  transition:border-color .2s,background-color .2s,box-shadow .2s;
}
body #chatAttachments .chat-attachment:hover,
body #projectChatMaterials .project-chat-material:not(:disabled):hover{background:#f8faff;border-color:#bacbed;box-shadow:0 2px 6px rgba(32,48,75,.06)}
body #projectChatMaterials .project-chat-material:disabled{opacity:1}
body #projectChatMaterials .project-chat-materials{display:flex;flex-wrap:wrap;gap:7px;max-height:170px;overflow:auto;scrollbar-width:thin;padding:3px 1px 7px;margin:0}
body #projectChatMaterials .project-chat-materials-label{width:100%;font-size:10px;color:#748097;display:flex;justify-content:space-between;align-items:center}
body #projectChatMaterials .project-chat-material>span.attachment-file-badge,
body #chatAttachments .file-icon{display:grid;place-items:center;flex:0 0 34px;width:34px;height:38px;border-radius:7px;font-size:9px;font-weight:700;letter-spacing:.3px;background:#eaf2fc;color:#426da0;overflow:visible}
body #projectChatMaterials .attachment-file-badge[data-kind="pdf"]{background:#fceeed;color:#b35d53}
body #projectChatMaterials .attachment-file-badge[data-kind="code"]{background:#f1eafa;color:#8461a3}
body #projectChatMaterials .attachment-file-badge[data-kind="sheet"]{background:#e9f5ed;color:#4c8261}
body #projectChatMaterials .attachment-file-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
body #projectChatMaterials .attachment-file-copy b{font-size:11px;font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body #projectChatMaterials .attachment-file-copy em{font-size:10px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;color:#748097;font-style:normal;font-variant-numeric:tabular-nums}
body #projectChatMaterials .project-chat-material>i{width:13px;height:13px;flex:0 0 13px;margin-left:1px;border:1.5px solid #dce5f2;background:none;box-shadow:none}
body #projectChatMaterials .project-chat-material.is-parsing>i{border-top-color:#4c77c8;animation:attachment-rotate .9s linear infinite}
body #projectChatMaterials .project-chat-material.is-ready>i{border:0;border-radius:0;position:relative}
body #projectChatMaterials .project-chat-material.is-ready>i:after{content:"";position:absolute;left:3px;top:1px;width:5px;height:9px;border-right:1.6px solid #67876d;border-bottom:1.6px solid #67876d;transform:rotate(40deg)}
body #projectChatMaterials .project-chat-material:is(.is-error,.is-missing){border-color:#e8c4bf;background:#fff9f8}
body #projectChatMaterials .project-chat-material:is(.is-error,.is-missing)>i{border-color:#b96b61;background:#fbeae7}
body #chatAttachments .chat-attachment.is-uploading{border-style:solid;background:#fcfdff}
body #chatAttachments{max-height:174px;overflow:auto;padding:10px 10px 2px}
body #chatAttachments:empty{display:none;padding:0}
body #chatAttachments .chat-upload-spinner{animation:attachment-rotate .9s linear infinite}
body #chatAttachments .file-meta b{font-size:11px;line-height:1.4}
body #chatAttachments .file-meta span{font-size:10px;line-height:1.45;font-variant-numeric:tabular-nums}
body #chatAttachments .remove,body #chatAttachments .chat-upload-actions button{display:grid;place-items:center;min-width:22px;min-height:22px;border-radius:50%;transition:background-color .18s,transform .18s}
body #chatAttachments .remove:hover{background:#edf1f7}
body :is(.chat-main,.project-caddie-panel) .send{transition:transform .16s,background-color .2s,box-shadow .2s}
body :is(.chat-main,.project-caddie-panel) .send:active{transform:scale(.9)}
body :is(.chat-main,.project-caddie-panel) .send svg{transition:transform .2s}
body :is(.chat-main,.project-caddie-panel) .send:not(.is-stop):hover svg{transform:translateY(-1px)}
body .chat-main .composer.dragging{position:relative;outline:2px solid #7b9bdb;outline-offset:3px;background:#f4f8ff!important;box-shadow:0 0 0 6px rgba(80,120,200,.07)!important}
body .chat-main .composer.dragging:after{content:"松开以添加文件";position:absolute;inset:5px;display:grid;place-items:center;border-radius:14px;background:rgba(244,248,255,.96);color:#4369a7;font-size:14px;font-weight:600;pointer-events:none;animation:attachment-arrive .18s ease-out}
body .chat-msg-file{max-width:100%;min-height:44px;border-radius:10px;padding:8px 10px}
body .chat-msg-file b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
body #chatAttachments button:focus-visible,body #projectChatMaterials button:focus-visible{outline:2px solid #7b9bdb;outline-offset:2px}
@media(prefers-reduced-motion:reduce){
 body #chatAttachments *,body #projectChatMaterials *,body :is(.chat-main,.project-caddie-panel) .send,body :is(.chat-main,.project-caddie-panel) .send svg,body .chat-main .composer.dragging:after{animation:none!important;transition:none!important}
}
/* Type is encoded by both shape and tint, never colour alone. */
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge{
 display:flex!important;flex-direction:column;justify-content:center;align-items:center;gap:2px;
 flex:0 0 36px!important;width:36px!important;height:42px!important;border-radius:7px;
 background:#eef1f5!important;color:#6b788c!important;overflow:hidden!important;
}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge svg{width:21px;height:21px;flex:none}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge small{font-size:7px;line-height:1;font-weight:700;letter-spacing:.4px}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge img{width:100%;height:100%;object-fit:cover;border-radius:7px}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge[data-kind="pdf"]{background:#fceeed!important;color:#b85b54!important}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge[data-kind="word"]{background:#eaf2fc!important;color:#4278b8!important}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge[data-kind="sheet"]{background:#eaf5ee!important;color:#477e59!important}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge[data-kind="slides"]{background:#fff0e5!important;color:#b87439!important}
body :is(#chatAttachments,#projectChatMaterials,.chat-msg-attachments) .attachment-file-badge[data-kind="code"]{background:#f2ecfa!important;color:#8962ae!important}
html:root body :is(#sendBtn,#pSend):active{transform:scale(.9)!important}

/* Reference motion: a travelling purple dot matrix, not a progress spinner.
   Pending is indeterminate; only real lifecycle state ends the animation. */
body :is(#chatAttachments .chat-attachment,#projectChatMaterials .project-chat-material){
 gap:12px;min-height:68px;padding:12px;border-radius:10px;
 border-color:#e5e7eb;background:#fff;box-shadow:none;
}
body #chatAttachments .file-meta{gap:3px}
body #chatAttachments .file-meta b,body #projectChatMaterials .attachment-file-copy b{font-size:12px;font-weight:550;line-height:1.5;color:#30343b}
body #chatAttachments .file-meta span,body #projectChatMaterials .attachment-file-copy em{font-size:11px;line-height:1.5;color:#828791}
body :is(#chatAttachments .chat-attachment.is-uploading,#projectChatMaterials .project-chat-material.is-parsing){
 isolation:isolate;overflow:hidden;background:#181720;border-color:#302b42;
 min-height:76px;box-shadow:0 3px 10px #17132212;
}
body :is(#chatAttachments .chat-attachment.is-uploading,#projectChatMaterials .project-chat-material.is-parsing)::before{
 content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
 background-image:radial-gradient(circle,#d4afff 1.8px,transparent 2.1px);
 background-size:7px 7px;opacity:.65;
 -webkit-mask-image:linear-gradient(90deg,transparent,#000 35%,transparent 70%);
 mask-image:linear-gradient(90deg,transparent,#000 35%,transparent 70%);
 -webkit-mask-size:240% 100%;mask-size:240% 100%;
 animation:attachment-matrix-travel 2.6s ease-in-out infinite alternate;
}
@keyframes attachment-matrix-travel{from{-webkit-mask-position:100% 0;mask-position:100% 0;opacity:.65}to{-webkit-mask-position:0% 0;mask-position:0% 0;opacity:1}}
body #chatAttachments .is-uploading .file-meta,
body #projectChatMaterials .is-parsing .attachment-file-copy{position:relative;background:linear-gradient(90deg,#181720dd,#181720aa);border-radius:4px}
body #chatAttachments .is-uploading .file-meta b,
body #projectChatMaterials .is-parsing .attachment-file-copy b{color:#f4f0ff}
body #chatAttachments .is-uploading .file-meta span,
body #projectChatMaterials .is-parsing .attachment-file-copy em{color:#c2b9d5}
body #chatAttachments .is-uploading .chat-upload-actions button{color:#ded5ef;background:#181720bb}
/* Keep keyed nodes intact while removing the second, redundant spinner. */
body #chatAttachments .is-uploading .chat-upload-spinner,
body #projectChatMaterials .is-parsing>i{display:none}
body #chatAttachments .chat-upload-actions{margin-left:4px}
/* A receipt is a second row, never a flex child competing with the filename. */
body #chatAttachments{align-items:flex-start;max-height:min(320px,38vh)}
body #chatAttachments .chat-attachment:not(.is-image){
 display:grid;grid-template-columns:36px minmax(0,1fr) auto;
 width:272px;max-width:100%;box-sizing:border-box;gap:8px 10px;
}
body #chatAttachments .file-meta{min-width:0}
body #chatAttachments .file-meta b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body #chatAttachments .attachment-receipt-toggle{align-self:flex-start;padding:0;border:0;background:none;color:#858893;font-size:10px;text-align:left}
body #chatAttachments .extraction-receipt{
 grid-column:1/-1;width:100%;min-width:0;max-width:100%;box-sizing:border-box;
 margin:3px 0 0;padding:10px 0 0;border:0;border-top:1px solid #e8e9ee;
 border-radius:0;background:none;box-shadow:none;overflow-wrap:anywhere;
}
body #chatAttachments .extraction-receipt-head{display:flex;min-width:0;gap:8px}
body #chatAttachments .extraction-receipt-head b{flex:none;white-space:nowrap;font-size:11px;font-weight:550}
body #chatAttachments .extraction-receipt-head>span{display:none}
body #chatAttachments .extraction-receipt-details{gap:3px 10px;margin-top:6px;font-size:10px;line-height:1.6;color:#7a818e}
body #chatAttachments .extraction-receipt p{font-size:10px;line-height:1.6;color:#9297a0;margin:6px 0 0}
body #chatAttachments .extraction-receipt-actions{display:flex;flex-wrap:wrap;gap:6px}
@media(prefers-reduced-motion:reduce){
 body :is(#chatAttachments .chat-attachment.is-uploading,#projectChatMaterials .project-chat-material.is-parsing)::before{animation:none;opacity:.5}
}
