.document-card,
#app #messages .document-download.document-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(304px, 100%);
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  background: color-mix(in srgb, var(--ui-pane) 82%, var(--ui-accent-surface));
  color: var(--ui-text);
  text-decoration: none;
}
#app #messages .document-download.document-card:is(:hover, :focus-visible),
a.document-card:is(:hover, :focus-visible) { background: var(--ui-hover); }
#app #messages .document-download.document-card::before,
#app #messages .document-download.document-card::after { content: none; }
.document-card-icon {
  flex: none;
  width: 32px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #50586b;
}
.document-card-icon::before, .document-card-download::before {
  content: '';
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
}
.document-card-icon::before { mask: var(--document-glyph) center / contain no-repeat; }
[data-document-kind='pdf'] .document-card-icon { background: #be1d35; }
[data-document-kind='word'] .document-card-icon { background: #235ba3; }
[data-document-kind='sheet'] .document-card-icon { background: #08794a; }
[data-document-kind='slides'] .document-card-icon { background: #ad4525; }
.document-card-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.document-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.document-card-body small { color: var(--ui-muted); }
.document-card-download {
  flex: none;
  color: var(--ui-muted);
}
.document-card-download::before { mask: url('/assets/lucide/download.svg') center / contain no-repeat; }
#app #messages > .bubble[data-media-kind='document'],
#app #telegramMessages > .telegram-message:has(> .document-card) { width: min(320px, 76%); }
#app #messages .bubble[data-media-kind='document'] .document-card,
#app #telegramMessages > .telegram-message > .document-card { width: 100%; min-height: 56px; }
.document-preview { display: grid; justify-items: start; gap: 8px; width: min(100%, 560px); min-width: 0; }
.document-preview pre, .document-preview iframe {
  width: 100%;
  margin: 0;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-pane);
  color: var(--ui-text);
}
.document-preview pre { padding: 12px; max-height: 22dvh; overflow: auto; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-preview iframe { height: min(38dvh, 280px); }
#attachmentFilePreview:has(#whatsAppDocumentPreview:not([hidden])) { width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; }
#attachmentFilePreview:has(#whatsAppDocumentPreview:not([hidden])) > :is(#attachmentFileIcon, #attachmentFileName, #attachmentFileDetails) { display: none; }
#whatsAppDocumentPreview { width: 100%; }
.telegram-document-preview { grid-column: 2; align-self: stretch; }
.telegram-document-preview iframe { height: min(30dvh, 230px); }
.telegram-chat-identity { min-width: 0; display: grid; gap: 2px; }
#telegramChatMembers { color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
