/* ── MAIN CONTENT ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 24px 20px;
}
body.sidebar-collapsed .main-content {
  padding-left: 34px;
}

/* Mobile ad strip */
.mobile-ad-strip { display: none; text-align: center; margin-bottom: 16px; }

.feed-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.045), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.012) 100%),
    var(--bg-card);
  transition: border-radius 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.feed-context-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.feed-context-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.feed-context-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  min-width: 0;
}
.feed-context-title-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 2px;
  min-width: 0;
}
.feed-context-title {
  margin: 0;
  min-width: 0;
  flex: 0 1 auto;
  font-size: clamp(17px, 1.8vw, 23px);
  line-height: 1.08;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}
.feed-context-default-btn {
  width: 14px;
  min-width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -1px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.56;
  transition: color .18s ease, opacity .18s ease;
}
.feed-context-default-btn[hidden] {
  display: none !important;
}
.feed-context-default-btn svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}
.feed-context-default-btn:hover,
.feed-context-default-btn:focus-visible {
  color: var(--text-muted);
  opacity: 0.95;
  outline: none;
}
.feed-context-subtitle {
  margin-top: 4px;
  max-width: 72ch;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-subtle);
}
.feed-context-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.feed-context-toggle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.feed-context-toggle:hover {
  color: var(--text);
  border-color: rgba(255,61,95,0.35);
}
.feed-context-toggle .svg-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}
.feed-context.is-expanded .feed-context-toggle .svg-icon {
  transform: rotate(180deg);
}
.feed-context-details {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 5px;
  transition: grid-template-rows 0.22s ease, opacity 0.18s ease, margin-top 0.18s ease;
}
.feed-context-details-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 5px 8px;
  overflow: hidden;
}
.feed-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 100%;
  min-width: 0;
}
.feed-context-details .feed-context-subtitle {
  width: 100%;
  margin-top: 0;
  margin-bottom: 5px;
}
.feed-context:not(.is-expanded) .feed-context-details {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}
.feed-context.is-static,
.feed-context.is-static .feed-context-details,
.feed-context.is-static .feed-context-toggle .svg-icon {
  transition: none !important;
}
.feed-context-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 10px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text-subtle);
  white-space: normal;
  overflow-wrap: anywhere;
}
.feed-context-action {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.feed-context-action:hover {
  color: var(--accent);
  border-color: rgba(255,61,95,0.35);
}

[data-theme="light"] .feed-context {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.8), transparent 45%),
    linear-gradient(180deg, rgba(255,61,95,0.05) 0%, rgba(255,61,95,0.015) 100%),
    var(--bg-card);
}
[data-theme="light"] .feed-context-subtitle {
  color: var(--text-subtle);
}

/* ── GALLERY GRID ────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 12px;
  align-items: stretch;
}

/* ── POST CARD ───────────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-self: start;        /* height set by aspect-ratio, not row — ad cards override this */
  transition: box-shadow var(--trans), border-color var(--trans);
  cursor: pointer;
  position: relative;
  z-index: 1;
  isolation: isolate;
}
.post-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-light);
  z-index: 2;
}

.post-thumb {
  position: relative;
  aspect-ratio: 3/4;        /* portrait default — uniform card heights, content cropped */
  overflow: hidden;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.4s ease;
  opacity: 0;
}
.post-thumb img.img-loaded,
.post-thumb.thumb-loaded img { opacity: 1; }
/* hover zoom removed — conflicts with gif/video preview */

/* Grid-1 album crossfade + scale animation */
@keyframes albumSlideInRight  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes albumSlideInLeft   { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes albumSlideOutLeft  { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes albumSlideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
.card-album-in-right, .card-album-in-left, .card-album-out-left, .card-album-out-right { transition: none !important; }
.card-album-in-right  { animation: albumSlideInRight  0.22s ease forwards !important; }
.card-album-in-left   { animation: albumSlideInLeft   0.22s ease forwards !important; }
.card-album-out-left  { animation: albumSlideOutLeft  0.22s ease forwards !important; }
.card-album-out-right { animation: albumSlideOutRight 0.22s ease forwards !important; }

/* Shimmer placeholder — visible until image loads */
.post-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-card) 40%,
    var(--bg-elevated) 60%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}
