.media-item {
  position: relative;
}

/* ═══════════════════════════════════════════════
   POSTS - Post Cards, Media, Polls, Lightbox, Skeletons
   ═══════════════════════════════════════════════
   Styles for the main post/status card component used
   throughout the feed, profile, and thread views.
   ══════════════════════════════════════════════════ */

/* ─── Loading Skeletons ─── */
.feed-loading {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.skeleton-posts {
  width: 100%;
}

.skeleton-post {
  border-bottom: 1px solid var(--border);
  padding: 20px 20px;
}

.skel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.skel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface2);
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
}

.skel-meta {
  flex: 1;
}

.skel-line {
  height: 10px;
  border-radius: 4px;
  background: var(--surface2);
  animation: shimmer 1.5s infinite;
  margin-bottom: 6px;
}

.skel-line.w-40 {
  width: 40%;
}

.skel-line.w-60 {
  width: 60%;
}

.skel-line.w-70 {
  width: 70%;
}

.skel-line.w-80 {
  width: 80%;
}

.skel-line.w-90 {
  width: 90%;
}

/* ─── Status Messages ─── */
.feed-status {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-dim);
}

.feed-status .status-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.feed-status p {
  font-size: 14px;
  font-family: var(--font-mono);
}

.feed-status .status-sub {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ─── Post Card ─── */
.post {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border2);
  padding: 18px 20px 7px 18px;
  transition: background var(--trans), border-color var(--trans);
  position: relative;
  cursor: pointer;

  /* attempted fix of rendering posts on top of each other */
  border-top: 1px solid var(--border);
  margin-top: -1px;

  /* Mobile interaction polish */
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.post:active {
  background: rgba(255, 255, 255, 0.025);
}


.post:hover {
  background: rgba(255, 255, 255, 0.015);
  border-left-color: var(--text-dim);
}

/* Context border colors */
.post.post--hashtag {
  border-left-color: rgba(155, 127, 255, 0.5);
  background: rgba(155, 127, 255, 0.04);
}

.post.post--hashtag:hover {
  border-left-color: rgba(155, 127, 255, 0.7);
  background: rgba(155, 127, 255, 0.07);
}

.post.post--boost,
.post.post--following {
  border-left-color: rgba(78, 205, 196, 0.5);
  background: rgba(78, 205, 196, 0.04);
}

.post.post--boost:hover,
.post.post--following:hover {
  border-left-color: rgba(78, 205, 196, 0.7);
  background: rgba(78, 205, 196, 0.07);
}

.post.post--reply {
  border-left-color: rgba(136, 136, 160, 0.3);
  background: rgba(136, 136, 160, 0.03);
}

.post.post--reply:hover {
  border-left-color: rgba(136, 136, 160, 0.5);
  background: rgba(136, 136, 160, 0.06);
}

/* ─── Hashtag Banner (above post) ─── */
.post-hashtag-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.post-hashtag-banner svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.post-hashtag-banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.post-hashtag-banner-tag {
  color: var(--accent2);
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  transition: color var(--trans);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.post-hashtag-banner-tag:hover {
  color: var(--accent);
}

.post-hashtag-banner-tag:active {
  opacity: 0.8;
}

.post-hashtag-banner-tag+.post-hashtag-banner-tag::before {
  content: '·';
  margin-right: 4px;
  color: var(--text-dim);
}

/* ─── Boost Divider ─── */
.boost-divider {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-dim);
}

.boost-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  opacity: 0.6;
}

.boost-divider-arrow {
  color: var(--border);
  opacity: 0.6;
  flex-shrink: 0;
}

.boost-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 0;
}

.boost-text svg {
  color: var(--boost);
  margin-right: 2px;
  flex-shrink: 0;
}

.boost-text .post-display-name {
  text-transform: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}

.boost-text span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Post Header ─── */
.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* .post-header--with-server layout changes are mobile-only, see @media below */

.post-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
}

.post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: border-color var(--trans);
}

.post-avatar:hover img {
  border-color: var(--accent);
}

.following-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.following-badge svg {
  width: 9px;
  height: 9px;
  opacity: 0.9;
}

.post-quote .following-badge {
  width: 12px;
  height: 12px;
  bottom: -1px;
  right: -1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.post-quote .following-badge svg {
  width: 7px;
  height: 7px;
}

.post-meta {
  flex: 1;
  min-width: 0;
}

/* .post-meta--with-server layout changes are mobile-only, see @media below */

/* Server address hidden on desktop, shown on mobile */
.post-server-address {
  display: none;
}

.post-author {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

/* .post-author--with-server layout changes are mobile-only, see @media below */

@media (max-width: 600px) {

  /* Avatar centered vertically between name and server address */
  .post-header--with-server {
    align-items: center;
  }

  /* Meta stacks name row on top, server address below */
  .post-meta--with-server {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  /* Hide the @acct handle on mobile (server address shown separately) */
  .post-meta--with-server .post-acct {
    display: none;
  }

  /* Show server address as its own line below the name */
  .post-server-address {
    display: block;
    font-size: 11px;
    margin-top: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    line-height: 1.25;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}

.post-display-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.post-display-name:hover {
  color: var(--accent2);
}

.post-acct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.post-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  margin-left: auto;
  padding-left: 8px;
}

.post-vis-icon {
  opacity: 0.5;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ─── Auto-translate info label ─── */
.post-translate-bar {
  margin-top: 8px;
}

.post-translated-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.65;
}

.post-show-original-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent2);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
  transition: opacity var(--trans), color var(--trans);
}

.post-show-original-btn:hover {
  opacity: 1;
  color: var(--accent);
}


/* ─── Post Content ─── */
.post-content {
  font-size: var(--app-font-size, 14px);
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  
  /* Animation for show more/less expansion (height managed via JS) */
  max-height: none;
  overflow: hidden;
  transition: max-height 1s cubic-bezier(0.4, 0, 0.2, 1);
}



.post-content p {
  margin-bottom: 8px;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin-bottom: 8px;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 4px;
}

.post-content ul:last-child,
.post-content ol:last-child {
  margin-bottom: 0;
}

.post-content a {
  color: var(--accent2);
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(155, 127, 255, 0.15);
  position: relative;
  z-index: 1;
  /* ensure links are above the article background */
}

.post-content a:active {
  background: rgba(155, 127, 255, 0.1);
  border-radius: 3px;
}


/* External links are visually quieter than hashtags/mentions */
.post-content .ext-link {
  color: var(--text-muted);
  font-size: 0.9em;
}

.post-content .ext-link:hover {
  color: var(--accent2);
}


/* Collapse any <p> left empty after card URL suppression */
.post-content p:empty {
  display: none;
}

.post-content .hashtag,
.post-tags .hashtag,
.post-tags-toggle,
.post-tags-less-toggle {
  color: var(--green);
  text-decoration: none;
}

.hashtag-pills-enabled .post-content .hashtag,
.hashtag-pills-enabled .post-tags .hashtag,
.hashtag-pills-enabled .post-tags-toggle,
.hashtag-pills-enabled .post-tags-less-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1;
  margin: 2px 2px;
  text-decoration: none;
  transition: all var(--trans);
  cursor: pointer;
  font-family: var(--font-body);
}

/* Specific display logic for pills */
.hashtag-pills-enabled .post-content .hashtag,
.hashtag-pills-enabled .post-tags .hashtag,
.hashtag-pills-enabled .post-tags-toggle {
  display: inline-flex;
}

.hashtag-pills-enabled .post-tags-less-toggle {
  display: none;
}

.hashtag-pills-enabled .post-content .hashtag:hover,
.hashtag-pills-enabled .post-tags .hashtag:hover,
.hashtag-pills-enabled .post-tags-toggle:hover,
.hashtag-pills-enabled .post-tags-less-toggle:hover {
  background: var(--surface);
  border-color: var(--accent);
  text-decoration: none;
}

