.public-card {
  background: var(--public-card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--public-shadow);
  border: 1px solid var(--public-border);
}

/* A quiet inline notice (e.g. the no-encryption warning in conversations):
   the icon spans the full height, the text wraps beside it. */
.public-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--public-muted);
}

.public-note__icon {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

.public-note__text {
  min-width: 0;
}

.public-posts {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.public-post {
  background: var(--public-card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--public-shadow);
  border: 1px solid var(--public-border);
}

.public-post__boost {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--public-muted);
  font-size: 12px;
}

.public-post__parent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--public-border);
  border-radius: 12px;
  background: var(--public-soft-bg);
  text-decoration: none;
  color: var(--public-muted);
  font-size: 13px;
  line-height: 1.4;
}

.public-post__parent:hover {
  background: var(--public-accent-soft);
}

.public-post__reply-icon {
  font-size: 13px;
  line-height: 1.4;
}

.public-post__parent-author {
  font-weight: 600;
  color: var(--public-text);
  margin-right: 6px;
}

.public-post__parent-excerpt {
  color: var(--public-muted);
}

.public-post__boost-icon {
  font-size: 14px;
}

.public-post__boost-author {
  font-weight: 600;
  color: var(--public-text);
}

.public-post__boost-text {
  color: var(--public-muted);
}

.public-post__boost-time {
  margin-left: auto;
  color: var(--public-muted);
}

.public-post__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-post__avatar {
  /* Kill the inline-image baseline gap inside the wrapping link. */
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
}

.public-post__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Let long names shrink instead of pushing the timestamp out. */
  min-width: 0;
}

.public-post__author {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-post__handle {
  color: var(--public-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-post__time {
  color: var(--public-muted);
  font-size: 12px;
}

.public-post__time-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-post__edited {
  color: var(--public-muted);
  font-size: 11px;
  border: 1px solid var(--public-border);
  border-radius: 6px;
  padding: 1px 5px;
  text-decoration: none;
}

.public-post__edited:hover {
  background: var(--public-accent-soft);
  color: var(--public-accent);
}

.public-history__old {
  opacity: 0.75;
}

.public-history__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.public-history__badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--public-soft-bg);
  color: var(--public-muted);
}

.public-history__badge--current {
  background: var(--public-accent-soft);
  color: var(--public-accent);
}

.public-history__cw {
  margin-top: 10px;
  font-size: 13px;
  color: var(--public-muted);
}

.public-edit__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-edit__attachment {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.public-edit__attachment-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--public-border);
}

.public-edit__attachment-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--public-muted);
}

.public-edit__buttons {
  display: flex;
  gap: 8px;
}

.public-post__content {
  margin-top: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.public-post__content a.mention,
.public-post__content a.hashtag {
  color: var(--public-accent);
  font-weight: 600;
  text-decoration: none;
}

.public-post__content a.mention:hover,
.public-post__content a.hashtag:hover {
  text-decoration: underline;
}

.public-post__content pre,
.public-post__content code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.public-post__images {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  border-radius: 14px;
  overflow: hidden;
}

.public-post__image-link {
  display: block;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  background: var(--public-soft-bg);
}

.public-post__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.public-post__image-link:hover .public-post__image {
  transform: scale(1.03);
}

/* One image: natural proportions capped in height. */
.public-post__images--single {
  grid-template-columns: 1fr;
}

.public-post__images--single .public-post__image {
  height: auto;
  max-height: 560px;
}

/* Two images: halves. */
.public-post__images--two {
  grid-template-columns: 1fr 1fr;
  height: 300px;
}

/* Three: one tall on the left, two stacked on the right. */
.public-post__images--three {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 340px;
}

.public-post__images--three .public-post__image-link:first-child {
  grid-row: span 2;
}

/* Four: an even grid. */
.public-post__images--four {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 380px;
}

/* Five and more: tiles. */
.public-post__images--many {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 160px;
}

/* Custom emojis inline with text: scale with the font, sit on the line. */
.custom-emoji {
  height: 1.2em;
  width: auto;
  vertical-align: -0.25em;
}

.public-post__video {
  display: block;
  width: 100%;
  max-height: 560px;
  margin-top: 12px;
  border-radius: 14px;
  background: #000;
}

.public-post__stats {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--public-muted);
  font-size: 13px;
}

/* Mastodon-style footer: flat actions spread across the card width,
   the «⋯» menu closing the row. */
.public-post__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 10px;
}

.public-post__action-form {
  display: inline-flex;
}

.public-post__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 9px;
  padding: 9px 10px;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.15;
  text-decoration: none;
  color: inherit;
}