/* Hide shimmer once image is loaded, or when it's an ad / placeholder */
.post-thumb.thumb-loaded::before,
.post-thumb:has(.post-thumb-placeholder)::before,
.post-thumb.ad-thumb::before { display: none; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Col 1: full-viewport cards ──────────────────────────────── */
body.grid-cols-1 .post-card {
  height: calc(100vh - var(--header-h) - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.grid-cols-1 .post-thumb {
  aspect-ratio: unset;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.grid-cols-1 .post-thumb img {
  object-fit: contain;
  background: var(--bg-elevated);
}
body.grid-cols-1 .post-info {
  flex-shrink: 0;
  min-height: 0;
}
body.grid-cols-1 .post-card:hover .post-thumb img { transform: none; }
body.grid-cols-1 .card-video {
  position: absolute;
  inset: unset;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 700px) {
  .feed-context {
    padding: 9px 10px;
    margin-bottom: 10px;
  }
  .feed-context-top-row {
    gap: 8px;
  }
  .feed-context-title {
    font-size: clamp(15px, 4.8vw, 18px);
  }
  .feed-context-toggle,
  .feed-context-action {
    min-height: 26px;
    padding: 0 9px;
  }
  .feed-context-toggle {
    width: 26px;
    min-width: 26px;
    padding: 0;
  }
  .feed-context-chip {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
    line-height: 1.05;
  }
  .feed-context-meta {
    column-gap: 6px;
    row-gap: 4px;
  }
  .feed-context-details .feed-context-subtitle {
    margin-bottom: 4px;
  }
}

/* ── Card video preview ───────────────────────────────────────────────── */
.card-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.card-previewing .card-video  { opacity: 1; }
.card-previewing .card-poster { transform: none; } /* suppress scale while video plays */

/* Progress bar */
.card-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 5px;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.2s ease, height 0.15s ease;
  cursor: pointer;
  z-index: 2;
}
.card-previewing .card-progress { opacity: 1; }
.card-paused .card-progress { opacity: 1; }
/* Expand bar height on hover for easier click/tap targeting — pointer devices only */
@media (hover: hover) and (pointer: fine) {
  .card-progress:hover { height: 8px; }
}
.card-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent, #e05);
  transition: width 0.25s linear;
  border-radius: 0 2px 2px 0;
}

/* Placeholder shown when no thumbnail available */
.post-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    135deg,
    var(--bg-elevated),
    var(--bg-elevated) 10px,
    var(--bg-card) 10px,
    var(--bg-card) 20px
  );
}
.placeholder-domain {
  font-size: 11px;
  font-family: monospace;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 8px;
  word-break: break-all;
}

