.portal-message-menu[hidden],
.portal-selection-bar[hidden],
.portal-forward-dialog[hidden],
.portal-compose-context[hidden] { display: none !important; }

body.portal-dialog-open { overflow: hidden; }

.portal-message-shell {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.portal-message-shell--own { justify-content: flex-end; }
.portal-message-shell--other { justify-content: flex-start; }
.portal-message-shell .portal-message {
  position: relative;
  align-self: auto;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.portal-message-shell--flash .portal-message {
  box-shadow: 0 0 0 3px rgba(58, 128, 191, 0.25), 0 5px 18px rgba(29, 25, 27, 0.08);
}
.portal-message-shell--selected .portal-message {
  box-shadow: 0 0 0 3px rgba(58, 128, 191, 0.3), 0 5px 18px rgba(29, 25, 27, 0.08);
}
.portal-message--pinned { border-color: rgba(58, 128, 191, 0.34); }

.portal-message-menu-trigger {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 4px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(238, 242, 245, 0.9);
  color: #66737e;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
}
.portal-message-menu-trigger > span {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg);
}
.portal-message:hover .portal-message-menu-trigger,
.portal-message-menu-trigger:focus-visible,
.portal-message-menu-trigger[aria-expanded="true"] { opacity: 1; }
.portal-message-menu-trigger:hover { background: #e1e8ed; color: #33424f; }
.portal-message .portal-message-meta { padding-right: 20px; }

.portal-message-select {
  width: 0;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: none;
  place-items: center;
  flex: 0 0 0;
  background: #fff;
  color: #3d83c5;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #a9b3bc;
}
.portal-chat--selecting .portal-message-select {
  width: 28px;
  display: grid;
  flex-basis: 28px;
}
.portal-chat--selecting .portal-message-shell { cursor: pointer; }
.portal-message-shell--selected .portal-message-select {
  background: #3d83c5;
  box-shadow: none;
}
.portal-message-shell--selected .portal-message-select > span {
  width: 7px;
  height: 12px;
  margin-top: -3px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.portal-pinned-banner {
  position: sticky;
  z-index: 8;
  top: -1px;
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid #dce4ea;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.96);
  color: #26323c;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 5px 14px rgba(33, 42, 50, 0.07);
  backdrop-filter: blur(10px);
}
.portal-pinned-banner::before {
  content: "";
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: #3d83c5;
}
.portal-pinned-banner > span:last-child { min-width: 0; display: grid; gap: 2px; }
.portal-pinned-banner strong { color: #3279b8; font-size: 11px; }
.portal-pinned-banner small { overflow: hidden; color: #52616d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.portal-forwarded-label {
  margin: 1px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #397fc0;
  font-size: 11px;
}
.portal-forwarded-label strong { font-weight: 700; }
.portal-message-reply {
  width: 100%;
  min-width: 0;
  margin: 1px 0 7px;
  padding: 5px 8px;
  border: 0;
  border-left: 3px solid #3d83c5;
  border-radius: 4px;
  display: grid;
  gap: 2px;
  background: rgba(61, 131, 197, 0.08);
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.portal-message-reply strong { color: #347ab9; font-size: 11px; }
.portal-message-reply span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.portal-message-edited { color: #87929b; font-size: 9px; }

.portal-message-reactions {
  margin: 7px -3px -4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.portal-message-reaction {
  min-width: 38px;
  height: 27px;
  padding: 0 7px;
  border: 1px solid #dce2e7;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.76);
  color: #53616c;
  cursor: pointer;
}
.portal-message-reaction span { font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 15px; }
.portal-message-reaction small { font-size: 10px; font-weight: 700; }
.portal-message-reaction--active { border-color: #7eb0dc; background: #e8f3fc; color: #2f75b4; }

.portal-message-menu {
  position: fixed;
  z-index: 1500;
  width: min(306px, calc(100vw - 16px));
  border: 1px solid rgba(30, 39, 47, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: #202b34;
  box-shadow: 0 18px 48px rgba(20, 27, 33, 0.25);
  font-family: inherit;
}
.portal-message-menu-reactions {
  min-height: 54px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #f5f7f8;
}
.portal-message-menu-reactions button {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 21px;
  transition: background 120ms ease, transform 120ms ease;
}
.portal-message-menu-reactions button:hover,
.portal-message-menu-reactions button:focus-visible { background: #e6edf2; transform: translateY(-1px); }
.portal-message-menu-reactions button.is-active { background: #dceefd; }
.portal-message-menu-items { padding: 5px; display: grid; gap: 1px; }
.portal-message-menu-items > button {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}
.portal-message-menu-items > button:hover,
.portal-message-menu-items > button:focus-visible { background: #edf2f5; outline: none; }
.portal-message-menu-items > button[hidden] { display: none; }
.portal-message-menu-danger { color: #b83b4d !important; }
.portal-message-menu-time {
  min-height: 35px;
  padding: 0 14px;
  border-top: 1px solid #e3e7ea;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f7f8f9;
  color: #6d7983;
  font-size: 10px;
}

.portal-action-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 18px;
  background: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
}
.portal-action-icon--reply { -webkit-mask-image: url("/client/icons/reply.svg"); mask-image: url("/client/icons/reply.svg"); }
.portal-action-icon--edit { -webkit-mask-image: url("/admin/icons/pencil.svg"); mask-image: url("/admin/icons/pencil.svg"); }
.portal-action-icon--pin { -webkit-mask-image: url("/client/icons/pin.svg"); mask-image: url("/client/icons/pin.svg"); }
.portal-action-icon--copy { -webkit-mask-image: url("/client/icons/copy.svg"); mask-image: url("/client/icons/copy.svg"); }
.portal-action-icon--forward { -webkit-mask-image: url("/client/icons/forward.svg"); mask-image: url("/client/icons/forward.svg"); }
.portal-action-icon--delete { -webkit-mask-image: url("/admin/icons/trash-2.svg"); mask-image: url("/admin/icons/trash-2.svg"); }
.portal-action-icon--select { -webkit-mask-image: url("/client/icons/circle-check.svg"); mask-image: url("/client/icons/circle-check.svg"); }
.portal-action-icon--checks { -webkit-mask-image: url("/client/icons/check-check.svg"); mask-image: url("/client/icons/check-check.svg"); }

.portal-compose-context {
  min-height: 48px;
  margin: 0 44px 6px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  background: #f5f8fa;
}
.portal-compose-context-mark { width: 3px; height: 34px; border-radius: 2px; background: #3d83c5; }
.portal-compose-context-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #e5eaed;
  color: #33424e;
  font-family: Georgia, serif;
  font-size: 16px;
}
.portal-compose-context-avatar[hidden] { display: none; }
.portal-compose-context-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portal-compose-context--forward { grid-template-columns: 36px minmax(0, 1fr) 32px; }
.portal-compose-context--forward .portal-compose-context-mark { display: none; }
.portal-compose-context-copy { min-width: 0; display: grid; gap: 2px; }
.portal-compose-context-copy strong { color: #367dbb; font-size: 11px; }
.portal-compose-context-copy small { overflow: hidden; color: #5d6a75; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.portal-compose-context > button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #71808b;
  cursor: pointer;
  font-size: 22px;
}
.portal-compose-context > button:hover { background: #e5ebef; }

.portal-selection-bar {
  position: fixed;
  z-index: 1450;
  right: 20px;
  bottom: 20px;
  left: 20px;
  width: fit-content;
  max-width: calc(100vw - 40px);
  min-height: 54px;
  margin: auto;
  padding: 7px;
  border: 1px solid #d8dee3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  color: #27333d;
  box-shadow: 0 16px 42px rgba(22, 29, 35, 0.24);
}
.portal-selection-bar strong { padding: 0 10px; font-size: 12px; white-space: nowrap; }
.portal-selection-bar > button {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: #367dbb;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.portal-selection-bar > button:hover { background: #edf3f7; }
.portal-selection-bar > button[hidden] { display: none; }
.portal-selection-bar [data-selection-delete] { color: #b83b4d; }
.portal-selection-bar [data-selection-cancel] { width: 40px; padding: 0; justify-content: center; color: #66737e; font-size: 22px; }

.portal-forward-dialog {
  position: fixed;
  z-index: 1600;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
}
.portal-forward-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(23, 30, 36, 0.52); }
.portal-forward-panel {
  position: relative;
  z-index: 1;
  width: min(410px, 100%);
  max-height: min(620px, calc(100dvh - 40px));
  border: 1px solid #dce2e7;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(20, 27, 33, 0.28);
}
.portal-forward-panel header { min-height: 58px; padding: 8px 10px 8px 18px; display: flex; align-items: center; gap: 10px; }
.portal-forward-panel h2 { margin: 0; color: #202b34; font-family: inherit; font-size: 17px; }
.portal-forward-panel header button { width: 38px; height: 38px; margin-left: auto; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: #66737e; cursor: pointer; font-size: 24px; }
.portal-forward-panel header button:hover { background: #edf2f5; }
.portal-forward-list { min-height: 120px; padding: 5px 8px 10px; overflow-y: auto; }
.portal-forward-list > button {
  width: 100%;
  min-height: 58px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  column-gap: 10px;
  align-items: center;
  background: transparent;
  color: #26323c;
  cursor: pointer;
  text-align: left;
}
.portal-forward-list > button:hover { background: #edf3f7; }
.portal-forward-avatar {
  position: relative;
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #e5eaed;
  font-family: Georgia, serif;
  font-size: 18px;
}
.portal-forward-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portal-forward-list strong { align-self: end; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.portal-forward-list small { align-self: start; color: #72808b; font-size: 10px; }
.portal-forward-list p { margin: 32px 12px; color: #72808b; text-align: center; }

@media (hover: none), (max-width: 720px) {
  .portal-message-menu-trigger { opacity: 1; }
}

@media (max-width: 640px) {
  .portal-message-menu { width: min(306px, calc(100vw - 12px)); }
  .portal-message-menu-reactions { padding: 7px 5px; }
  .portal-compose-context { margin-inline: 4px; }
  .portal-selection-bar { right: 6px; bottom: max(6px, env(safe-area-inset-bottom)); left: 6px; max-width: calc(100vw - 12px); }
  .portal-selection-bar strong { padding-inline: 7px; }
  .portal-selection-bar > button { padding-inline: 7px; }
  .portal-selection-bar > button span:last-child { display: none; }
  .portal-forward-dialog { padding: 0; place-items: end center; }
  .portal-forward-panel { width: 100%; max-height: 82dvh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
  .portal-chat--selecting .portal-message-avatar { display: none; }
  .portal-message-shell { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-message-shell .portal-message,
  .portal-message-menu-trigger,
  .portal-message-menu-reactions button { transition: none; }
}

/* v28 media preview, attachment modes and live upload progress */
.portal-media-preview {
  width: min(100%, 520px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  display: block;
  overflow: hidden;
  background: #181719;
  color: inherit;
  cursor: zoom-in;
  font: inherit;
  text-align: left;
}
.portal-media-preview:focus-visible { outline: 3px solid rgba(61, 131, 197, 0.46); outline-offset: 2px; }
.portal-media-preview img { width: 100%; max-height: 420px; display: block; object-fit: contain; }

.portal-attachment-mode {
  min-height: auto;
  padding: 10px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px 14px;
  cursor: default;
}
.portal-attachment-mode-label { color: #687581; font-size: 12px; font-weight: 700; }
.portal-attachment-mode-switch {
  justify-self: end;
  padding: 3px;
  border: 1px solid #dce3e8;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  background: #edf1f4;
}
.portal-attachment-mode-switch button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #566571;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.portal-attachment-mode-switch button.is-active { background: #fff; color: #246fae; box-shadow: 0 1px 4px rgba(24, 35, 45, 0.12); }
.portal-attachment-mode-switch button:disabled { cursor: wait; opacity: 0.55; }
.portal-attachment-mode > small { grid-column: 1 / -1; color: #71808d; font-size: 11px; line-height: 1.4; }

.portal-upload-item progress { accent-color: #3d83c5; }
.portal-upload-progress-label[hidden] { display: none !important; }
.portal-upload-progress-label { display: none; }
.portal-attachment-dialog .portal-upload-item--hero .portal-upload-progress-label:not([hidden]) {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 15px;
  left: 12px;
  width: max-content;
  max-width: calc(100% - 24px);
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  background: rgba(25, 35, 44, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-attachment-dialog .portal-upload-item--hero progress {
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
}

body.portal-media-viewer-open { overflow: hidden; }
.portal-media-viewer[hidden] { display: none !important; }
.portal-media-viewer {
  position: fixed;
  z-index: 1800;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.portal-media-viewer-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(10, 15, 20, 0.86); cursor: zoom-out; }
.portal-media-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  height: min(860px, calc(100dvh - 48px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
  background: #111820;
  color: #f7f9fb;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}
.portal-media-viewer-header { min-width: 0; padding: 8px 10px 8px 18px; display: flex; align-items: center; gap: 10px; background: #17212b; }
.portal-media-viewer-header > strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.portal-media-viewer-download {
  min-height: 38px;
  margin-left: auto;
  padding: 0 12px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d8eaff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.portal-media-viewer-download:hover { background: rgba(255, 255, 255, 0.09); }
.portal-media-viewer-download span:first-child { font-size: 20px; line-height: 1; }
.portal-media-viewer-close { width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: #dbe3ea; cursor: pointer; font-size: 26px; line-height: 1; }
.portal-media-viewer-close:hover { background: rgba(255, 255, 255, 0.1); }
.portal-media-viewer-stage { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #0d1319; }
.portal-media-viewer-stage img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.portal-media-viewer-status { position: absolute; color: #b8c3cd; font-size: 13px; }
.portal-media-viewer:not(.is-loading):not(.is-error) .portal-media-viewer-status { display: none; }
.portal-media-viewer.is-loading .portal-media-viewer-stage img,
.portal-media-viewer.is-error .portal-media-viewer-stage img { visibility: hidden; }

@media (max-width: 640px) {
  .portal-attachment-mode { grid-template-columns: 1fr; }
  .portal-attachment-mode-switch { width: 100%; justify-self: stretch; }
  .portal-attachment-mode > small { grid-column: 1; }
  .portal-media-viewer { padding: 0; }
  .portal-media-viewer-panel { width: 100%; height: 100dvh; border: 0; border-radius: 0; grid-template-rows: 56px minmax(0, 1fr); }
  .portal-media-viewer-header { padding-left: 12px; }
  .portal-media-viewer-download { width: 40px; padding: 0; justify-content: center; }
  .portal-media-viewer-download span:last-child { display: none; }
}

/* v32 compact media messages and image-file thumbnails */
.portal-message-shell .portal-message--media-only {
  width: min(520px, 76%);
  max-width: min(520px, 76%);
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
.portal-message--media-only > .portal-message-meta--media-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0 !important;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.portal-message--media-only .portal-attachments--media-only {
  margin: 0;
  display: block;
}
.portal-message--media-only .portal-media-preview--standalone {
  position: relative;
  width: 100%;
  max-width: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(28, 36, 44, 0.14);
}
.portal-message--own.portal-message--media-only .portal-media-preview--standalone { border-radius: 16px 16px 5px 16px; }
.portal-message--other.portal-message--media-only .portal-media-preview--standalone { border-radius: 16px 16px 16px 5px; }
.portal-message--media-only .portal-media-preview--standalone img {
  width: 100%;
  height: auto;
  max-height: 420px;
  border-radius: inherit;
  object-fit: contain;
}
.portal-media-meta {
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 7px;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
  background: rgba(22, 29, 35, 0.7);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  backdrop-filter: blur(5px);
}
.portal-media-meta .portal-message-meta-tail { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.portal-media-meta time,
.portal-media-meta .portal-message-edited { color: #fff; }
.portal-media-meta .portal-message-status { color: #dbe5ed; }
.portal-media-meta .portal-message-status--read { color: #71bcff; }
.portal-message--media-only:hover .portal-media-meta,
.portal-message--media-only:focus-within .portal-media-meta {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.portal-message--media-only .portal-message-menu-trigger {
  background: rgba(22, 29, 35, 0.66);
  color: #fff;
  backdrop-filter: blur(5px);
}

.portal-file.portal-file--image {
  min-width: min(310px, 100%);
  min-height: 68px;
  padding: 6px;
}
.portal-file.portal-file--image > span.portal-file-thumbnail:first-child {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  display: block;
  flex: 0 0 56px;
  overflow: hidden;
  background: #dfe5e9;
}
.portal-file-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; }
.portal-file > .portal-file-copy { min-width: 0; display: grid; gap: 2px; }

@media (hover: none), (pointer: coarse) {
  .portal-media-meta { opacity: 1; visibility: visible; transform: none; }
}

@media (max-width: 760px) {
  .portal-message-shell .portal-message--media-only {
    width: min(520px, 90%);
    max-width: min(520px, 90%);
  }
  .portal-message--media-only .portal-media-preview--standalone img { max-height: 68dvh; }
  .portal-file.portal-file--image { min-width: min(280px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  .portal-media-meta { transition: none; }
}
