/**
 * Live Feed — Premium v2 visual system
 *
 * Standalone-scoped styles for the race-day feed (#live-feed-app / .rd-feed).
 *
 * v4 — Premium redesign #2: floating cards with rounded corners + drop shadow,
 *      explicit React/Comment/Share action bar, reaction summary with avatar
 *      stack, cheer meter, pinned posts, bookmarks, seen-by receipts,
 *      @mention styling, comment replies (1 level deep).
 */

/* --- Page Reset (standalone live feed page only) --- */
/* Scoped to #live-feed-app parent to avoid overriding race-day-v3 layout */
#live-feed-app {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: #060609;
  color: var(--text, #F8FAFC);
  font-family: var(--font-sans, "Barlow", system-ui, -apple-system, sans-serif);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  background:
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(34, 211, 238, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(59, 130, 246, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #07070B 0%, #0B0C12 100%);
}

/* --- Header --- */
.lf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(7,7,11,0.85) 60%, rgba(7,7,11,0) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 10;
}
.lf-header__brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lf-header__runner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lf-header__runner-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #F8FAFC);
}
.lf-header__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: lf-pulse 2s ease-in-out infinite;
}
.lf-header__live-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #22C55E;
}

@keyframes lf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* --- Stats Banner --- */
.lf-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.lf-stats__item {
  text-align: center;
}
.lf-stats__value {
  font-size: 22px;
  font-weight: 700;
  color: #F8FAFC;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.lf-stats__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.7);
  margin-top: 3px;
}