.post-type-badge,
.post-subreddit-badge {
  cursor: pointer;
  transition: background 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .post-type-badge:hover { background: rgba(0,0,0,0.97) !important; }
  .post-subreddit-badge:hover { background: rgba(0,0,0,0.97) !important; }
}
/* Active state — desktop click flash + mobile tap feedback */
.post-type-badge:active,
.post-subreddit-badge:active {
  background: rgba(0,0,0,0.97) !important;
  transform: scale(0.93);
  transition: transform 0.08s ease, background 0.08s ease;
}
.post-thumb-toprow {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  z-index: 3;
  pointer-events: none;
}
.post-thumb-toprow > * {
  pointer-events: auto;
}
.post-type-badge {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.post-type-badge .svg-icon {
  width: var(--post-media-icon-size);
  height: var(--post-media-icon-size);
}
.post-type-badge.video   { color: #ffcc44; }
.post-type-badge.gallery { color: #44ccff; }
.post-type-badge.image   { color: #aaaaaa; }
/* GIF badge — teal, distinct from image (grey) and video (yellow).
   The 'gif' Material Icon glyph is wider than typical icons so we tighten padding. */
.post-type-badge.gif {
  color: #00d2be;
  padding-left: 4px;
  padding-right: 4px;
  letter-spacing: 0;
}
.post-type-badge.gif .material-icons { line-height: 1; }


/* Gallery lightbox internal navigation */
.gallery-lb-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.lb-gal-prev, .lb-gal-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(18,18,20,0.78);
  border: none; color: #fff; font-size: 20px;
  padding: 10px 14px; cursor: pointer; border-radius: 6px;
  pointer-events: auto;
  z-index: 20;
  box-shadow: 0 8px 22px rgba(0,0,0,0.24);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  isolation: isolate;
  will-change: transform, background-color;
}
.lb-gal-prev:hover, .lb-gal-next:hover { background: rgba(18,18,20,0.94); box-shadow: 0 10px 26px rgba(0,0,0,0.3); }
.lb-gal-prev:disabled, .lb-gal-next:disabled { opacity: 0.2; cursor: default; }
.lb-gal-prev { left: 8px; }
.lb-gal-next { right: 8px; }

.post-subreddit-badge {
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  display: block;
  margin-left: auto;
  min-width: 0;
  max-width: 25ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Badge/button scaling via container queries — based on actual card width, not col count */
.post-card {
  container-type: inline-size;
  container-name: card;
}
.post-thumb {
  --post-media-icon-size: 12px;
  --col-menu-btn-size: 32px;
  --col-menu-icon-size: 18px;
  --media-feedback-circle-size: clamp(42px, calc(var(--col-menu-btn-size) * 1.7), 74px);
  --media-feedback-halo-size: clamp(54px, calc(var(--col-menu-btn-size) * 2.15), 96px);
}

/* <120px: icon only — extremely small thumbnails */
@container card (max-width: 119px) {
  .post-type-badge, .post-subreddit-badge { font-size: 9px; padding: 2px 4px; }
  .post-type-badge .material-icons { font-size: 10px !important; }
  .post-thumb { --post-media-icon-size: 10px; --col-menu-btn-size: 24px; --col-menu-icon-size: 14px; }
  .post-subreddit-badge { display: none; }
}

/* 120-179px: small */
@container card (min-width: 120px) and (max-width: 179px) {
  .post-type-badge, .post-subreddit-badge { font-size: 10px; padding: 2px 5px; }
  .post-type-badge .material-icons { font-size: 11px !important; }
  .post-thumb { --post-media-icon-size: 11px; --col-menu-btn-size: 28px; --col-menu-icon-size: 16px; }
}

/* 180-279px: default */
@container card (min-width: 180px) and (max-width: 279px) {
  .post-type-badge, .post-subreddit-badge { font-size: 11px; padding: 3px 7px; }
  .post-type-badge .material-icons { font-size: 12px !important; }
  .post-thumb { --post-media-icon-size: 12px; --col-menu-btn-size: 32px; --col-menu-icon-size: 18px; }
}

/* 280-399px: medium-large */
@container card (min-width: 280px) and (max-width: 399px) {
  .post-type-badge, .post-subreddit-badge { font-size: 13px; padding: 4px 8px; }
  .post-type-badge .material-icons { font-size: 14px !important; }
  .post-thumb { --post-media-icon-size: 15px; --col-menu-btn-size: 38px; --col-menu-icon-size: 21px; }
}

/* 400px+: large thumbnails */
@container card (min-width: 400px) {
  .post-type-badge, .post-subreddit-badge { font-size: 15px; padding: 5px 10px; }
  .post-type-badge .material-icons { font-size: 16px !important; }
  .post-thumb { --post-media-icon-size: 18px; --col-menu-btn-size: 46px; --col-menu-icon-size: 24px; }
}

/* ── Post-info scaling + spacing via container queries ───────────────────── */

/* Default (base) — tightest spacing */
.post-info {
  padding: 6px 8px 8px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  z-index: 1;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

/* Post-info collapse */
.post-info-hidden { display: none; }
.post-info-hidden ~ * { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.post-card:has(.post-info-hidden) .post-thumb { border-radius: var(--radius-lg); }
body.hide-post-info .post-info { display: none; }
body.hide-post-info .post-thumb { border-radius: var(--radius-lg); }

/* ── Square thumbnails mode ──────────────────────────────────── */
/* Excludes ad cards and grid-1 (full view) */
body.square-thumbs:not(.grid-cols-1) .post-card:not(.ad-card-natural) .post-thumb {
  aspect-ratio: 1/1;
}

/* Post-info top row */
.post-info-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.post-info-top .post-title { flex: 1; }

.post-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
.post-meta-item { display: flex; align-items: center; gap: 2px; flex-shrink: 1; min-width: 0; }
.post-meta .ups { color: var(--accent); font-weight: 600; flex-shrink: 0; white-space: nowrap; }
.post-meta .date { flex-shrink: 0; white-space: nowrap; }
.post-meta .author { display: block !important; flex-shrink: 1; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-meta .card-actions { margin-left: auto; flex-shrink: 0; }

/* ── Card action bar ─────────────────────────────────────────────────────── */
.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
  line-height: 1;
  text-decoration: none;
  border-radius: 4px;
}
.card-action-btn.active { opacity: 1; color: var(--accent); }
.card-action-btn.is-confirming {
    opacity: 1;
    color: #ffcf5a;
    background: rgba(255, 207, 90, 0.08);
  }
.card-action-btn--locked { position: relative; }
.card-action-lock {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,10,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.78);
}
.card-action-lock .svg-icon {
  width: 9px;
  height: 9px;
}
.card-action-btn .material-icons { font-size: 13px; }
.card-action-btn--danger {
  margin-left: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .card-action-btn:hover { opacity: 1; color: var(--accent); }
  .card-action-btn.is-confirming:hover { color: #ffcf5a; }
}
.card-action-btn:active {
  opacity: 1;
  color: var(--accent);
  transform: scale(0.82);
}

/* Dots overflow menu */
.card-actions-overflow { position: relative; }
.card-actions-menu {
  display: none;
  position: fixed;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  min-width: 140px;
  z-index: 9998;
  overflow: hidden;
}
.card-actions-menu.open { display: block; }
.card-action-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.card-action-menu-item .svg-icon {
  flex: 0 0 auto;
  transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.card-action-menu-item.is-confirming {
    color: #ffcf5a;
    background: rgba(255, 207, 90, 0.08);
  }
.card-action-menu-item-locked {
  color: rgba(255,255,255,0.42);
}
.card-action-menu-item.card-action-menu-item-locked,
.card-action-menu-item.card-action-menu-item-danger.card-action-menu-item-locked {
  color: rgba(255,255,255,0.42);
}
.card-action-menu-lock {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: rgba(255,255,255,0.42);
}
.card-action-menu-lock .svg-icon {
  width: 13px;
  height: 13px;
}
.card-action-menu-item-locked:hover {
  color: rgba(255,255,255,0.42);
  background: rgba(255,255,255,0.035);
}
.card-action-menu-item.card-action-menu-item-locked .svg-icon,
.card-action-menu-item.card-action-menu-item-locked .material-icons {
  color: inherit;
}
.card-action-menu-item.is-confirming .svg-icon {
  transform: scale(1.04);
}
.card-action-menu-divider {
  height: 1px;
  margin: 4px 10px;
  background: rgba(255,255,255,0.08);
}
[data-theme="light"] .card-action-menu-divider {
  background: rgba(0,0,0,0.08);
}
.card-action-menu-item-danger {
  color: var(--text);
}
.card-action-menu-item:hover { background: rgba(255,255,255,0.06); } /* dark mode */
[data-theme="light"] .card-action-menu-item:hover { background: rgba(0,0,0,0.06); }
[data-theme="light"] .card-action-lock {
  background: rgba(255,255,255,0.96);
  border-color: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.62);
}
[data-theme="light"] .card-action-menu-item-locked,
[data-theme="light"] .card-action-menu-item.card-action-menu-item-locked,
[data-theme="light"] .card-action-menu-item.card-action-menu-item-danger.card-action-menu-item-locked,
[data-theme="light"] .card-action-menu-lock {
  color: rgba(0,0,0,0.48);
}
[data-theme="light"] .card-action-menu-item-locked:hover {
  color: rgba(0,0,0,0.48);
  background: rgba(0,0,0,0.04);
}
.card-action-menu-item .material-icons { font-size: 14px; color: var(--text-muted); }

.group-detail-toggle.is-confirming {
  color: #ffcf5a;
  border-color: rgba(255, 207, 90, 0.32);
  background: rgba(255, 207, 90, 0.12);
}
.group-detail-toggle.is-confirming:hover {
  color: #ffcf5a;
  background: rgba(255, 207, 90, 0.16);
}

/* Scaling + collapse via container queries */
/* 180px+: a bit more room */
@container card (min-width: 180px) {
  .post-info { padding: 7px 10px 9px; }
  .post-title { font-size: 12px; }
  .post-meta { font-size: 10px; gap: 7px; }
  .card-action-btn .material-icons { font-size: 14px; }
}

/* Default: dots mode — hide inline buttons, show dots */
.card-action-btn:not(.card-action-dots) { display: none; }

/* 400px+: inline mode — show buttons, hide dots */
@container card (min-width: 400px) {
  .card-action-btn:not(.card-action-dots) { display: flex; }
  .card-actions-overflow { display: none; }
}


/* Toast */
#scrollTopBtn {
  position: fixed;
  bottom: 15px;
  right: 0;
  width: 13px;
  height: 48px;
  border-radius: 6px 0 0 6px;
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s ease, border-color 0.15s ease;
  z-index: 998;
}
#scrollTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
@media (hover: hover) and (pointer: fine) {
  #scrollTopBtn:hover { color: var(--accent); border-color: var(--accent); }
}
#scrollTopBtn:active {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 0.7;
}
#scrollTopBtn .material-icons { font-size: 14px; }

#rpToast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20,20,20,0.95);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
#rpToast[data-tone="success"] {
  background: rgba(24, 88, 54, 0.96);
  border-color: rgba(115, 224, 164, 0.28);
}
#rpToast[data-tone="error"] {
  background: rgba(92, 28, 38, 0.96);
  border-color: rgba(255, 120, 140, 0.24);
}
#rpToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── AD CARD IN GRID ─────────────────────────────────────────── */
.ad-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  position: relative;
  padding: 16px;
}
.ad-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
}
.ad-native { min-height: 200px; }

/* ── LOAD MORE / SPINNER ────────────────────────────────────── */
.load-trigger {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}
.load-trigger.is-suppressed {
  visibility: hidden;
  pointer-events: none;
}
.load-trigger-end {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 520px);
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}
.load-trigger-end::before,
.load-trigger-end::after {
  content: '';
  flex: 1 1 auto;
  min-width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}
.load-trigger.is-end .load-trigger-end {
  display: flex;
  opacity: 1;
}
.load-trigger.is-end .spinner {
  display: none;
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0;
  transition: opacity var(--trans);
}
.spinner.active { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }


