/* The download control fills the card; menu and cancel controls are siblings. */
/* Stack the upper transfer control and lower menu without overlapping hit targets. */
.message-file-body { position:relative; }
.message-file { position:relative; display:block; width:100%; max-width:100%; padding:0; border:0; border-radius:10px; background:var(--input); }
.message-file .message-file-download { display:grid; grid-template-columns:32px minmax(0,1fr) 44px; align-items:center; gap:10px; width:100%; min-height:88px; padding:10px 12px; margin:0; border:1px solid var(--border); border-radius:10px; background:transparent; color:var(--text); text-align:left; font-size:13px; font-weight:400; }
.message-file .message-file-download:hover:not(:disabled) { background:var(--hover); }
.message-file .message-file-download:disabled { opacity:1; }
.message-file .message-file-download:focus-visible { outline-offset:-3px; }
.message-file .message-file-document { position:relative; display:grid; place-items:center; width:32px; height:32px; color:var(--muted); }
.message-file-document>svg { display:block; width:28px; height:28px; }
.message-file .message-file-type { position:absolute; top:17px; left:50%; transform:translateX(-50%); min-width:28px; padding:2px 3px; border:1px solid var(--muted); border-radius:3px; background:var(--input); color:var(--text); font-size:8px; font-weight:500; line-height:10px; text-align:center; white-space:nowrap; }
.message-file-copy { display:flex; min-width:0; flex-direction:column; gap:3px; }
.message-file .message-file-name { overflow-wrap:anywhere; font-size:13px; font-weight:400; line-height:1.45; }
.message-file .message-file-details { color:var(--muted); font-size:11px; line-height:1.4; }
.message-file .message-file-action { position:absolute; top:4px; right:12px; display:grid; place-items:center; width:44px; height:44px; color:var(--muted); }
.message-file-action-icon { width:24px; height:24px; }
.message-file-ring { width:44px; height:44px; fill:none; stroke:var(--accent); stroke-width:2; transform:rotate(-90deg); }
.message-file-track { opacity:.2; }
.message-file-completed { stroke-linecap:round; }
.message-file-ring.indeterminate { animation:file-card-spin 1s linear infinite; }
.message-file .message-file-menu { position:absolute; bottom:0; right:14px; display:grid; place-items:center; width:40px; height:40px; min-height:40px; padding:8px; margin:0; background:transparent; border:0; border-radius:8px; color:var(--muted); opacity:0; pointer-events:none; }
.message-file .message-file-cancel { position:absolute; top:5px; right:13px; display:grid; place-items:center; width:42px; height:42px; min-height:42px; padding:0; margin:0; background:transparent; border:0; border-radius:50%; color:var(--muted); }
.message-file .message-file-progress,.message-file .message-file-notice { display:block; padding:0 12px 8px; color:var(--muted); font-size:12px; }
.message-file .message-file-error { margin:0; padding:0 12px 10px; color:var(--error); font-size:12px; line-height:1.4; }
.v2-chat-shell .bubble.file-bubble { width:370px; padding:5px 5px 7px; }
.v2-chat-shell .file-bubble>.message-actions { justify-content:flex-end; margin:5px 7px 0; }
.v2-chat-shell .file-bubble>.message-actions>small { margin-right:0; margin-left:auto; }
.file-bubble>.message-rich-text,.file-bubble>.group-sender,.file-bubble>.message-forwarded,.file-bubble>.message-edited,.file-bubble>.message-mutation-pending,.file-bubble>.message-reactions { margin-left:7px; margin-right:7px; }
.file-bubble>.group-sender { display:block; margin-top:5px; margin-bottom:7px; }
.file-bubble>.message-rich-text:not(:empty) { margin-top:8px; }
.message-file:hover .message-file-menu,.message-file:focus-within .message-file-menu,.message-file .message-file-menu[aria-expanded="true"] { opacity:1; pointer-events:auto; }
@media (hover:none),(any-pointer:coarse) { .message-file .message-file-menu { opacity:1; pointer-events:auto; } }
@keyframes file-card-spin { to { transform:rotate(270deg); } }
@media (prefers-reduced-motion:reduce) { .message-file-ring.indeterminate { animation:none; } }
@media (max-width:650px) {
    .message-file .message-file-download { gap:8px; padding:10px; }
    .message-file .message-file-action { right:10px; }
    .message-file .message-file-cancel { right:11px; }
    .message-file .message-file-menu { right:12px; }
}

.message-file .message-file-cancel-upload { display:block; margin:0 8px 6px auto; padding:4px 8px; min-height:32px; border:0; background:transparent; color:var(--muted); font-size:12px; font-weight:400; }
