/* Attachment choice uses a sheet on phones and a compact panel on wide screens. */
.composer-attachment-previews{display:flex;align-items:flex-start;gap:8px;overflow:auto;padding:4px 2px 8px;max-height:220px;scrollbar-width:thin;min-width:0}
.composer-preview-tile{position:relative;flex:0 0 94px;width:94px;min-width:0;border-radius:11px;overflow:hidden;background:var(--tint)}
.composer-preview-open{position:relative;display:block;width:100%;height:94px;border:0;padding:0;background:transparent;text-align:left;color:var(--ink)}
.composer-preview-open>img,.composer-preview-open>video{display:block;width:100%;height:100%;object-fit:cover}
.composer-preview-number{position:absolute;top:5px;left:5px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:50%;background:var(--green);color:#fff;font-size:10px;font-weight:650;box-shadow:0 0 0 1px #ffffffb3}
.composer-preview-remove{position:absolute;right:3px;top:3px;display:grid;place-items:center;width:29px;height:29px;min-height:29px;padding:7px;border:0;border-radius:50%;color:#fff;background:#233d32c9;cursor:pointer;z-index:2}
.composer-preview-remove svg{width:16px;height:16px}
.composer-preview-type{position:absolute;bottom:5px;left:5px;width:22px;height:22px;padding:3px;border-radius:5px;background:#233d32bb;color:white}
.composer-preview-type svg{width:16px;height:16px}
.composer-preview-document{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;height:100%;padding:10px 6px;font-size:11px;line-height:1.25;overflow-wrap:anywhere}
.composer-preview-document>svg{width:27px;height:27px;flex:none;color:var(--green)}
.composer-preview-document>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:100%;text-align:center}
.composer-preview-review{display:block;padding:4px 3px;text-align:center;font-size:9px;line-height:1.2;color:var(--green)}
.composer-preview-voice{position:relative;flex:1 0 min(100%,330px);max-width:420px;padding:4px 34px 2px 0;min-width:0}
.composer-preview-voice>audio{display:block;width:100%;height:44px}
.composer-preview-voice>.composer-preview-remove{right:0;top:13px}
.composer-preview-video{position:relative;flex:0 0 220px;max-width:100%;border-radius:11px;overflow:hidden}
.composer-preview-video>video{display:block;width:100%;max-height:185px;object-fit:contain;background:#183025}
.composer-reused-count{align-self:center;flex:none;padding:8px;font-size:12px;color:var(--sub)}
.composer-attachments.composer-attachment-sheet{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;z-index:1000;padding:20px;margin:0;border:0;background:transparent;overflow:hidden;display:flex;align-items:flex-end;justify-content:flex-end;isolation:isolate}
.composer-attachment-sheet::backdrop{background:transparent}
.composer-attachment-backdrop{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:#12251b66;z-index:-1}
.composer-attachment-surface{display:flex;flex-direction:column;width:min(520px,100%);height:var(--attachment-sheet-height,min(690px,82dvh));max-height:calc(100dvh - 40px);border-radius:20px;background:var(--paper);color:var(--ink);box-shadow:0 18px 70px #0c24184d;overflow:hidden;animation:attachment-sheet-enter 170ms cubic-bezier(.2,.8,.2,1)}
.composer-attachment-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 15px 5px;flex:none}
.composer-attachment-heading h2{font-size:18px}
.composer-attachment-heading>.composer-icon{width:44px;height:44px;min-width:44px;min-height:44px;padding:11px;border:0;border-radius:50%;background:transparent;color:var(--sub)}
.composer-attachment-heading>.composer-icon:hover,.composer-attachment-heading>.composer-icon:focus-visible{background:var(--tint);color:var(--green)}
.composer-attachment-handle{display:flex;align-items:center;justify-content:center;height:17px;flex:none;touch-action:none;cursor:ns-resize}
.composer-attachment-handle>span{width:36px;height:4px;border-radius:4px;background:var(--line)}
.composer-attachment-shortcuts{display:flex;align-items:stretch;gap:6px;padding:0 12px 12px;flex:none}
.composer-attachment-source{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;padding:7px 2px;border:0;border-radius:11px;background:transparent;color:var(--ink);font-size:11px;line-height:1.25;text-align:center;min-width:0}
.composer-attachment-source>span{display:grid;place-items:center;width:44px;height:44px;padding:11px;border-radius:15px;color:var(--green);background:var(--tint)}
.composer-attachment-source svg{width:22px;height:22px}
.composer-native-picker{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;pointer-events:none;clip-path:inset(50%)}
.composer-attachment-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 14px 12px;scrollbar-width:thin}
.composer-picker-selected{display:grid;grid-template-columns:repeat(auto-fill,minmax(85px,1fr));gap:6px}
.composer-picker-selected:empty{display:none}
.composer-picker-selected .composer-preview-tile{width:100%;height:100%;border-radius:9px}
.composer-picker-selected .composer-preview-open{height:100%;min-height:90px;aspect-ratio:1}
.composer-picker-selected .composer-preview-review{position:absolute;bottom:0;left:0;right:0;background:#e9f0e8ed}
.composer-picker-intro{font-size:12px;line-height:1.45;color:var(--sub);padding:13px 2px 5px}
.composer-attachment-body .attachment-editor{margin:10px 0 0;padding:0;border:0}
.composer-attachment-body .attachment-queue{gap:10px}
.composer-attachment-body .attachment-item{padding:12px}
.composer-attachment-body .attachment-item-head{align-items:flex-start}
.composer-attachment-body .attachment-item-head>strong{font-size:13px}
.composer-attachment-body .attachment-item-head>.text-button{font-size:11px;white-space:nowrap}
.composer-attachment-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;padding:10px 14px;border-top:1px solid var(--line);font-size:12px;color:var(--sub)}
.composer-attachment-footer>.button{min-height:40px;padding:8px 18px}
.composer-camera{padding:8px;border-radius:12px;background:var(--tint);margin:0 0 12px}
.composer-camera>video{display:block;width:100%;height:min(42dvh,320px);object-fit:contain;background:#10271b;border-radius:8px;transform:none}
.composer-camera-status,.composer-camera-message{font-size:12px;line-height:1.4;color:var(--sub);padding:8px 2px}
.composer-camera-actions{display:flex;justify-content:space-between;gap:10px}
.composer-camera-actions>.button{flex:1;min-height:42px}
@keyframes attachment-sheet-enter{from{opacity:.45;transform:translateY(16px)}to{opacity:1;transform:none}}
@media(max-width:759px){.composer-attachments.composer-attachment-sheet{padding:0;justify-content:center}.composer-attachment-surface{width:100%;max-height:calc(100dvh - 36px);height:var(--attachment-sheet-height,min(76dvh,660px));border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}.composer-attachment-shortcuts{gap:3px}.composer-attachment-source{font-size:10px}.composer-attachment-body{padding-inline:10px}}
@media(prefers-reduced-motion:reduce){.composer-attachment-surface{animation:none}}

/* Recent device photographs fill the sheet immediately after user permission. */
.composer-attachments.composer-attachment-sheet{justify-content:center;padding:20px}
.composer-attachment-surface{width:min(620px,100%);height:var(--attachment-sheet-height,min(66dvh,670px));max-height:calc(100dvh - 40px)}
.composer-attachment-heading{padding:0 12px 3px}.composer-attachment-heading h2{font-size:17px}
.composer-attachment-body{padding:0 4px 8px}
.composer-device-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;padding:0;min-height:0}
.composer-device-gallery[hidden],.composer-picker-review[hidden]{display:none}
.composer-gallery-item,.composer-gallery-camera,.composer-gallery-system{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;aspect-ratio:1;min-width:0;min-height:0;padding:0;border:0;border-radius:0;overflow:hidden;background:var(--tint);color:var(--green);font-size:11px;line-height:1.3;text-align:center;cursor:pointer}
.composer-gallery-item>img{display:block;width:100%;height:100%;object-fit:cover;transition:transform 120ms ease,filter 120ms ease}
.composer-gallery-camera>span:first-child,.composer-gallery-system>span:first-child{display:grid;place-items:center;width:38px;height:38px}.composer-gallery-camera svg,.composer-gallery-system svg{width:32px;height:32px}
.composer-gallery-camera>span:last-child,.composer-gallery-system>span:last-child{padding-inline:5px}
.composer-gallery-system{background:var(--paper);border:1px solid var(--line);font-size:10px}
.composer-gallery-check{position:absolute;right:6px;top:6px;display:grid;place-items:center;width:23px;height:23px;border:2px solid #ffffffe6;border-radius:50%;background:#17362433;color:white;font-size:12px;font-weight:600;box-shadow:0 0 2px #1234}
.composer-gallery-item.is-selected>img{transform:scale(.92);border-radius:9px;filter:brightness(.92)}
.composer-gallery-item.is-selected>.composer-gallery-check{background:var(--green);border-color:white}
.composer-gallery-video{position:absolute;bottom:6px;left:6px;padding:2px 5px;border-radius:5px;background:#1d302aa1;color:#fff;font-size:11px}
.composer-gallery-status{font-size:12px;line-height:1.45;color:var(--sub);padding:8px 10px;margin:0}.composer-gallery-status:empty{display:none}
.composer-gallery-more{display:block;margin:8px auto}.composer-gallery-more[hidden]{display:none}
.composer-attachment-shortcuts{padding:7px 10px 4px;border-top:1px solid var(--line);justify-content:center;gap:12px}
.composer-attachment-source{flex:0 1 120px;font-size:11px;padding:4px 2px;gap:3px}.composer-attachment-source>span{width:35px;height:35px;padding:7px;border-radius:12px;background:transparent}.composer-attachment-source.is-active{color:var(--green);background:var(--tint)}
.composer-attachment-footer{padding:8px 12px;font-size:11px}.composer-gallery-footer-actions{display:flex;gap:10px;align-items:center}.composer-gallery-footer-actions>.button{min-height:38px;padding:8px 15px;font-size:12px}.composer-gallery-footer-actions>[hidden]{display:none}
.composer-picker-review{padding:6px 10px}.composer-picker-review .composer-picker-selected{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}.composer-gallery-caption{display:flex;flex-direction:column;gap:5px;margin:12px 0 6px;font-size:12px;color:var(--sub)}.composer-gallery-caption>textarea{width:100%;min-height:68px;max-height:140px;resize:vertical;border:1px solid var(--line);border-radius:12px;background:var(--paper);padding:10px 12px;color:var(--ink);font:inherit;font-size:14px}.composer-picker-file-review{font-size:12px;color:var(--sub);margin-top:12px}.composer-picker-file-review>summary{cursor:pointer;padding:8px 0}
.composer-attachment-sheet:not(.has-native-gallery) .composer-attachment-surface,.composer-attachment-sheet.is-gallery-unavailable .composer-attachment-surface{height:var(--attachment-sheet-height,auto);max-height:calc(100dvh - 40px)}
@media(max-width:759px){.composer-attachments.composer-attachment-sheet{padding:0}.composer-attachment-surface{width:100%;height:var(--attachment-sheet-height,min(68dvh,670px));max-height:calc(100dvh - 32px)}.composer-attachment-body{padding-inline:3px}.composer-device-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.composer-attachment-shortcuts{gap:4px}.composer-gallery-footer-actions{gap:6px}.composer-gallery-footer-actions>.button{padding-inline:12px}.composer-attachment-sheet:not(.has-native-gallery) .composer-attachment-surface,.composer-attachment-sheet.is-gallery-unavailable .composer-attachment-surface{max-height:calc(100dvh - 32px)}}
@media(prefers-reduced-motion:reduce){.composer-gallery-item>img{transition:none}}

/* One sheet: select media, add a message and send without another screen. */
.composer-attachment-shortcuts{align-items:center;gap:4px}.composer-attachment-source{flex:1 1 0;max-width:120px}.composer-gallery-send{flex:none;margin-left:auto;min-height:40px;padding:9px 13px;font-size:12px;white-space:nowrap}.composer-attachment-footer>.composer-gallery-caption{width:100%;margin:0}.composer-attachment-footer .composer-gallery-caption>textarea{min-height:42px;max-height:110px;resize:none;padding:11px 12px}.composer-picker-selected{margin-bottom:8px}.composer-transfer-progress{position:absolute;bottom:3px;right:4px;max-width:calc(100% - 8px);font-size:10px;padding:2px 5px;background:#183b2ee8;color:#fff;border-radius:5px}.composer-preview-voice>.composer-transfer-progress{position:static;display:inline-block}.composer-picker-review:has(.composer-picker-selected:empty){display:none}
@media(max-width:380px){.composer-attachment-source{font-size:9px}.composer-gallery-send{padding-inline:9px;font-size:11px}}