.public-post__action-count {
  color: var(--public-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.public-thread__main .public-post {
  border: 1px solid var(--public-accent);
  box-shadow: 0 10px 24px rgba(79, 115, 255, 0.14);
}

.public-thread__reply--d2 {
  margin-left: 24px;
}

.public-thread__reply--d3 {
  margin-left: 48px;
}

.public-thread__reply--d4 {
  margin-left: 72px;
}

.public-composer__input--reply {
  min-height: 80px;
}

.public-post__action:hover {
  background: var(--public-accent-soft);
}

.public-post__action--active {
  background: var(--public-accent-soft);
}

.public-post__action--disabled {
  opacity: 0.35;
  cursor: default;
}

.public-post__action--disabled:hover {
  background: transparent;
}

/* The post visibility glyph next to the timestamp. */
.public-post__visibility {
  font-size: 12px;
  line-height: 1;
  cursor: default;
}

/* The «⋯» dropdown closing the action row: a flat compact toggle. */
.public-post__more .public-dropdown__toggle {
  width: 34px;
  height: 32px;
  border: none;
  border-radius: 9px;
  font-size: 16px;
}

.public-post__cw {
  margin-top: 12px;
}

.public-post__cw-summary {
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--public-cw-border);
  background: var(--public-cw-bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--public-text);
}

.public-post__cw-summary:hover {
  background: var(--public-cw-bg-hover);
}

.public-post__cw[open] .public-post__cw-summary {
  margin-bottom: 4px;
}

.public-post__cw .public-post__content {
  margin-top: 8px;
}

.public-post__poll {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-post__poll-option {
  position: relative;
  border: 1px solid var(--public-border);
  border-radius: 10px;
  overflow: hidden;
}

.public-post__poll-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--public-accent-soft);
}

.public-post__poll-label {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 14px;
}

.public-post__poll-percent {
  color: var(--public-muted);
  font-weight: 600;
}

.public-post__poll-meta {
  font-size: 12px;
  color: var(--public-muted);
}

.public-post__poll-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-post__poll-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--public-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

.public-post__poll-choice:hover {
  background: var(--public-accent-soft);
}

.public-post__poll-choice input {
  flex: 0 0 auto;
  accent-color: var(--public-accent);
}

.public-post__poll-submit {
  align-self: flex-start;
  padding: 6px 18px;
}

.public-post__card {
  display: flex;
  margin-top: 12px;
  border: 1px solid var(--public-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--public-soft-bg);
}

.public-post__card:hover {
  background: var(--public-accent-soft);
}

.public-post__card-image {
  width: 120px;
  min-height: 90px;
  object-fit: cover;
  flex-shrink: 0;
}

.public-post__card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  min-width: 0;
}

.public-post__card-provider {
  font-size: 12px;
  color: var(--public-muted);
}

.public-post__card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.public-post__card-description {
  font-size: 13px;
  color: var(--public-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.public-card__title {
  font-weight: 600;
  margin-bottom: 10px;
}

.public-card__title--center {
  text-align: center;
}

.public-notifications {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.public-notification {
  background: var(--public-card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--public-shadow);
  border: 1px solid var(--public-border);
}

.public-notification--unread {
  border-color: var(--public-accent);
  background: linear-gradient(0deg, var(--public-accent-soft), var(--public-accent-soft)), var(--public-card);
}

.public-conversation {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.public-conversation--unread {
  border-color: var(--public-accent);
}

.public-conversation__avatar {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--public-avatar-bg);
}

.public-conversation__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.public-conversation__names {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-conversation__excerpt {
  color: var(--public-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-conversation__time {
  color: var(--public-muted);
  font-size: 12px;
  flex: 0 0 auto;
}

.public-conversation__dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--public-accent);
}

.public-notification__row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.public-notification__icon {
  font-size: 20px;
  line-height: 1;
}

.public-notification__avatar {
  display: block;
}

.public-notification__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.public-notification__body {
  flex: 1;
  min-width: 0;
}

.public-notification__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  /* The text side may shrink; the timestamp may not. */
  min-width: 0;
}

.public-notification__header > :first-child {
  min-width: 0;
}

.public-notification__link {
  color: inherit;
  text-decoration: none;
}

.public-notification__title {
  font-weight: 600;
}

.public-notification__time {
  color: var(--public-muted);
  font-size: 12px;
  /* «20 гадз» must stay on one line — it used to break in two on phones. */
  white-space: nowrap;
  flex: 0 0 auto;
}

.public-notification__handle {
  color: var(--public-muted);
  font-size: 12px;
  margin-top: 2px;
}

.public-notification__status {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--public-border);
  padding: 10px 12px;
  background: var(--public-soft-bg);
}

.public-notification__status-author {
  font-weight: 600;
  font-size: 13px;
}

.public-notification__status-author span {
  font-weight: 500;
  color: var(--public-muted);
  margin-left: 6px;
}

.public-notification__status-content {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.public-post__link {
  text-decoration: none;
  color: inherit;
}

.public-post__link:hover {
  color: var(--public-accent);
}

.public-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 20, 32, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  /* The overlay owns all gestures: no scroll chaining to the page,
     no native panning — the swipe handling is ours. */
  overscroll-behavior: contain;
  touch-action: none;
}

.public-lightbox__image {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  will-change: transform;
}

.public-lightbox__caption {
  color: #d6d9ea;
  font-size: 14px;
  text-align: center;
  max-width: 720px;
}

.public-lightbox__counter {
  color: #8a8fa6;
  font-size: 13px;
}

.public-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.public-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  line-height: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 0 0 6px 0;
}

.public-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.public-lightbox__nav--prev {
  left: 16px;
}

.public-lightbox__nav--next {
  right: 16px;
}

@media (max-width: 720px) {
  .public-lightbox {
    padding: 12px;
  }

  .public-lightbox__nav {
    width: 40px;
    height: 54px;
    font-size: 26px;
  }
}