/* Hide Element crypto nags — company chats live on the server, like Telegram.
   Do not display:none the post-login CompleteSecurity screen: that freezes login.
   fgg-ui.js clicks Skip/Later so the app can proceed. */

.mx_EventTile_e2eIcon,
.mx_E2EIcon,
.mx_EventTile_e2eIcon_warning,
.mx_RoomHeader .mx_E2EIcon,
.mx_LegacyRoomHeader .mx_E2EIcon,
.mx_DecoratedRoomAvatar .mx_E2EIcon,
.mx_RoomTile .mx_E2EIcon,
.mx_RoomHeader [aria-label*="Not encrypted"],
.mx_RoomHeader [aria-label*="не зашифр"],
.mx_RoomHeader [title*="Not encrypted"],
.mx_SecureBackupPanel,
.mx_NewRoomIntro .mx_EventTile_e2eIcon,
.mx_UnsupportedBrowserDialog,
.mx_Dialog_wrapper:has(.mx_UnsupportedBrowserDialog),
.mx_Dialog_background:has(+ .mx_Dialog_wrapper .mx_UnsupportedBrowserDialog),
.mx_Toast_toast:has(a[href*="supported-environments"]),
.mx_Toast_toast:has(a[href*="element-hq/element-web"]),
.fgg-logout,
.mx_LoginSplashView_splashButtons {
  display: none !important;
}

.fgg-signout {
  display: flex !important;
  align-items: center;
  padding: 10px 16px !important;
  margin: 4px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-weight: 600;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}
.cpd-theme-dark .fgg-signout {
  border-top-color: rgba(255, 255, 255, 0.1);
}

#fgg-book {
  margin: 16px 0 8px;
  width: 100%;
  flex: 1 0 100%;
}

.fgg-book-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cpd-color-text-secondary, #6b7280);
  margin: 0 4px 8px;
}

.fgg-book-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(42vh, 360px);
  overflow: auto;
}

