.chat-media-composer{min-width:0;padding:.35rem .7rem;border-top:1px solid var(--line,var(--border,#dbe5e2));color:var(--ink,#153932)}
.chat-media-actions{display:flex;flex-wrap:wrap;gap:.1rem .65rem;align-items:center}
.chat-media-action{display:inline-flex;align-items:center;justify-content:center;gap:.3rem;min-height:38px;max-width:100%;padding:.2rem 0;border:0;background:transparent;color:var(--action,#08796f);font:inherit;font-size:.8rem;font-weight:500;cursor:pointer;text-underline-offset:.2em;transition:transform 120ms cubic-bezier(.23,1,.32,1)}
.chat-media-action svg{width:17px;height:17px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.chat-media-action:active{transform:scale(.97)}
.chat-media-action:focus-visible{outline:2px solid var(--action,#08796f);outline-offset:3px}
.chat-media-action:disabled{opacity:.55;cursor:wait}
.chat-media-action[hidden]{display:none}
.chat-media-preview,.chat-media-received{display:flex;align-items:center;flex-wrap:wrap;gap:.25rem .7rem;min-width:0;overflow-wrap:anywhere}
.chat-media-preview:empty{display:none}
.chat-media-preview{padding:.35rem 0;font-size:.8rem}
.chat-media-preview audio,.chat-media-received audio{display:block;width:min(100%,280px);max-width:100%;height:40px}
.chat-media-status{margin:.15rem 0;font-size:.75rem;line-height:1.5;color:var(--muted,#46645c);overflow-wrap:anywhere}
.chat-media-status:empty{display:none}
.chat-media-received>.chat-media-status{flex-basis:100%}
@media(hover:hover) and (pointer:fine){.chat-media-action:hover{text-decoration:underline}}
@media(max-width:600px){.chat-media-action{min-height:44px}.chat-media-composer{padding:.3rem .5rem}}
@media(prefers-reduced-motion:reduce){.chat-media-action{transition:none}.chat-media-action:active{transform:none}}
/* Contextual sending shares the form's single primary action. */
.chat-media-composer [hidden]{display:none!important}
.chat-context-send svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.chat-context-send{min-width:44px;min-height:44px;flex-shrink:0}
.chat-record-bar{display:flex;align-items:center;flex-wrap:wrap;gap:.2rem .7rem;padding:.35rem 0}
.chat-record-clock{font-size:.85rem;font-variant-numeric:tabular-nums;color:var(--ink,#153932)}
.chat-record-level{width:60px;height:12px;accent-color:var(--action,#08796f)}
.chat-media-preview img,.chat-media-preview video,.chat-media-received img,.chat-media-received video{display:block;max-width:100%;max-height:240px;object-fit:contain;border-radius:6px}
.chat-media-preview>span{flex-basis:100%}
.chat-attachment-menu{display:flex;gap:.8rem;flex-wrap:wrap;padding:.25rem 0}
.chat-media-composer[data-state=recording] .chat-record-clock{color:var(--danger,#a42f3c)}
.chat-media-actions .icon-action{min-width:44px;min-height:44px}
.chat-media-composer .icon-action{touch-action:none}
.has-chat-media textarea{caret-color:var(--action,#08796f)}
@media(max-width:600px){.chat-record-bar{gap:.15rem .6rem}.chat-record-level{width:40px}.chat-record-bar .chat-media-action{font-size:.8rem}.chat-media-preview video{max-height:190px}}

.chat-media-open{display:flex;flex-direction:column;align-items:flex-start;text-align:left;overflow-wrap:anywhere}
.chat-media-dialog{width:min(900px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:24px;border:0;border-radius:14px;background:var(--surface,#fff);color:var(--ink,#153932);box-shadow:0 24px 80px #163d3b38;font:inherit;overflow:auto;overscroll-behavior:contain}
.chat-media-dialog::backdrop{background:#102b2ab3}
.chat-media-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:12px}
.chat-media-dialog h2{margin:0;font-size:18px;line-height:1.4;font-weight:500;overflow-wrap:anywhere}
.chat-media-close{flex:none}
.chat-media-dialog>footer{display:flex;justify-content:flex-end;margin-top:14px}
.chat-media-viewer{display:grid;place-items:center;min-height:120px;min-width:0;margin:16px 0}
.chat-media-dialog .chat-media-viewer img,.chat-media-dialog .chat-media-viewer video{max-height:65dvh;width:auto;max-width:100%;object-fit:contain}
.chat-media-dialog .chat-media-viewer audio{width:min(100%,540px);height:48px}
.chat-media-zoom{display:flex;align-items:center;flex-wrap:wrap;gap:4px 18px;margin-bottom:10px}
.chat-media-zoom output{min-width:4ch;text-align:center;font-size:.8rem;font-variant-numeric:tabular-nums;color:var(--ink,#153932)}
.chat-media-dialog .chat-media-zoomable{display:block;height:60dvh;min-height:180px;max-width:100%;overflow:auto;overscroll-behavior:contain;background:var(--page,#edf2f1);scrollbar-color:var(--muted,#46645c) transparent;touch-action:pan-x pan-y pinch-zoom}
.chat-media-zoomable:focus-visible{outline:2px solid var(--action,#08796f);outline-offset:3px}
.chat-media-dialog .chat-media-zoomable .chat-media-image{display:block;max-width:none;max-height:none;margin:12px auto;object-fit:contain;border-radius:0}
.chat-media-pdf-page{position:relative;margin:12px auto;background:#fff;box-shadow:0 2px 6px #102b2a20}
.chat-media-pdf-page canvas{display:block;max-width:none;max-height:none}
@media(max-width:600px){.chat-media-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px);padding:18px}.chat-media-zoom{gap:4px 14px}.chat-media-dialog .chat-media-zoomable{height:56dvh}.chat-media-dialog>header{gap:12px}.chat-media-dialog h2{font-size:16px}}
.chat-media-received img[hidden],.chat-media-viewer img[hidden]{display:none!important}
.chat-media-received>.chat-media-open:has(img){padding:0;max-width:100%;min-height:44px}
.chat-media-received>.chat-media-open:has(img)>img{width:auto;max-width:min(100%,320px);height:auto}
.chat-media-received>audio{flex:1 1 240px;min-width:0;max-width:100%;color-scheme:light dark}