/* Trailing hashtag block moved below media/cards */
.post-tags {
  margin-top: 8px;
}

.post-content .mention {
  color: var(--accent);
}

.custom-emoji {
  height: 1.25em;
  width: auto;
  vertical-align: top;
  display: inline-block;
  margin: 0 1px;
}

/* ─── Content Warning ─── */
.cw-wrapper {
  background: rgba(255, 107, 107, 0.06);
  border-left: 3px solid var(--danger);
  padding: 10px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 8px 0;
}

.cw-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.cw-summary span:first-child {
  flex: 1;
  overflow-wrap: anywhere;
}

.cw-toggle {
  background: var(--surface2);
  border: 1px solid var(--danger);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  margin-left: auto;
  transition: all var(--trans);
  white-space: nowrap;
}

.cw-toggle:hover {
  background: var(--danger);
  color: #fff;
}

.cw-body {
  display: none;
  margin-top: 10px;
}

.cw-body.expanded {
  display: block;
}

/* ─── Show More (Long Posts) ─── */
.post-content-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center the button */
}

.post-content--collapsed {
  max-height: 400px;
  mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent 100%);
}

.show-more-btn {
  appearance: none;
  background: rgba(var(--accent-rgb), 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 12px;
  margin-top: -24px;
  margin-bottom: 8px;
  position: relative;
  z-index: 10;
  transition: all 800ms cubic-bezier(0.23, 1, 0.32, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.show-more-btn:hover {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px) scale(1.02);
}

.show-more-btn:active {
  transform: translateY(0) scale(0.98);
}

.show-more-btn::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: transform 800ms ease;
}

.post-content-wrap:not(.collapsed-active) .show-more-btn {
  margin-top: 16px;
  background: rgba(var(--text-rgb), 0.05);
  border-color: rgba(var(--text-rgb), 0.1);
  color: var(--text-muted);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.post-content-wrap:not(.collapsed-active) .show-more-btn:hover {
  background: rgba(var(--text-rgb), 0.1);
  color: var(--text);
  border-color: var(--border2);
}

.post-content-wrap:not(.collapsed-active) .show-more-btn::after {
  transform: rotate(180deg);
}

/* ─── Media Grid ─── */
.post-media {
  margin-top: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.post-media-grid {
  display: grid;
  gap: 2px;
}

.post-media-grid.count-1 {
  grid-template-columns: 1fr;
}

.post-media-grid.count-2 {
  grid-template-columns: 1fr 1fr;
}

.post-media-grid.count-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 200px 200px;
}

.count-3 .media-item:first-child {
  grid-row: span 2;
}

.post-media-grid.count-4 {
  grid-template-columns: 1fr 1fr;
}

.media-item {
  overflow: hidden;
  position: relative;
  background: transparent;
  cursor: pointer;
}

/* Single-image post: JS sets aspect-ratio + max-width inline from
   attachment metadata so the container matches the image's true shape.
   The wrapper shrinks to the image's natural width (capped at feed width).
   Falls back to 16:9 when metadata is unavailable.
   max-height prevents very tall/portrait images from dominating the feed. */
.post-media--single {
  width: fit-content;
  max-width: 100%;
}

.post-media--single .count-1 .media-item {
  aspect-ratio: 16 / 9;
  /* fallback: no metadata */
  max-height: 500px;
}

.post-media--single .media-item img,
.post-media--single .media-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.count-2 .media-item,
.count-4 .media-item {
  height: 200px;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.media-sensitive-blur {
  filter: blur(20px);
}

.sensitive-pill {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.sensitive-pill:hover {
  opacity: 0.85;
}

.sp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 14px 22px;
  pointer-events: none;
}

.sp-card-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-ui, var(--font));
  letter-spacing: 0.01em;
}

.sp-card-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-family: var(--font-ui, var(--font));
}

/* Icons hidden in card state; only used in revealed pill state */
.sensitive-pill .sp-icon {
  display: none;
}

/* When revealed: collapse to a small corner pill */
.sensitive-pill.sp-revealed {
  inset: auto;
  top: 8px;
  right: 8px;
  width: auto;
  flex-direction: row;
  gap: 5px;
  padding: 4px 10px 4px 7px;
  background: rgba(13, 13, 15, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-family: var(--font-mono);
}

.sensitive-pill.sp-revealed:hover {
  background: rgba(30, 30, 35, 0.92);
  opacity: 1;
}

.sensitive-pill.sp-revealed .sp-card {
  display: none;
}

.sensitive-pill.sp-revealed .sp-icon-eye {
  display: block;
}

.sensitive-pill.sp-revealed .sp-icon-slash {
  display: none;
}

.sensitive-pill .sp-revealed-label {
  display: none;
}

.sensitive-pill.sp-revealed .sp-revealed-label {
  display: inline;
}

/* ─── Lightbox ─── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 200ms ease, background-color 600ms ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pinch-zoom;
}

.lightbox-overlay.open {
  opacity: 1;
}

/* ── Carousel track ── */
.lb-track-outer {
  position: absolute;
  inset: 0;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: default;
}

.lb-track-outer::-webkit-scrollbar {
  display: none;
}

.lb-track {
  display: flex;
  height: 100%;
}

.lb-slide {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* top: close button clearance; bottom: action bar clearance */
  padding: 64px 24px 100px;
  cursor: zoom-out;
}

.lightbox-content {
  position: relative;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.96);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.lightbox-overlay.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img,
.lightbox-content video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 164px);
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  background: var(--bg);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 3100;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Dot indicators - positioned over the overlay, above the action bar */
.lightbox-dots {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  align-items: center;
  z-index: 3100;
  pointer-events: none;
}

.lightbox-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.25s ease, transform 0.25s ease;
}

.lightbox-dot.active {
  background: rgba(255, 255, 255, 0.92);
  transform: scale(1.3);
}

/* Invisible tap zones for prev/next navigation (sit above the carousel track) */
.lightbox-tap-prev,
.lightbox-tap-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  z-index: 3060;
  cursor: pointer;
}

.lightbox-tap-prev {
  left: 0;
}

.lightbox-tap-next {
  right: 0;
}

/* Standalone ALT badge - only used when there is no action bar */
.lightbox-alt-badge {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 3100;
  transition: background 0.15s;
}

.lightbox-alt-badge:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-alt-panel {
  position: absolute;
  bottom: 90px;
  /* sits above the action bar (~56px tall + 24px bar-bottom + gap) */
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: calc(100% - 48px);
  max-width: 520px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 14px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 3100;
  max-height: 30vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-alt-panel.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ─── Lightbox Action Bar ─── */
.lightbox-action-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(14, 14, 20, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  padding: 5px 8px;
  z-index: 3100;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  /* slide up on open */
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.25s ease 0.1s, translate 0.25s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.lightbox-overlay.open .lightbox-action-bar {
  opacity: 1;
  translate: 0 0;
}

.lightbox-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: var(--font-mono, ui-monospace, monospace);
  padding: 7px 10px;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  line-height: 1;
  min-width: 36px;
  justify-content: center;
}

/* inline-flex overrides the HTML `hidden` attribute - restore expected behaviour */
.lightbox-action-btn[hidden],
.lightbox-action-sep[hidden] {
  display: none;
}

.lightbox-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Reply - teal hover matching the feed */
.lightbox-action-btn.lb-reply:hover {
  color: var(--teal);
}

.lightbox-action-btn.lb-reply:hover svg {
  opacity: 1;
}

/* Boost - accent color on hover / active, matching the feed */
.lightbox-action-btn.lb-boost:hover,
.lightbox-action-btn.boosted {
  color: var(--boost, #6e9ef5);
}

.lightbox-action-btn.lb-boost:hover svg,
.lightbox-action-btn.boosted svg {
  opacity: 1;
}

/* Favourite - star animations matching the feed */
.lightbox-action-btn.lb-fav:hover {
  color: var(--fav, #f4b942);
}

.lightbox-action-btn.lb-fav:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

/* Quote - accent color on hover, matching the feed */
.lightbox-action-btn.lb-quote:hover {
  color: var(--accent);
}

.lightbox-action-btn.lb-quote:hover svg {
  opacity: 1;
}

.lightbox-action-btn.favourited {
  color: var(--fav, #f4b942);
}

.lightbox-action-btn.favourited svg {
  opacity: 1;
}

.lightbox-action-btn.lb-fav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lightbox-action-btn.favoriting svg {
  animation: starFavorite 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lightbox-action-btn.favoriting,
.lightbox-action-btn.unfavoriting {
  color: var(--fav, #f4b942);
}

.lightbox-action-btn.favoriting svg,
.lightbox-action-btn.unfavoriting svg {
  opacity: 1;
}

.lightbox-action-btn.unfavoriting svg {
  animation: starUnfavorite 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lightbox-action-btn.unfavorite-fade svg {
  animation: fadeOut 0.3s ease-out forwards;
}

.lightbox-action-btn.lightbox-action-open {
  color: rgba(255, 255, 255, 0.55);
}

.lightbox-action-btn.lightbox-action-open:hover {
  color: #fff;
}

/* ALT button in the toolbar */
.lightbox-action-btn.lb-alt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.5);
  padding: 7px 9px;
  min-width: unset;
}

.lightbox-action-btn.lb-alt:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-action-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
  flex-shrink: 0;
  align-self: center;
}

/* Boost / Quote dropdown within the lightbox */
.lightbox-action-boost-wrap {
  position: relative;
  display: inline-flex;
}

.lightbox-boost-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px;
  min-width: 150px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  z-index: 3200;
  flex-direction: column;
  gap: 2px;
}

.lightbox-boost-dropdown.show {
  display: flex;
}

.lightbox-boost-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}

.lightbox-boost-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hide Mastodon's native fallback quote inline text */
.quote-inline {
  display: none !important;
}

/* ─── Quote ─── */
.post-quote {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface2);
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}

.post-quote:hover {
  border-color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

/* ─── Card (Link Preview) ─── */
body.hide-cards-enabled .post-card {
  display: none !important;
}

.post-card {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  max-width: 550px;
  border: 1px solid rgba(155, 127, 255, 0.25);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  background: var(--surface2);
  background-image: linear-gradient(to right,
      rgba(155, 127, 255, 0.13) 0%,
      rgba(155, 127, 255, 0.03) 100%);
  transition:
    border-color var(--trans),
    background var(--trans);
  color: var(--text);
}

/* dark mode: push card surface clearly above the #0d0d0f feed bg */
:root:not([data-theme="light"]) .post-card {
  background: #21212d;
}

.post-card:hover {
  border-color: rgba(155, 127, 255, 0.35);
  border-left-color: var(--accent2);
  background-image: linear-gradient(to right,
      rgba(155, 127, 255, 0.17) 0%,
      rgba(155, 127, 255, 0.04) 100%);
}

.post-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.post-card-image {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  object-position: center;
  border-bottom: 1px solid var(--border);
  display: block;
}

.post-card-video-wrapper {
  position: relative;
  cursor: pointer;
  display: flex;
}

.post-card-video-wrapper:hover .post-card-play-overlay {
  background: rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%) scale(1.05);
}

.post-card-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--trans);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.post-card-play-overlay svg {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  /* visually center the play triangle */
}

.post-card-iframe-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Default fallback for missing metadata */
  background: black;
  border-bottom: 1px solid var(--border);
}

.post-card-content {
  padding: 12px 14px;
}

.post-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

:root:not([data-theme="light"]) .post-card-title {
  color: #d0d0e0;
}

:root[data-theme="light"] .post-card-title {
  color: var(--text);
}