/* --- Cheer Meter (panel above the feed) --- */
.lf-cheer-meter {
  flex-shrink: 0;
  margin: 10px 16px 14px;
  padding: 14px 18px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(236, 72, 153, 0.10), rgba(236, 72, 153, 0.02)),
    rgba(15, 23, 42, 0.55);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 0 0 1px rgba(148, 163, 184, 0.06),
    0 8px 24px -12px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 14px;
}
.lf-cheer-meter__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(236,72,153,0.35), rgba(236,72,153,0.10));
  border: 1px solid rgba(236,72,153,0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.lf-cheer-meter__body { flex: 1; min-width: 0; }
.lf-cheer-meter__label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lf-cheer-meter__count {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #F4F6FB;
  margin-top: 2px;
}
.lf-cheer-meter__count-sub {
  color: rgba(148, 163, 184, 0.5);
  font-weight: 500;
}
.lf-cheer-meter__bar {
  margin-top: 8px;
  height: 4px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.lf-cheer-meter__fill {
  height: 100%;
  background: linear-gradient(90deg, #EC4899, #22D3EE);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Loading / Empty / Error --- */
.lf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 16px;
  color: rgba(148, 163, 184, 0.6);
  font-size: 14px;
}
.lf-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(148, 163, 184, 0.15);
  border-top-color: #06B6D4;
  border-radius: 50%;
  animation: lf-spin 0.8s linear infinite;
}
@keyframes lf-spin { to { transform: rotate(360deg); } }

/* Shimmer loading skeleton */
.lf-shimmer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.lf-shimmer__card {
  background: rgba(30, 41, 59, 0.4);
  border-radius: 18px;
  height: 120px;
  position: relative;
  overflow: hidden;
}
.lf-shimmer__card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  animation: lf-shimmer-sweep 1.5s ease-in-out infinite;
}
@keyframes lf-shimmer-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.lf-empty {
  text-align: center;
  padding: 100px 40px;
}
.lf-empty__icon {
  font-size: 56px;
  margin-bottom: 16px;
  filter: grayscale(0.3);
}
.lf-empty__text {
  font-size: 15px;
  color: rgba(148, 163, 184, 0.6);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.lf-error {
  text-align: center;
  padding: 48px 20px;
  color: #EF4444;
  font-size: 14px;
}

/* --- Feed List (floating cards with gap) --- */
.lf-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 16px 120px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Feed Card — floating, rounded, shadowed --- */
.lf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: rgba(20, 24, 36, 0.65);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 0 0 1px rgba(148, 163, 184, 0.06),
    0 8px 24px -12px rgba(0,0,0,0.6),
    0 2px 6px -2px rgba(0,0,0,0.4);
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  animation: lf-card-enter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes lf-card-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Left accent rail — color-coded by type */
.lf-card::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #22D3EE 0%, transparent 100%);
  opacity: 0.7;
  z-index: 1;
}
.lf-card--photo::before      { background: linear-gradient(180deg, #3B82F6 0%, transparent 100%); }
.lf-card--milestone::before  { background: linear-gradient(180deg, #F59E0B 0%, transparent 100%); }
.lf-card--cheer::before      { background: linear-gradient(180deg, #EC4899 0%, transparent 100%); }
.lf-card--post::before       { background: linear-gradient(180deg, #22D3EE 0%, transparent 100%); }
.lf-card--system::before     { background: linear-gradient(180deg, rgba(148,163,184,0.5) 0%, transparent 100%); }

/* Pinned state */
.lf-card--pinned {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 0 0 1px rgba(245, 158, 11, 0.28),
    0 8px 24px -10px rgba(245, 158, 11, 0.25),
    0 2px 6px -2px rgba(0,0,0,0.4);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.06), transparent 30%),
    rgba(20, 24, 36, 0.65);
}
.lf-card__pin-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #F59E0B;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 16px 0 18px;
}

/* --- Card Head (type badge + lap + time + bookmark) --- */
.lf-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 8px 18px;
  flex-wrap: wrap;
}
.lf-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.10);
  color: #22D3EE;
  border: 1px solid rgba(34, 211, 238, 0.18);
  line-height: 1;
}
.lf-card--photo .lf-card__badge {
  background: rgba(59, 130, 246, 0.10);
  color: #60A5FA;
  border-color: rgba(59, 130, 246, 0.22);
}
.lf-card--milestone .lf-card__badge {
  background: rgba(245, 158, 11, 0.10);
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.22);
}
.lf-card--cheer .lf-card__badge {
  background: rgba(236, 72, 153, 0.10);
  color: #F472B6;
  border-color: rgba(236, 72, 153, 0.22);
}
.lf-card__lap {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(148,163,184,0.08);
  color: rgba(148, 163, 184, 0.75);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lf-card__time {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.5);
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.lf-card__bookmark {
  background: none;
  border: 0;
  color: rgba(148, 163, 184, 0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lf-card__bookmark:hover { color: #F59E0B; transform: scale(1.1); }
.lf-card__bookmark--active { color: #F59E0B; }

/* --- Card Body (author + text) --- */
.lf-card__body {
  padding: 2px 18px 0;
  position: relative;
  z-index: 2;
}
.lf-card__author {
  font-size: 12px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.8);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.lf-card__text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: #F4F6FB;
  word-wrap: break-word;
}
.lf-card__text--lead {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.015em;
}
/* Milestone lead style — icon box next to text */
.lf-card--milestone .lf-card__text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
}
.lf-card__milestone-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(245,158,11,0.08));
  border: 1px solid rgba(245,158,11,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* @mention inline highlight */
.lf-mention {
  color: #22D3EE;
  font-weight: 600;
}

/* Milestone data summary (existing) */
.rd-feed-card__milestone-summary {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.7);
  letter-spacing: 0.01em;
}

/* --- Edge-framed Media (rounded, inset) --- */
.lf-card__media-wrap {
  margin: 12px 12px 0;
}
.lf-card__media {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 8px 20px -10px rgba(0,0,0,0.6);
}
.lf-card__media + .lf-card__media {
  margin-top: 8px;
}
.lf-card__img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  background: #000;
}
.lf-card__video {
  width: 100%;
  max-height: 480px;
  display: block;
  background: #000;
}
.lf-card__audio {
  width: 100%;
  display: block;
}

/* --- Reaction Summary Row (above action bar) --- */
.lf-reaction-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 0;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.62);
  min-height: 22px;
}
.lf-reaction-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.lf-reaction-stack__chip {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid #07070B;
  margin-left: -5px;
  box-shadow: 0 2px 6px -2px rgba(0,0,0,0.5);
}
.lf-reaction-stack__chip:first-child { margin-left: 0; }
.lf-reaction-summary__names {
  color: rgba(148, 163, 184, 0.62);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.lf-reaction-summary__names strong {
  color: rgba(226, 232, 240, 0.85);
  font-weight: 600;
}
.lf-seen-by {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(34, 197, 94, 0.7);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* --- Reaction chips (existing emoji buttons, restyled) --- */
.lf-card__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px 0;
  flex-wrap: wrap;
}
.lf-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lf-emoji-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  line-height: 1;
}
.lf-emoji-btn__count {
  font-size: 11px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.7);
  min-width: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Active/selected state */
.lf-emoji-btn--active {
  background: linear-gradient(180deg, rgba(34,211,238,0.18), rgba(34,211,238,0.08));
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}
.lf-emoji-btn--active .lf-emoji-btn__count {
  color: #22D3EE;
}

/* Hover */
.lf-emoji-btn:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-1px);
}
.lf-emoji-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.lf-emoji-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Pop animation on react */
@keyframes lf-reaction-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.lf-emoji-btn--pop {
  animation: lf-reaction-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Emoji picker popover */
.lf-emoji-picker {
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  padding: 6px 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: lf-picker-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes lf-picker-in {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.lf-emoji-picker__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lf-emoji-picker__btn:hover {
  background: rgba(148, 163, 184, 0.1);
  transform: scale(1.15);
}
.lf-emoji-picker__btn:active {
  transform: scale(0.9);
}

/* --- Action Bar (React / Comment / Share) --- */
.lf-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  margin-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.10);
}
.lf-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  color: rgba(148, 163, 184, 0.62);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lf-action__icon {
  font-size: 16px;
  line-height: 1;
}
.lf-action__count {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.4);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.lf-action:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #F4F6FB;
}
.lf-action:active {
  transform: scale(0.98);
}
.lf-action--active {
  color: #22D3EE;
  background: rgba(34, 211, 238, 0.08);
}

