.attachment-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;margin:14px 0;background:#171418;overflow:hidden;border-radius:10px}
.attachment-grid>a{grid-column:span 3;aspect-ratio:1;position:relative;display:grid;place-items:center;overflow:hidden;background:#28232a;color:#fff}
.attachment-grid>a[hidden]{display:none}
.attachment-grid>a:focus-visible{outline:3px solid #fff;outline-offset:-4px;z-index:1}
.attachment-grid img{width:100%;height:100%;object-fit:contain;display:block}
.attachment-grid.count-1>a,.attachment-grid.count-3>a:first-child{grid-column:span 6;aspect-ratio:16/9}
.attachment-grid.count-5>a:nth-child(n+3){grid-column:span 2}
.attachment-grid:has([data-attachment=video])>a{aspect-ratio:16/9}
.attachment-icon{display:grid;place-items:center;gap:6px;padding:10px;color:#f7e9e5;text-align:center}
.attachment-icon .ic{width:28px;height:28px}
.attachment-overflow{position:absolute;inset:0;display:grid;place-items:center;background:#0009;color:white;font-size:clamp(23px,5vw,44px);font-weight:700}
#attachment-viewer{width:max-content;max-width:calc(100% - 20px);max-height:calc(100% - 20px);padding:10px;border:1px solid #4e4850;border-radius:12px;background:#171418;color:white}
#attachment-viewer::backdrop{background:#000d}
#attachment-viewer header,#attachment-viewer .attachment-controls{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:4px}
#attachment-viewer .attachment-controls[hidden]{display:none}
#attachment-viewer button{min-width:44px;min-height:44px;color:inherit;border:1px solid #6a626b;border-radius:7px;background:#302a31;cursor:pointer}
.attachment-stage img,.attachment-stage video{display:block;max-width:min(1050px,calc(100vw - 44px));max-height:calc(100dvh - 155px);object-fit:contain}
.attachment-stage video{width:min(1000px,calc(100vw - 44px))}
body:has(#attachment-viewer[open]){overflow:hidden}

.poster-play{position:absolute;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:#141318d9;color:white;font-size:18px}

.attachment-drop{border:1px dashed #ad7c80;border-radius:12px;padding:18px;margin:14px 0 8px}
.attachment-drop p{margin:6px 0 10px}
.attachment-drop.is-dragging{outline:2px solid #e58e99;background:#a4435720}
#thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(180px,100%),1fr));gap:10px}
.composer-attachment{min-width:0;border-radius:8px;border:1px solid #8a737655;overflow:hidden}
.composer-attachment img,.composer-attachment video{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;background:#181419}
.composer-attachment>div{display:flex;flex-wrap:wrap;gap:6px;padding:7px}
.composer-attachment button[aria-pressed=true]{border:1px solid #e58e99}

.attachment-grid.count-1:has(img){background:transparent}
.attachment-grid.count-1>a:has(img){aspect-ratio:auto;background:transparent;min-width:0}
.attachment-grid.count-1 img{height:auto;max-height:min(680px,82svh);border-radius:10px}
.attachment-grid.count-1 .is-portrait img{width:auto;max-width:100%}
.attachment-grid:not(.count-1):has(.is-portrait):not(:has(a:not([hidden]):not(.is-portrait)))>a{aspect-ratio:4/5}

.poll-card { margin: 1rem 0; }
.poll-option { min-width: 0; }
.poll-option .attachment-grid { max-width: 18rem; margin: 0 0 .5rem; }
.poll-option progress { display: block; width: 100%; }
.poll-editor-option { margin: .75rem 0; }
.poll-editor-option [data-poll-status] { overflow-wrap: anywhere; }
