﻿.content {
  word-break: break-word;
}

.content .image-list-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: masonry;
}

.content .image-list-container.image-list-odd :first-child {
  grid-column: 1 / 3;
}

.content img {
  width: calc(100% - var(--box-margin));
}

.content > pre {
  width: calc(100% - var(--box-margin));
  max-width: 456px;
  overflow-x: auto;
}

.content .tgme_widget_message_link_preview {
  margin-top: 16px;
  display: none;
}

.content .tgme_widget_message_link_preview .link_preview_site_name,
.content .tgme_widget_message_link_preview .link_preview_title,
.content .tgme_widget_message_link_preview .link_preview_description {
  display: none;
}

.content .tgme_widget_message_link_preview:has(.link_preview_site_name) {
  display: block;
  background: var(--cell-background-color);
  border-left: 3px solid var(--highlight-color);
  padding: 6px;
  padding-left: 10px;
  border-radius: var(--box-border-radius);
}

.content .tgme_widget_message_link_preview:has(.link_preview_site_name) .link_preview_title {
  display: block;
  font-size: 1em;
  font-weight: bolder;
  line-height: 2;
}

.content .tgme_widget_message_link_preview:has(.link_preview_site_name) .link_preview_description {
  display: block;
  font-size: 0.8em;
  line-height: 1.5;
}

.content .tgme_widget_message_video {
  width: calc(100% - var(--box-margin));
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border-radius: var(--box-border-radius);
}

.content .tgme_widget_message_roundvideo {
  width: calc(100% - var(--box-margin));
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #000;
  border-radius: var(--box-border-radius);
}

.content .tgme_widget_message_link_preview:has(.link_preview_image) {
  display: flex;
  position: relative;
  border: none;
  padding: 0;
  background: transparent;
}

.content .tgme_widget_message_link_preview:has(.link_preview_image) .link_preview_image {
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.content .tgme_widget_message_link_preview:has(.link_preview_image) .link_preview_site_name {
  display: block;
  position: absolute;
  bottom: var(--box-margin);
  left: var(--box-margin);
  padding-left: 4px;
  padding-right: 4px;
  background-color: rgba(0, 0, 0, 0.66);
  font-size: 14px;
  color: #fff;
  line-height: 1.5;
  border-radius: var(--box-border-radius);
  text-overflow: ellipsis;
  max-width: calc(100% - 28px);
  white-space: nowrap;
  overflow: hidden;
}

.content .tgme_widget_message_link_preview:has(.link_preview_image) .link_preview_title,
.content .tgme_widget_message_link_preview:has(.link_preview_image) .link_preview_description {
  display: none;
}

.content blockquote {
  margin: 16px 0;
  font-size: 0.8em;
  background: var(--cell-background-color);
  border-left: 3px solid var(--highlight-color);
  padding: 6px;
  padding-left: 10px;
  border-radius: var(--box-border-radius);
}

.content .tg-expandable {
  margin: 16px 0;
  font-size: 0.8em;
  background: var(--cell-background-color);
  border-left: 3px solid var(--highlight-color);
  padding: 6px;
  padding-left: 10px;
  padding-right: 30px;
  border-radius: var(--box-border-radius);
  position: relative;
  min-height: 3.6em;
}

.content .tg-expandable__checkbox {
  display: none;
}

.content .tg-expandable__content {
  display: block;
  user-select: text;
}

/* use @supports to check :has() support */
@supports selector(:has(*)) {
  /* when :has() is supported, default to collapsed */
  .content .tg-expandable__content {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* when checkbox is checked, expand */
  .content .tg-expandable:has(.tg-expandable__checkbox:checked) .tg-expandable__content {
    display: block;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    padding-bottom: 24px;
  }
}

.content .tg-expandable__toggle {
  /* default hidden, not show small triangle when :has() is not supported */
  display: none;
}

@supports selector(:has(*)) {
  .content .tg-expandable__toggle {
    display: block;
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    user-select: none;
    z-index: 2;
  }

  .content .tg-expandable__toggle::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 6px solid var(--secondary-color);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
    filter: var(--icon-secondary-filter);
  }

  .content .tg-expandable:has(.tg-expandable__checkbox:checked) .tg-expandable__toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
  }
}

.content .tgme_widget_message_sticker {
  display: block;
}

.content:has(.tgme_widget_message_user_photo) {
  display: flex;
}

.content:has(.tgme_widget_message_user_photo) .tgme_widget_message_user_photo {
  width: 60px;
  height: 60px;
}

.content .tgme_widget_message_voice {
  display: block !important;
}

.content .tgme_widget_message_video_wrap {
  display: none;
}

.content .tgme_widget_message_poll_options {
  display: block;
}

.content .tgme_widget_message_poll_options .tgme_widget_message_poll_option_percent {
  float: left;
  margin-right: 8px;
}

.content .tgme_widget_message_location_wrap {
  display: block;
}

.content .tgme_widget_message_location_wrap .tgme_widget_message_location {
  padding-top: 50%;
  background: no-repeat center;
  background-size: cover;
}

.content .emoji {
  font-style: normal;
  margin-right: 2px;
}

.content .tg-emoji {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.15em;
}

.content .sticker {
  box-shadow: none;
  border: none;
}

.content .spoiler-button {
  cursor: pointer;
}

.content .spoiler-button input {
  display: none;
}

.content .spoiler-button tg-spoiler {
  color: transparent;
  margin: auto 2px;
  border-radius: var(--box-border-radius);
  background: #ccc 60% 60% / 3000px 3000px;
  background-image: repeating-conic-gradient(#999 0 0.0001%, #0000 0 0.0002%);
}

.content .spoiler-button input:checked + tg-spoiler {
  background: unset;
  color: unset;
}

.reaction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  font-size: 12px;
  color: var(--secondary-color);
  background: var(--code-background-color);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

.reaction-pill-paid {
  background: rgba(255, 196, 0, 0.12);
  border-color: rgba(255, 196, 0, 0.35);
  color: #9a6a00;
}

.reaction-emoji {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  line-height: 1;
}

.reaction-emoji img {
  width: 1em;
  height: 1em;
  display: block;
}

.reaction-count {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.tag-box {
  flex-wrap: wrap;
}

[popover] {
  display: none;
}

[popover]:popover-open {
  display: block;
}

.image-preview-wrap {
  display: block;
}

.image-preview-button {
  appearance: none;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
}

.modal {
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
}

.modal-img {
  margin: auto;
  max-width: calc(100% - 40px) !important;
  max-height: calc(100% - 40px) !important;
  border-radius: var(--media-border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadows);
  cursor: pointer;
  object-fit: scale-down;
}

@media screen and (min-width: 600px) {
  .modal-img {
    max-width: calc(100% - 80px) !important;
    max-height: calc(100% - 80px) !important;
  }
}




