.composer.has-attachment-controls { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px; }
.composer.has-attachment-controls > .matrix-send-status { grid-column: 1 / -1; order: 4; }
.attachment-picker { position: relative; width: 36px; height: 36px; }
.attachment-menu { position: absolute; bottom: calc(100% + 12px); left: -4px; z-index: 40; display: grid; gap: 2px; width: 232px; max-width: calc(100vw - 40px); padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel, #fff); box-shadow: 0 8px 30px #16345a26, 0 2px 6px #16345a0a; }
.attachment-menu[hidden] { display: none !important; }
.attachment-menu.attachment-menu-below { top: calc(100% + 12px); bottom: auto; }
.attachment-menu-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 52px; padding: 7px 10px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.attachment-menu-item:hover, .attachment-menu-item:focus-visible { outline: none; background: #edf4ff; }
.attachment-menu-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; color: #fff; }
.attachment-menu-icon svg { width: 21px; height: 21px; }
.attachment-menu-icon-photo { background: #9674d5; }
.attachment-menu-icon-video { background: #508cdb; }
.attachment-menu-icon-file { background: #dfa548; }
.composer .attachment-file-input[hidden], .attachment-draft[hidden], .attachment-download-cancel[hidden] { display: none !important; }
.composer .attachment-clip { flex: 0 0 36px; width: 36px; height: 36px; padding: 7px; color: var(--muted); border-radius: 9px; }
.attachment-clip svg { display: block; width: 22px; height: 22px; }
.composer .attachment-clip:hover:not(:disabled) { color: var(--accent-strong); background: #eef5ff; }
.composer .attachment-clip[aria-expanded="true"] { color: var(--accent-strong); background: #eef5ff; }
.attachment-clip:disabled { opacity: .42; cursor: default; }
.attachment-clip:focus-visible, .attachment-text-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.composer.attachment-drop-target { border-color: var(--accent); background: #eef5ff; box-shadow: 0 0 0 3px #3478d41c; }
.attachment-draft { flex: 0 0 100%; grid-column: 1 / -1; order: 3; min-width: 0; padding: 10px 7px 6px; border-top: 1px solid var(--line); }
.attachment-draft-row, .attachment-file-row { display: flex; align-items: center; min-width: 0; gap: 10px; }
.attachment-draft-icon, .attachment-file-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 9px; background: #e4efff; color: var(--accent-strong); }
.attachment-draft-icon svg, .attachment-file-icon svg { width: 24px; height: 24px; }
.attachment-draft-image { width: 100%; height: 100%; object-fit: cover; }
.attachment-file-copy { display: grid; gap: 4px; flex: 1; min-width: 0; }
.attachment-file-name { display: block; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.attachment-file-size { color: var(--muted); font-size: 11px; line-height: 1.4; }
.attachment-text-button { flex: none; min-height: 32px; padding: 5px 8px; color: var(--accent-strong); background: transparent; border: 0; border-radius: 7px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.attachment-text-button:hover:not(:disabled) { background: #3478d414; }
.attachment-text-button:disabled { opacity: .5; cursor: default; }
.attachment-status { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.attachment-status.error { color: #a14d55; }
.attachment-cancel { margin: 4px 0 0 -8px; }
.message-attachment { min-width: 0; width: 280px; max-width: 100%; padding: 5px 0; }
.message-attachment .attachment-file-name { white-space: normal; overflow-wrap: anywhere; }
.attachment-image-holder:empty { display: none; }
.attachment-message-image { display: block; width: auto; max-width: 100%; max-height: 360px; margin-top: 10px; border-radius: 9px; object-fit: contain; }
.attachment-download-controls { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0 -8px; }
.attachment-inline-video { overflow: hidden; width: 100%; border-radius: 10px; background: #132131; color: #fff; }
.attachment-video-stage { position: relative; display: grid; place-items: center; min-height: 150px; aspect-ratio: 16 / 10; }
.attachment-message-video { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; background: #132131; }
.attachment-video-placeholder { position: absolute; width: 48px; height: 48px; color: #ffffff50; }
.attachment-video-center { z-index: 1; width: 48px; height: 48px; border: 1px solid #ffffff55; border-radius: 50%; color: #fff; background: #132131aa; font-size: 21px; cursor: pointer; }
.attachment-video-controls { display: flex; align-items: center; gap: 7px; padding: 4px 7px; min-height: 40px; }
.attachment-video-controls button { flex: none; width: 30px; min-height: 32px; padding: 0; color: #fff; background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.attachment-video-controls input { flex: 1; min-width: 25px; width: 0; padding: 0; accent-color: #a9ceff; }
.attachment-video-time { flex: none; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.attachment-inline-video button:disabled { opacity: .5; cursor: default; }
.attachment-inline-video button:focus-visible { outline: 2px solid #a9ceff; outline-offset: 1px; }
.attachment-inline-video [hidden] { display: none !important; }
.attachment-inline-video .attachment-status:not(:empty) { margin: 0; padding: 0 9px 7px; color: #cfdef0; }
[data-theme="dark"] .composer .attachment-clip:hover:not(:disabled),
[data-theme="dark"] .composer .attachment-clip[aria-expanded="true"],
[data-theme="dark"] .composer.attachment-drop-target { background: #213b5d; }
[data-theme="dark"] .attachment-menu { box-shadow: 0 8px 30px #0006; }
[data-theme="dark"] .attachment-menu-item:hover, [data-theme="dark"] .attachment-menu-item:focus-visible { background: #213b5d; }
[data-theme="dark"] .attachment-draft-icon, [data-theme="dark"] .attachment-file-icon { background: #28476e; color: #b9d8ff; }
[data-theme="dark"] .attachment-text-button { color: #a9ceff; }
[data-theme="dark"] .attachment-status.error { color: #f2a3ac; }
@media (max-width: 480px) {
  .attachment-draft-row { gap: 7px; }
  .attachment-draft { padding-right: 2px; padding-left: 2px; }
  .message-attachment { width: 230px; }
  .attachment-message-image { max-height: 280px; }
}