/* --- Load More --- */
.lf-load-more {
  margin: 8px 20px;
  padding: 14px;
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  color: rgba(148, 163, 184, 0.5);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lf-load-more:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(148, 163, 184, 0.15);
}
.lf-load-more:disabled { opacity: 0.4; }

/* --- Cheer Bar (fixed bottom, glassmorphism) --- */
.lf-cheer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 14px);
  background: linear-gradient(0deg, rgba(7,7,11,0.92) 50%, rgba(7,7,11,0.6) 100%);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid rgba(148, 163, 184, 0.10);
  max-width: 520px;
  margin: 0 auto;
  box-sizing: border-box;
}
.lf-cheer-bar__name {
  flex: 1;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #F4F6FB;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}
.lf-cheer-bar__name::placeholder { color: rgba(148, 163, 184, 0.4); }
.lf-cheer-bar__name:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}
.lf-cheer-bar__btn {
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #22D3EE 0%, #3B82F6 100%);
  color: #0B1220;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 4px 14px -4px rgba(34, 211, 238, 0.5),
    0 2px 4px -1px rgba(34,211,238,0.3),
    0 0 0 1px rgba(34,211,238,0.4) inset;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.lf-cheer-bar__btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 6px 18px -4px rgba(34, 211, 238, 0.7),
    0 2px 6px -1px rgba(34,211,238,0.4),
    0 0 0 1px rgba(34,211,238,0.5) inset;
}
.lf-cheer-bar__btn:active:not(:disabled) {
  transform: scale(0.97);
}
.lf-cheer-bar__btn.sending {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.2);
}
.lf-cheer-bar__btn:disabled { cursor: default; opacity: 0.7; }

