/* Chat attachments use the same card and control styles in the portal and the floater. */
#compose .attachments:empty { display: none }

#compose .attachments {
  display: flex;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 3px;
  overscroll-behavior-inline: contain;
}

:is(#compose, .bubble-media) .mort-attachment {
  flex: 0 0 auto;
  width: min(118px, 100%);
  padding: 4px;
  border-color: var(--line);
  border-radius: 10px;
}

:is(#compose, .bubble-media) .mort-attachment-file {
  display: flex;
  align-items: center;
  min-height: 52px;
  width: min(164px, 100%);
  padding: 6px 8px;
}

.mort-attachment-description { min-width: 0 }

.mort-attachment-description strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mort-attachment-description small { margin-top: 2px }

#compose .mort-attachment-file .mort-attachment-description {
  max-width: calc(100% - 40px);
}

#compose .mort-attachment button.remove {
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}

#compose .mort-attachment-file button.remove { box-shadow: none }

#compose .mort-attachment-feedback:empty { display: none }

#compose .mort-attachment-feedback:not(:empty) {
  display: block;
  min-height: 0;
  margin: 5px 0;
  color: var(--text);
  line-height: 1.4;
}

#compose .mort-attachment-options[hidden],
#compose .mort-attachment-options [hidden] { display: none !important }

#compose .mort-attachment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

#compose .mort-attachment-options .btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 5px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

body.embedded-mort-chat #compose .compose-row > .embedded-chat-attach {
  display: grid;
  place-items: center;
  padding: 0;
  width: 100%;
  min-height: 44px;
  min-width: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--wash);
  color: #a94b13;
}

body.embedded-mort-chat #compose .compose-row > .embedded-chat-attach:hover {
  background: var(--paper);
}

#compose > .mort-attachment-help {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
}