.post-card-description {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.post-card-provider {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(155, 127, 255, 0.15);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}

.post-card-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  display: block;
}

.post-card-provider-name {
  color: var(--accent);
  opacity: 0.75;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.post-card-provider-domain {
  color: var(--text-dim);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

/* ─── Poll ─── */
.post-poll {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.poll-option {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
  font-size: 13px;
  overflow: hidden;
}

.poll-option:last-child {
  border-bottom: none;
}

.poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(155, 127, 255, 0.1);
  transition: width 0.5s ease;
}

.poll-option-text {
  position: relative;
  z-index: 1;
}

.poll-pct {
  float: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.poll-meta {
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
}

.poll-option--voting {
  cursor: pointer;
  display: flex !important;
  align-items: center;
  gap: 12px;
  transition: background var(--trans);
  position: relative;
  z-index: 1;
}

.poll-option--voting:hover {
  background: rgba(255, 255, 255, 0.035);
}

.poll-option--voting:active {
  background: rgba(255, 255, 255, 0.07);
}

.poll-input {
  accent-color: var(--accent);
  cursor: pointer;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
  border: 2px solid var(--border);
  background: var(--bg);
}

.poll-vote-btn {
  display: block;
  width: calc(100% - 28px);
  margin: 14px 14px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  text-align: center;
}

.poll-vote-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(155, 127, 255, 0.25);
}

.poll-vote-btn:active {
  transform: scale(0.98);
}

.poll-vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-dim);
  box-shadow: none;
}

.poll-own-vote-icon {
  color: var(--accent);
  font-weight: bold;
  margin-right: 4px;
  font-size: 14px;
}

/* ─── Post Footer (actions row) ─── */
.post-footer {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--trans);
}

.post-stat:hover {
  border-color: var(--border);
  background: var(--surface2);
}

.post-more-btn:hover {
  background: transparent !important;
  border-color: transparent !important;
}

.post-stat svg {
  opacity: 0.6;
}

/* Reply */
.post-reply-btn {
  cursor: pointer;
  transition: all var(--trans);
}

.post-reply-btn:hover {
  color: var(--teal);
}

.post-reply-btn:hover svg {
  opacity: 1;
}

/* Boost */
.post-boost-btn {
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
}

.post-boost-btn:hover,
.post-boost-btn.boosted {
  color: var(--boost);
}

.post-boost-btn:hover svg,
.post-boost-btn.boosted svg {
  opacity: 1;
}

.post-boost-btn.boosting,
.post-boost-btn.unboosting {
  color: var(--boost) !important;
}

.post-boost-btn.boosting svg {
  animation: boostPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

.post-boost-btn.unboosting svg {
  animation: boostUnpop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* Quote */
.post-quote-btn {
  cursor: pointer;
  transition: all var(--trans);
}

.post-quote-btn:hover {
  color: var(--accent);
}

.post-quote-btn:hover svg {
  opacity: 1;
}

/* Boost dropdown menu */
.boost-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 200;
  min-width: 160px;
}

.boost-dropdown.show {
  display: flex;
}

/* Footer-specific more dropdown polish */
.footer-more-dropdown {
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  background: rgba(var(--bg-rgb), 0.88);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 0;
  width: max-content;
}

.footer-more-dropdown .boost-dropdown-item {
  gap: 10px;
  opacity: 0.9;
  padding: 9px 14px;
  white-space: nowrap;
}

.footer-more-dropdown .boost-dropdown-item span {
  font-size: 13px;
}

.footer-more-dropdown .boost-dropdown-item:hover {
  background: var(--surface2);
  opacity: 1;
}

.footer-more-dropdown .visibility-item {
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.footer-more-dropdown .vis-label-text {
  font-size: 13px;
  font-weight: 500;
}

.boost-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--trans);
}

.boost-dropdown-item:hover {
  background: var(--surface2);
}

/* Favorite */
.post-fav-btn {
  cursor: pointer;
  transition: all var(--trans);
}

.post-fav-btn:hover {
  color: var(--fav);
}