/* --- Comments Thread (avatar + bubble, with replies) --- */
.lf-comments {
  border-top: 1px solid rgba(148, 163, 184, 0.10);
  padding: 12px 18px 14px;
  background: rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lf-comments__expand {
  background: none;
  border: none;
  color: rgba(34, 211, 238, 0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: inherit;
  transition: color 0.15s ease;
}
.lf-comments__expand:hover { color: rgba(34, 211, 238, 1); }

.lf-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: lf-comment-in 0.25s ease both;
  position: relative;
}
@keyframes lf-comment-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Reply indent */
.lf-comment--reply {
  margin-left: 36px;
  position: relative;
}
.lf-comment--reply::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 10px;
  width: 12px;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.lf-comment__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #475569, #334155);
  color: #F4F6FB;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  letter-spacing: -0.02em;
}
.lf-comment--reply .lf-comment__avatar {
  width: 22px; height: 22px;
  font-size: 9px;
}
.lf-comment__main {
  flex: 1;
  min-width: 0;
}
.lf-comment__bubble {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.10);
  padding: 7px 12px;
  border-radius: 14px;
  display: inline-block;
  max-width: 100%;
}
.lf-comment__author {
  font-size: 11px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.85);
  letter-spacing: 0.01em;
}
.lf-comment__body {
  font-size: 13px;
  color: #F4F6FB;
  line-height: 1.45;
  margin-top: 1px;
  word-break: break-word;
}
.lf-comment__actions {
  display: flex;
  gap: 10px;
  padding-left: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.4);
  align-items: center;
}
.lf-comment__time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.lf-comment__action {
  background: none;
  border: 0;
  color: rgba(148, 163, 184, 0.55);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}
.lf-comment__action:hover { color: rgba(226, 232, 240, 0.85); }
.lf-comment__action--active { color: #22D3EE; }

/* --- Comment Input (used for both top-level and reply) --- */
.lf-comment-input {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  align-items: center;
}
.lf-comment-input--reply {
  margin-left: 36px;
  margin-top: 0;
}
.lf-comment-input__field {
  flex: 1;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  color: #F4F6FB;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}
.lf-comment-input__field::placeholder { color: rgba(148, 163, 184, 0.35); }
.lf-comment-input__field:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
}
.lf-comment-input__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(34, 211, 238, 0.15);
  border: none;
  border-radius: 50%;
  color: #22D3EE;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lf-comment-input__send:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.25);
}
.lf-comment-input__send:disabled {
  opacity: 0.3;
  cursor: default;
}

/* --- New entry highlight flash --- */
@keyframes lf-new-flash {
  0% { background-color: rgba(34, 211, 238, 0.10); }
  100% { background-color: transparent; }
}
.lf-card--new {
  animation: lf-card-enter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both,
             lf-new-flash 2s ease-out 0.4s both;
}

/* ============================================================
   MODERATION UI (runner + crew can edit/delete)
   ============================================================ */

.lf-card__mod {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.lf-card__mod-btn {
  background: rgba(15, 23, 42, 0.75);
  color: rgba(248, 250, 252, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lf-card__mod-btn:hover {
  background: rgba(15, 23, 42, 0.9);
}
.lf-card__mod-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.lf-card__mod-menu {
  position: absolute;
  top: 34px;
  right: 0;
  min-width: 170px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}

.lf-card__mod-item {
  background: transparent;
  color: #F8FAFC;
  border: 0;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.lf-card__mod-item:hover {
  background: rgba(148, 163, 184, 0.12);
}
.lf-card__mod-item--danger {
  color: #fca5a5;
}
.lf-card__mod-item--danger:hover {
  background: rgba(248, 113, 113, 0.15);
}

/* Inline edit textarea */
.lf-card__edit-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  color: #F8FAFC;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
  margin-top: 4px;
}
.lf-card__edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  justify-content: flex-end;
}
.lf-card__edit-cancel,
.lf-card__edit-save {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-family: inherit;
}
.lf-card__edit-cancel {
  background: transparent;
  color: rgba(248, 250, 252, 0.85);
}
.lf-card__edit-save {
  background: #22D3EE;
  color: #0B1220;
  border-color: #22D3EE;
  font-weight: 700;
}
.lf-card__edit-save:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Comment delete X (moderator) */
.lf-comment__mod-x {
  background: transparent;
  color: rgba(248, 113, 113, 0.65);
  border: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  align-self: flex-start;
  margin-top: 2px;
}
.lf-comment__mod-x:hover {
  color: #fca5a5;
}

/* Reaction wrap so the small × can sit beside the chip */
.lf-emoji-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.lf-emoji-mod-x {
  background: rgba(15, 23, 42, 0.85);
  color: rgba(248, 113, 113, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  width: 16px;
  height: 16px;
  font-size: 11px;
  line-height: 1;
  margin-left: -6px;
  margin-top: -10px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}
.lf-emoji-mod-x:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}
