.chat-document-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  inline-size: min(21rem, 70vw);
  max-inline-size: 100%;
  padding: 5px 6px;
  border: 1px solid #d5e1db;
  border-radius: 10px;
  background: #f5faf7;
  color: #183c32;
}

.chat-message > .chat-document-card {
  display: grid;
  align-items: center;
  gap: 8px;
  margin-block: 3px 5px;
}

.chat-message.mine > .chat-document-card {
  border-color: #b4cebf;
  background: #eff7f1;
}

.chat-document-icon {
  display: block;
  width: 40px;
  height: 40px;
}

.chat-document-details {
  display: grid;
  gap: 3px;
  min-inline-size: 0;
}

.chat-document-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-document-size {
  color: #567168;
  font-size: 12px;
  line-height: 1.2;
}

.chat-document-card .chat-document-action {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  inline-size: 40px;
  block-size: 40px;
  min-block-size: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid #d6e3db;
  border-radius: 8px;
  background: #fff;
  color: #225a47;
  font-size: 23px;
  line-height: 1;
}

.chat-document-card .chat-document-action:hover:not(:disabled) {
  border-color: #8cb6a3;
  background: #e2f0e8;
}

.chat-document-card .chat-document-action:focus-visible {
  outline: 2px solid #28765b;
  outline-offset: 1px;
}

.chat-document-action[aria-busy="true"] {
  opacity: .55;
  cursor: wait;
}

.chat-document-download-mark {
  position: relative;
  width: 18px;
  height: 18px;
  background: linear-gradient(currentColor, currentColor) center 1px / 2px 9px no-repeat;
}

.chat-document-download-mark::before,
.chat-document-download-mark::after {
  position: absolute;
  content: '';
}

.chat-document-download-mark::before {
  top: 5px;
  left: 5.5px;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.chat-document-download-mark::after {
  inset: auto 1px 0;
  height: 4px;
  border: solid currentColor;
  border-width: 0 2px 2px;
  border-radius: 0 0 4px 4px;
}

#chat-transfer {
  flex: none;
  padding: 8px 10px 0;
}

#chat-transfer[hidden],
#chat-attachment-preview[hidden],
.chat-upload-card [hidden] {
  display: none;
}

.chat-upload-card {
  grid-template-columns: 40px minmax(0, 1fr);
  inline-size: min(30rem, 100%);
  gap: 12px;
  padding: 10px 12px;
  border-color: #80ac95;
}

.chat-upload-card.chat-upload-cancellable {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
}

.chat-upload-card .chat-upload-cancel {
  align-self: start;
}

.chat-upload-cancelled {
  margin: 0;
  color: #1d3c32;
  font-size: 13px;
  line-height: 1.3;
}

.chat-upload-card .chat-document-details {
  gap: 4px;
}

.chat-upload-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.3;
}

.chat-upload-percent {
  color: #245a43;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chat-upload-progress {
  display: block;
  appearance: none;
  inline-size: 100%;
  block-size: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #d6e7dc;
  accent-color: #2b7a54;
}

.chat-upload-progress::-webkit-progress-bar {
  background: #d6e7dc;
}

.chat-upload-progress::-webkit-progress-value {
  background: #2b7a54;
  border-radius: 4px;
}

.chat-upload-progress::-moz-progress-bar {
  background: #2b7a54;
  border-radius: 4px;
}

.chat-upload-retry {
  justify-self: start;
  padding: 6px 10px;
  border: 1px solid #8ab19e;
  border-radius: 7px;
  background: #fff;
  color: #225a47;
  font: inherit;
  font-size: 13px;
}

.chat-upload-retry:hover:not(:disabled) {
  background: #e2f0e8;
}