.fgg-book-empty {
  padding: 12px 8px;
  font-size: 13px;
  color: var(--cpd-color-text-secondary, #6b7280);
}

.fgg-book-user {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  color: inherit;
}

.fgg-book-user:hover,
.fgg-book-user:focus-visible {
  background: rgba(15, 118, 110, 0.08);
}

.fgg-book-av {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #1070a0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: transparent;
}

/* People without a photo: one brand-blue silhouette. Uploaded photos stay. */
.mx_BaseAvatar[title^="@"]:not(:has(img)),
.mx_EventTile_avatar .mx_BaseAvatar:not(:has(img)),
.mx_MemberTileView_avatar .mx_BaseAvatar:not(:has(img)),
.mx_ReadReceiptGroup .mx_BaseAvatar:not(:has(img)),
.mx_EntityTile_avatar .mx_BaseAvatar:not(:has(img)),
.mx_FacePile .mx_BaseAvatar:not(:has(img)),
.mx_WithPresenceIndicator .mx_BaseAvatar:not(:has(img)),
.mx_RoomAvatarView_RoomAvatar_presence:not(:has(img)),
.mx_BaseAvatar.fgg-avatar-fallback:not(:has(img)),
.fgg-book-av.fgg-avatar-fallback {
  color: transparent !important;
  background-color: #1070a0 !important;
  background-image: url("/fgg-avatar.svg?v=66") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: cover !important;
  border-color: transparent !important;
}

.fgg-book-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fgg-book-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.fgg-book-id {
  font-size: 12px;
  color: var(--cpd-color-text-secondary, #6b7280);
  line-height: 1.3;
}

.mx_BasicMessageComposer_input[placeholder*="незашифр"]::placeholder,
.mx_BasicMessageComposer_input[placeholder*="unencrypted"]::placeholder,
.mx_MessageComposer [placeholder*="незашифр"]::placeholder,
.mx_MessageComposer [placeholder*="unencrypted"]::placeholder {
  color: transparent !important;
}

.mx_MessageComposer_e2eIcon,
.mx_MessageComposer_e2eIconWrapper,
.mx_EventTile_e2eIcon,
.mx_RoomHeader_icon.mx_Untrusted,
[class*="_slotPadlock_"] {
  display: none !important;
}

/* Incoming bubbles: avatar and name on one row, message underneath. */
.mx_EventTile[data-layout="bubble"][data-self="false"]:not(.mx_EventTile_info):not(.mx_EventTile_continuation):not(.mx_EventTile_noSender):not(.mx_EventTile_leftAlignedBubble):not(.mx_EventTile_bubbleContainer) {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  margin-inline: 8px 16px !important;
}

.mx_EventTile[data-layout="bubble"][data-self="false"]:not(.mx_EventTile_info):not(.mx_EventTile_continuation):not(.mx_EventTile_noSender):not(.mx_EventTile_leftAlignedBubble):not(.mx_EventTile_bubbleContainer) > .mx_EventTile_avatar {
  grid-column: 1;
  grid-row: 1;
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  border: 0 !important;
  margin: 0 !important;
  align-self: center;
}

.mx_EventTile[data-layout="bubble"][data-self="false"]:not(.mx_EventTile_info):not(.mx_EventTile_continuation):not(.mx_EventTile_noSender):not(.mx_EventTile_leftAlignedBubble):not(.mx_EventTile_bubbleContainer) > .mx_DisambiguatedProfile {
  grid-column: 2;
  grid-row: 1;
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
  max-width: 100%;
  align-self: center;
  line-height: 1.25;
}

.mx_EventTile[data-layout="bubble"][data-self="false"]:not(.mx_EventTile_info):not(.mx_EventTile_continuation):not(.mx_EventTile_noSender):not(.mx_EventTile_leftAlignedBubble):not(.mx_EventTile_bubbleContainer) > .mx_EventTile_line {
  grid-column: 2;
  grid-row: 2;
  margin-inline-start: 0 !important;
  justify-self: start;
}

.mx_EventTile[data-layout="bubble"][data-self="false"]:not(.mx_EventTile_info):not(.mx_EventTile_continuation):not(.mx_EventTile_noSender):not(.mx_EventTile_leftAlignedBubble):not(.mx_EventTile_bubbleContainer) > :not(.mx_EventTile_avatar):not(.mx_DisambiguatedProfile):not(.mx_EventTile_line) {
  grid-column: 2;
}

.mx_EventTile[data-layout="bubble"][data-self="false"].mx_EventTile_continuation,
.mx_EventTile[data-layout="bubble"][data-self="false"].mx_EventTile_noSender:not(.mx_EventTile_info):not(.mx_EventTile_leftAlignedBubble):not(.mx_EventTile_bubbleContainer) {
  margin-inline-start: 52px !important;
}

.mx_EventTile[data-layout="bubble"][data-self="false"].mx_EventTile_continuation > .mx_EventTile_line,
.mx_EventTile[data-layout="bubble"][data-self="false"].mx_EventTile_noSender:not(.mx_EventTile_info) > .mx_EventTile_line {
  margin-inline-start: 0 !important;
}

/* Fit-content bubble plus the 60px clock gutter. overflow-y:hidden alone
   computes overflow-x to auto, so a line a fraction of a pixel too wide
   paints a horizontal scrollbar under text that is already fully visible. */
.mx_EventTile[data-layout="bubble"] .mx_EventTile_line {
  min-width: 0;
}

.mx_EventTile[data-layout="bubble"] .mx_EventTile_line :where(div, p, span, blockquote, pre, code) {
  overflow-x: clip;
}

.mx_EventTile[data-layout="bubble"] .mx_EventTile_content,
.mx_EventTile[data-layout="bubble"] .mx_EventTile_body,
.mx_EventTile[data-layout="bubble"] .mx_MTextBody,
.mx_EventTile[data-layout="bubble"] [data-event-layout="bubble"] {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.mx_EventTile[data-layout="bubble"] .mx_EventTile_line pre,
.mx_EventTile[data-layout="bubble"] .mx_EventTile_line pre code,
.mx_ReplyTile .mx_EventTile_content .mx_EventTile_pre_container > pre,
.mx_ReplyTile .mx_EventTile_content .mx_EventTile_pre_container > pre code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-x: hidden;
  overflow-y: hidden;
}

.mx_BasicMessageComposer_input,
.mx_BasicMessageComposer_inputEmpty {
  --placeholder: "Написать сообщение…" !important;
}

.mx_CallEvent.fgg-call-ended .mx_CallEvent_button,
.mx_CallEvent.fgg-call-ended .mx_CallEvent_content > button,
.mx_CallEvent.fgg-call-ended .mx_AccessibleButton.mx_CallEvent_button,
button.fgg-call-ended-btn {
  display: none !important;
}

.mx_CallEvent.fgg-call-ended {
  opacity: 0.78;
}

/* Element's own timer keeps ticking on a tile it still thinks is live. */
.mx_CallEvent.fgg-call-ended .mx_CallDuration {
  display: none !important;
}

/* Real call tile (rtc.notification) whose timer survived the call: fgg-ui.js
   sets fgg-call-stale only when no call is alive in the room. */
.fgg-call-stale .duration,
.fgg-call-stale button.fgg-call-stale-btn {
  display: none !important;
}

/* Last activity under the name, the way Telegram shows it in the chat header. */
.mx_RoomHeader:has(.mx_RoomHeader_info[data-fgg-seen]) {
  height: auto;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.mx_RoomHeader .mx_RoomHeader_info[data-fgg-seen] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.mx_RoomHeader .mx_RoomHeader_info[data-fgg-seen] .mx_RoomHeader_heading {
  max-width: 100%;
  min-width: 0;
}

.mx_RoomHeader .mx_RoomHeader_info[data-fgg-seen]::after,
.mx_RoomSummaryCard_roomName[data-fgg-seen]::after {
  content: attr(data-fgg-seen);
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--cpd-color-text-secondary, #61707a);
}

.mx_RoomHeader .mx_RoomHeader_info[data-fgg-online="1"]::after,
.mx_RoomSummaryCard_roomName[data-fgg-online="1"]::after {
  color: #1070a0;
}

.mx_RoomSummaryCard_roomName[data-fgg-seen] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Handset beside a person who is connected to a call right now. */
:root {
  --fgg-handset: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1C10.61 21 3 13.39 3 4c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E");
}

[data-testid="room-name"][data-fgg-busy]::after,
.mx_RoomHeader_heading[data-fgg-busy]::after,
.mx_RoomSummaryCard_roomName[data-fgg-busy]::before,
.mx_MemberTileView_name[data-fgg-busy]::after,
.fgg-book-name[data-fgg-busy]::after {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  background-color: #1070a0;
  -webkit-mask: var(--fgg-handset) center / contain no-repeat;
  mask: var(--fgg-handset) center / contain no-repeat;
}

.cpd-theme-dark [data-testid="room-name"][data-fgg-busy]::after,
.cpd-theme-dark .mx_RoomHeader_heading[data-fgg-busy]::after,
.cpd-theme-dark .mx_RoomSummaryCard_roomName[data-fgg-busy]::before,
.cpd-theme-dark .mx_MemberTileView_name[data-fgg-busy]::after,
.cpd-theme-dark .fgg-book-name[data-fgg-busy]::after {
  background-color: #4eb0e0;
}

[data-testid="room-name"][data-fgg-busy] {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  font-size: 0 !important;
}

[data-testid="room-name"][data-fgg-busy]::before {
  content: attr(title);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: inherit;
  line-height: 20px;
  letter-spacing: normal;
  color: inherit;
}

[data-testid="room-name"][data-fgg-busy]::after {
  margin-left: 5px;
}

[data-testid="room-name"][data-fgg-busy] > * {
  font-size: 15px;
  line-height: 20px;
}

.mx_RoomHeader_heading[data-fgg-busy] {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.mx_RoomHeader_heading[data-fgg-busy] .mx_RoomHeader_truncated {
  order: 0;
  min-width: 0;
  flex: 0 1 auto;
}

.mx_RoomHeader_heading[data-fgg-busy]::after {
  order: 1;
  width: 16px;
  height: 16px;
}

.mx_RoomHeader_heading[data-fgg-busy] > :not(.mx_RoomHeader_truncated) {
  order: 2;
}

.mx_RoomSummaryCard_roomName[data-fgg-busy] {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.mx_RoomSummaryCard_roomName[data-fgg-busy]::before {
  order: 1;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  margin-right: 0;
}

.mx_RoomSummaryCard_roomName[data-fgg-seen][data-fgg-busy] {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  column-gap: 6px;
}

.mx_RoomSummaryCard_roomName[data-fgg-seen][data-fgg-busy]::after {
  order: 2;
  flex-basis: 100%;
  margin-left: 0;
}

.mx_MemberTileView_name[data-fgg-busy],
.fgg-book-name[data-fgg-busy] {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

[data-fgg-call-time] {
  white-space: nowrap;
  margin-left: auto;
}

.mx_RoomView {
  position: relative;
}

button.fgg-rec-dot {
  box-sizing: border-box;
  position: absolute;
  z-index: 40;
  left: 16px;
  bottom: 96px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #dc2626;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

button.fgg-rec-dot.fgg-rec-dot-stop {
  border-radius: 4px;
}

button.fgg-rec-dot:disabled {
  opacity: 0.55;
  cursor: default;
}

.fgg-rec-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(15, 23, 42, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fgg-rec-card {
  width: min(560px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  background: #fff;
  color: #111827;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 18px 18px 12px;
}

.cpd-theme-dark .fgg-rec-card {
  background: #1f2937;
  color: #f9fafb;
}

.fgg-rec-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.fgg-rec-empty {
  color: var(--cpd-color-text-secondary, #6b7280);
  padding: 12px 0 18px;
}

.fgg-rec-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.cpd-theme-dark .fgg-rec-row {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.fgg-rec-meta {
  min-width: 0;
}

.fgg-rec-name {
  font-weight: 600;
  font-size: 14px;
}

.fgg-rec-sub {
  font-size: 12px;
  color: var(--cpd-color-text-secondary, #6b7280);
  margin-top: 2px;
}

.fgg-rec-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.fgg-rec-actions button,
.fgg-rec-close {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  background: #0f766e;
  color: #fff;
}

.fgg-rec-actions .fgg-rec-del {
  background: transparent;
  color: #b91c1c;
}

.fgg-rec-close {
  margin-top: 12px;
  background: #e5e7eb;
  color: #111827;
}

.mx_MFileBody [data-type="download"] {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mx_MFileBody [data-type="download"] > a {
  width: auto !important;
}

.fgg-file-open {
  appearance: none;
  border: 1px solid rgba(15, 118, 110, 0.45);
  background: #f0fdfa;
  color: #0f766e;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.fgg-file-open:hover {
  background: #ccfbf1;
}

.fgg-file-view {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(8, 14, 28, 0.55);
  box-sizing: border-box;
}

.fgg-file-view-card {
  width: min(1100px, 100%);
  height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111827;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.fgg-file-view-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.fgg-file-view-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fgg-file-view-close,
.fgg-file-view-tab {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #e5e7eb;
  color: #111827;
  font: inherit;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.fgg-file-view-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.fgg-file-view-status,
.fgg-file-view-note {
  margin: 0;
  padding: 20px 16px;
  color: #334155;
}

.fgg-file-view-frame,
.fgg-file-view-sheet,
.fgg-file-view-text {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: #fff;
}

.fgg-file-view-text {
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  box-sizing: border-box;
}

.fgg-file-view-image,
.fgg-file-view-media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}

.fgg-file-view-media {
  width: min(960px, 100%);
}

.fgg-file-view-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px 0;
  background: #fff;
}

.fgg-file-view-tab.is-on {
  background: #0f766e;
  color: #fff;
}

.fgg-file-view-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fgg-file-view-tablewrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.fgg-file-view-tablewrap table {
  border-collapse: collapse;
  min-width: 100%;
  background: #fff;
  font-size: 13px;
}

.fgg-file-view-tablewrap th,
.fgg-file-view-tablewrap td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.fgg-file-view-tablewrap th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  font-weight: 600;
}

.mx_EventTile[data-layout="bubble"][data-fgg-gallery] > .mx_EventTile_line {
  width: min(340px, 100%) !important;
  max-width: min(340px, 100%) !important;
}

.mx_EventTile[data-fgg-gallery] > .mx_EventTile_line > :is(:has(img), :has(canvas)):not(.fgg-gallery):not(.mx_ReplyChain):not(.mx_MessageActionBar) {
  display: none !important;
}

.fgg-gallery {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
}

.fgg-gallery[data-count="2"] {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 168px;
}

.fgg-gallery[data-count="3"] {
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: 112px 112px;
}

.fgg-gallery[data-count="3"] .fgg-gallery-cell:first-child {
  grid-row: 1 / span 2;
}

.fgg-gallery[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 132px;
}

.fgg-gallery[data-count="many"] {
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: 108px;
}

button.fgg-gallery-cell {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: #d5dee6;
  cursor: zoom-in;
  display: block;
  border-radius: 0;
  line-height: 0;
  overflow: hidden;
}

button.fgg-gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

#fgg-image-nav {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
}

.fgg-image-nav-btn {
  pointer-events: auto;
  position: absolute;
  top: calc(50% + 20px);
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fgg-image-nav-btn:hover {
  background: rgba(15, 23, 42, 0.82);
}

.fgg-image-nav-btn[hidden] {
  display: none !important;
}

.fgg-image-nav-prev {
  left: max(16px, env(safe-area-inset-left));
}

.fgg-image-nav-next {
  right: max(16px, env(safe-area-inset-right));
}

.fgg-image-nav-count {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  pointer-events: none;
}

.fgg-image-nav-count[hidden] {
  display: none !important;
}

/* No row wash while the pointer moves, and no yellow plate behind a quoted message. */
.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"].mx_EventTile_highlight::before,
.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"].mx_EventTile_selected::before,
.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"]:hover::before,
.mx_ThreadView .mx_EventTile[data-layout="bubble"].mx_EventTile_highlight::before,
.mx_ThreadView .mx_EventTile[data-layout="bubble"].mx_EventTile_selected::before,
.mx_ThreadView .mx_EventTile[data-layout="bubble"]:hover::before {
  background: transparent !important;
  background-color: transparent !important;
}

.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"].mx_EventTile_highlight .mx_EventTile_avatar,
.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"]:hover .mx_EventTile_avatar,
.mx_ThreadView .mx_EventTile[data-layout="bubble"].mx_EventTile_highlight .mx_EventTile_avatar,
.mx_ThreadView .mx_EventTile[data-layout="bubble"]:hover .mx_EventTile_avatar {
  border-color: transparent !important;
}

.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"]:hover .mx_EventTile_avatar img,
.mx_RoomView_MessageList .mx_EventTile[data-layout="bubble"].mx_EventTile_selected .mx_EventTile_avatar img,
.mx_ThreadView .mx_EventTile[data-layout="bubble"]:hover .mx_EventTile_avatar img,
.mx_ThreadView .mx_EventTile[data-layout="bubble"].mx_EventTile_selected .mx_EventTile_avatar img {
  box-shadow: none !important;
}

.mx_RoomView_MessageList .mx_EventTile[data-layout="group"]:hover .mx_EventTile_line,
.mx_RoomView_MessageList .mx_EventTile[data-layout="group"].mx_EventTile_highlight .mx_EventTile_line,
.mx_RoomView_MessageList .mx_EventTile[data-layout="irc"]:hover .mx_EventTile_line,
.mx_RoomView_MessageList .mx_EventTile[data-layout="irc"].mx_EventTile_highlight .mx_EventTile_line,
.mx_ThreadView .mx_EventTile[data-layout="group"]:hover .mx_EventTile_line,
.mx_ThreadView .mx_EventTile[data-layout="group"].mx_EventTile_highlight .mx_EventTile_line,
.mx_ThreadView .mx_EventTile[data-layout="irc"]:hover .mx_EventTile_line,
.mx_ThreadView .mx_EventTile[data-layout="irc"].mx_EventTile_highlight .mx_EventTile_line {
  background-color: transparent !important;
}

.mx_RoomView_MessageList .mx_EventTile.mx_EventTile_bubbleContainer:hover .mx_EventTile_line,
.mx_ThreadView .mx_EventTile.mx_EventTile_bubbleContainer:hover .mx_EventTile_line {
  background-color: var(--backgroundColor) !important;
}