.post-fav-btn:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

.post-fav-btn.favourited {
  color: var(--fav);
}

.post-fav-btn.favourited svg {
  opacity: 1;
}

.post-fav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.post-fav-btn.favoriting svg {
  animation: starFavorite 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.post-fav-btn.favoriting,
.post-fav-btn.unfavoriting {
  color: var(--fav);
}

.post-fav-btn.favoriting svg,
.post-fav-btn.unfavoriting svg {
  opacity: 1;
}

.post-fav-btn.unfavoriting svg {
  animation: starUnfavorite 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.post-fav-btn.unfavorite-fade svg {
  animation: fadeOut 0.3s ease-out forwards;
}

/* Bookmark */
.post-bookmark-btn {
  cursor: pointer;
  transition: all var(--trans);
  color: var(--text-muted);
}

.post-bookmark-btn:hover {
  color: var(--accent2);
}

.post-bookmark-btn:hover svg {
  transform: scale(1.1);
}

.post-bookmark-btn.bookmarked {
  color: var(--accent2);
}

/* ─── Translation Shimmer ─── */
.post-content.translating {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
  min-height: 52px;
}

.post-content.translating::before,
.post-content.translating::after {
  content: "";
  position: absolute;
  left: 0;
  height: 14px;
  background: var(--surface2);
  background: linear-gradient(90deg,
      var(--surface2) 25%,
      var(--border) 37%,
      var(--surface2) 63%);
  background-size: 400% 100%;
  animation: translate-skeleton-shimmer 1.4s infinite linear;
  border-radius: 6px;
}

.post-content.translating::before {
  top: 4px;
  width: 100%;
}

.post-content.translating::after {
  top: 28px;
  width: 70%;
}

@keyframes translate-skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

.post-content.translating * {
  visibility: hidden !important;
}

/* ─── Translate Indicator Badge ─── */
.translate-indicator {
  position: absolute;
  top: -1.5px;
  right: -1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 9.5px;
  height: 9.5px;
  font-size: 6px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}

.translate-indicator span {
  transform: translateY(-0.25px);
}

.post-bookmark-btn.bookmarked svg {
  fill: currentColor;
}

.post-bookmark-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.post-bookmark-btn.bookmarking svg {
  animation: bookmarkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ─── Section Header (hashtag grouping) ─── */
.section-header {
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.section-header-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-header-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ─── Footer Translate Button ─── */
.post-footer-separator {
  width: 1px;
  height: 12px;
  background: var(--border);
  opacity: 0.6;
  margin: 0 4px;
}

.post-translate-btn {
  cursor: pointer;
  transition: all var(--trans);
}

.post-translate-btn:hover {
  color: var(--accent);
}

.post-translate-btn:hover svg {
  opacity: 1;
}

.post-translate-btn.active {
  color: var(--accent);
}

.post-translate-btn.active svg {
  opacity: 1;
}

.post-translate-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* External link & visibility pill */
.post-external-link {
  text-decoration: none;
}

.post-external-link svg {
  display: block;
  opacity: 0.55;
}

.post-vis-btn svg {
  display: block;
  opacity: 0.55;
}

.post-vis-btn:hover {
  border-color: transparent !important;
  background: transparent !important;
}

/* ─── Responsive ─── */
@media (max-width: 500px) {
  .post {
    padding: 16px 14px 7px 12px;
  }

  .section-header {
    padding: 14px 14px 8px;
  }

  .post-content {
    font-size: var(--app-font-size, 14px);
  }

  .post-media,
  .post-media-grid,
  .media-item {
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

/* ═══════════════════════════════════════════════
   CUSTOM VIDEO PLAYER
   ═══════════════════════════════════════════════ */

/* Wrapper - disables the default browser chrome */
.video-player-wrap {
  cursor: default;
}

.video-player-wrap video {
  pointer-events: none;
  display: block;
}

/* Big centered play overlay - visible while paused */
.vid-overlay-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}

.video-player-wrap.vp-playing .vid-overlay-play {
  opacity: 0;
  pointer-events: none;
}

.vid-overlay-btn {
  width: 52px;
  height: 52px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.15s, transform 0.15s;
}

.vid-overlay-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
  fill: currentColor;
}

.video-player-wrap:hover .vid-overlay-btn {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.08);
}

/* Bottom controls bar */
.vid-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.video-player-wrap:hover .vid-controls,
.video-player-wrap.vp-controls-visible .vid-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Hide controls & overlay when content is blurred behind a sensitive warning */
.video-player-wrap:has(video.media-sensitive-blur) .vid-controls,
.video-player-wrap:has(video.media-sensitive-blur) .vid-overlay-play {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Small icon buttons */
.vid-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: color 0.1s, transform 0.1s;
}

.vid-btn:hover {
  color: #fff;
  transform: scale(1.15);
}

.vid-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Progress scrubber */
.vid-progress {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
  overflow: visible;
}

/* Expand the touch/click target without changing the visual size */
.vid-progress::before {
  content: "";
  position: absolute;
  inset: -10px 0;
  z-index: 1;
}

.video-player-wrap:hover .vid-progress,
.vid-progress.vp-scrubbing {
  height: 5px;
}

.vid-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: #fff;
  width: 0%;
  pointer-events: none;
  position: relative;
  overflow: visible;
}

/* Remove the linear width transition while scrubbing so it tracks the finger */
.vid-progress.vp-scrubbing .vid-progress-fill {
  transition: none;
}

/* Scrub knob - sits at the leading edge of the fill */
.vid-progress-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}

/* Show knob when controls are visible */
.video-player-wrap:hover .vid-progress-fill::after,
.video-player-wrap.vp-controls-visible .vid-progress-fill::after,
.vid-progress.vp-scrubbing .vid-progress-fill::after {
  transform: translateY(-50%) scale(1);
}

/* Slightly larger knob while actively dragging */
.vid-progress.vp-scrubbing .vid-progress-fill::after {
  width: 12px;
  height: 12px;
  right: -6px;
}

/* Time readout */
.vid-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Icon visibility - controlled via CSS classes */
.video-player-wrap .vp-icon-pause {
  display: none;
}

.video-player-wrap.vp-playing .vp-icon-play {
  display: none;
}

.video-player-wrap.vp-playing .vp-icon-pause {
  display: block;
}

.video-player-wrap .vp-icon-mute {
  display: none;
}

.video-player-wrap.vp-muted .vp-icon-sound {
  display: none;
}

.video-player-wrap.vp-muted .vp-icon-mute {
  display: block;
}

/* Lightbox video player wrapper */
.vid-lightbox-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  background: #000;
  max-width: min(90vw, 960px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.vid-lightbox-wrap video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  width: auto;
  height: auto;
  background: #000;
  cursor: default;
  border-radius: 0;
  box-shadow: none;
}

/* --- Hashtag Show More --- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.post-tags-extra {
  display: none;
}

.post-tags--expanded .post-tags-extra {
  display: inline;
}

.post-tags-toggle,
.post-tags-less-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  padding: 1px 6px;
  margin: 0 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: baseline;
  transition: all var(--trans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.post-tags-toggle:hover,
.post-tags-less-toggle:hover {
  background: var(--surface);
  border-color: var(--border2);
  color: var(--text);
  text-decoration: none;
}

.hashtag-pills-enabled .post-tags-toggle,
.hashtag-pills-enabled .post-tags-less-toggle {
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.9em;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.2;
  margin: 2px 1px;
}

.hashtag-pills-enabled .post-tags-toggle {
  color: var(--accent);
  border-color: var(--border);
}

.hashtag-pills-enabled .post-tags-less-toggle {
  color: var(--text-dim);
  display: none;
}

.post-tags--expanded .post-tags-toggle {
  display: none !important;
}

.post-tags--expanded .post-tags-less-toggle {
  display: inline-flex !important;
}