
.attachment-trigger.button {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: .35rem .65rem;
  font-size: 1.12rem;
  line-height: 1;
  flex: 0 0 auto;
}
.attachment-trigger[hidden], .attachment-card [hidden], .attachment-dialog [hidden] { display: none !important; }
.attachment-card.bubble { max-width: min(100%, 36rem); }
.attachment-card .attachment-name, .attachment-title { overflow-wrap: anywhere; }
.attachment-card p, .attachment-panel p { margin: .4rem 0; }
.attachment-notice, .attachment-state { font-size: .88em; }
.attachment-warning, .attachment-error { color: #8a421d; font-weight: 650; }
.attachment-expired { font-style: italic; }
.attachment-dialog {
  box-sizing: border-box;
  width: min(34rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  padding: 1.35rem;
  border: 1px solid #d2c7a8;
  border-radius: .6rem;
  background: #fffaf0;
  color: #142229;
}
.attachment-dialog::backdrop { background: #14222988; }
.attachment-title { margin: 0 0 .7rem; }
.attachment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .65rem; }
.attachment-card .attachment-actions .button, .attachment-dialog .attachment-actions .button {
  min-height: 2.75rem;
  padding: .4rem .65rem;
  font-size: .88em;
}
.attachment-progress, .attachment-player { display: block; width: 100%; margin-top: .65rem; }
.attachment-photo-preview { display: block; max-width: 100%; max-height: 52vh; width: auto; height: auto; object-fit: contain; }
@media (max-width: 420px) {
  .attachment-dialog { padding: .85rem; }
  .attachment-actions { gap: .3rem; }
}

.attachment-inline{min-height:8rem;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:.5rem;margin:.65rem 0;max-width:100%;overflow:hidden;background:#f3eddf;border-radius:.5rem}
.attachment-inline .attachment-photo-preview{display:block;max-width:100%;max-height:32rem;width:auto;height:auto;object-fit:contain}
.media-toolbar{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center;margin:.45rem 0;grid-column:1/-1}
.media-button{min-height:2.75rem;min-width:2.75rem;padding:.35rem .7rem}
.media-emoji-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(2.75rem,1fr));gap:.4rem;margin:.75rem 0}
.media-emoji-grid .media-button{font-family:system-ui,sans-serif;font-size:1.5rem;line-height:1}
.gif-search{display:flex;gap:.5rem;flex-wrap:wrap}.gif-search input{flex:1;min-width:8rem;max-width:100%;padding:.55rem}
.gif-results{display:grid;gap:.5rem;margin-top:.75rem}.gif-results .button{text-align:left;overflow-wrap:anywhere}
.media-text>p{white-space:pre-wrap;margin:0}.media-link{display:flex;align-items:center;gap:.7rem;border:1px solid #d7cbb5;border-radius:.55rem;background:#fffaf0;color:#142229;text-decoration:none;margin-top:.65rem;padding:.6rem;max-width:100%;overflow:hidden}
.media-link-copy{display:flex;flex-direction:column;min-width:0;overflow-wrap:anywhere}.media-link-copy small{font-size:.8em;color:#647077}.media-youtube-image{width:7rem;max-width:35%;aspect-ratio:4/3;object-fit:cover;border-radius:.3rem;flex-shrink:0}
.audio-controls button[aria-pressed=true]{background:#f7b81b;color:#032133;border-color:#b68210;box-shadow:inset 0 0 0 1px #b68210}
@media(max-width:420px){.media-toolbar{gap:.35rem}.media-link{gap:.45rem}.media-youtube-image{width:5rem}}
