/* ==========================================================
   social.css — News-card layout with link-card gradients
   Layout: header (avatar+name | platform) → body → footer (stats | time+actions)
   ========================================================== */

/* ---- Tokens ---- */
:root {
  --social-avatar-size: 36px;
  --social-header-gap: 0.6rem;
  --social-card-radius: 18px;
  --social-card-pad: 0.85rem;
  --social-card-base-dark: color-mix(in srgb, var(--panel-bg) 22%, #000 78%);
  --social-card-base-light: color-mix(in srgb, #fff 86%, var(--panel-bg) 14%);
  --social-surface: var(--topbar-bg);
  --social-surface-border: var(--panel-border);
}

/* ==========================================================
   Feed container
   ========================================================== */
.social-feed {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  overflow: visible;
}

/* ==========================================================
   Card — gradient background (from links.css)
   ========================================================== */
.social-card {
  position: relative;
  z-index: 0;
  width: 100%;
  text-align: left;
  padding-top: calc(var(--social-card-pad) + 0.10rem);
  padding-right: var(--social-card-pad);
  padding-bottom: calc(var(--social-card-pad) + 0.14rem);
  padding-left: var(--social-card-pad);
  border-radius: var(--social-card-radius);
  overflow: hidden;
  isolation: isolate;
  will-change: transform, opacity;
  --story-solid: var(--color-accent-soft, #888);
  --story-fg: #fff;
  --card-base: var(--social-card-base-dark);

  background:
    radial-gradient(120% 120% at 50% 50%,
      color-mix(in srgb, var(--panel-bg) 10%, transparent) 0%, transparent 60%),
    radial-gradient(120% 140% at 0% 50%,
      color-mix(in srgb, var(--story-solid) 14%, transparent) 0%, transparent 58%),
    radial-gradient(120% 140% at 100% 50%,
      color-mix(in srgb, var(--story-solid) 12%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, #fff 4%, transparent) 0%, transparent 34%),
    linear-gradient(180deg,
      var(--card-base) 0%,
      color-mix(in srgb, var(--card-base) 92%, #000 8%) 55%,
      color-mix(in srgb, var(--card-base) 88%, #000 12%) 100%);
  color: var(--story-fg);
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 0 1px color-mix(in srgb, var(--story-solid) 10%, transparent),
    0 14px 40px rgba(0,0,0,0.30);
}

.social-card.is-menu-open { z-index: 20000; }

/* Story colour mapping */
.social-card[data-story-color="play"]           { --story-solid: var(--story-play); }
.social-card[data-story-color="breathe"]        { --story-solid: var(--story-breathe); }
.social-card[data-story-color="touching_grass"] { --story-solid: var(--story-touching_grass); }
.social-card[data-story-color="read"]           { --story-solid: var(--story-read); }
.social-card[data-story-color="news"]           { --story-solid: var(--story-news); }
.social-card[data-story-color="media"]          { --story-solid: var(--story-media); }
.social-card[data-story-color="art"]            { --story-solid: var(--story-art); }
.social-card[data-story-color="food"]           { --story-solid: var(--story-food); }
.social-card[data-story-color="uplifting"]      { --story-solid: var(--story-uplifting); }
.social-card[data-story-color="discover"]       { --story-solid: var(--story-discover); }
.social-card[data-story-color="uncover"]        { --story-solid: var(--story-uncover); }
.social-card[data-story-color="join_in"]        { --story-solid: var(--story-join_in); }
.social-card[data-story-color="stuff"]          { --story-solid: var(--story-stuff); }
.social-card[data-story-color="silly"]          { --story-solid: var(--story-silly); }
.social-card[data-story-color="music"]          { --story-solid: var(--story-music); }

/* Stronger tint on story-coloured cards */
.social-card[data-story-color] {
  background:
    radial-gradient(120% 120% at 50% 50%,
      color-mix(in srgb, var(--panel-bg) 10%, transparent) 0%, transparent 60%),
    radial-gradient(120% 140% at 0% 50%,
      color-mix(in srgb, var(--story-solid) 26%, transparent) 0%, transparent 58%),
    radial-gradient(120% 140% at 100% 50%,
      color-mix(in srgb, var(--story-solid) 22%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, #fff 6%, transparent) 0%, transparent 34%),
    linear-gradient(180deg,
      var(--card-base) 0%,
      color-mix(in srgb, var(--card-base) 92%, #000 8%) 55%,
      color-mix(in srgb, var(--card-base) 88%, #000 12%) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 1px color-mix(in srgb, var(--story-solid) 16%, transparent),
    0 18px 50px rgba(0,0,0,0.35);
}

/* ---- Light mode ---- */
body[data-mode="light"] .social-card {
  --story-fg: #14131a;
  --card-base: var(--social-card-base-light);
  background:
    radial-gradient(120% 120% at 50% 35%, rgba(255,255,255,0.70) 0%, transparent 62%),
    radial-gradient(120% 140% at 0% 50%,
      color-mix(in srgb, var(--story-solid) 12%, transparent) 0%, transparent 60%),
    radial-gradient(120% 140% at 100% 50%,
      color-mix(in srgb, var(--story-solid) 10%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.35) 22%, transparent 58%),
    linear-gradient(180deg,
      var(--card-base) 0%,
      color-mix(in srgb, var(--card-base) 92%, #fff 8%) 55%,
      color-mix(in srgb, var(--card-base) 88%, #fff 12%) 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--story-solid) 10%, rgba(0,0,0,0.08)),
    0 12px 32px rgba(0,0,0,0.08);
}

body[data-mode="light"] .social-card[data-story-color] {
  background:
    radial-gradient(120% 120% at 50% 35%, rgba(255,255,255,0.70) 0%, transparent 62%),
    radial-gradient(120% 140% at 0% 50%,
      color-mix(in srgb, var(--story-solid) 20%, transparent) 0%, transparent 60%),
    radial-gradient(120% 140% at 100% 50%,
      color-mix(in srgb, var(--story-solid) 16%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.35) 22%, transparent 58%),
    linear-gradient(180deg,
      var(--card-base) 0%,
      color-mix(in srgb, var(--card-base) 92%, #fff 8%) 55%,
      color-mix(in srgb, var(--card-base) 88%, #fff 12%) 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--story-solid) 16%, rgba(0,0,0,0.10)),
    0 16px 40px rgba(0,0,0,0.10);
}

body[data-mode="light"] .social-card[data-story-color]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
  clip-path: inset(0 round inherit);
  background:
    radial-gradient(120% 90% at 15% 20%,
      color-mix(in oklab, var(--story-solid) 35%, transparent) 0%, transparent 60%),
    linear-gradient(135deg,
      color-mix(in oklab, var(--story-solid) 22%, transparent) 0%, transparent 55%);
  opacity: 0.55;
}

body[data-mode="light"] .social-card .social-card-header,
body[data-mode="light"] .social-card .social-body,
body[data-mode="light"] .social-card .social-footer {
  position: relative;
  z-index: 1;
}

/* ==========================================================
   Grouped cards — same author in sequence
   ========================================================== */
.social-card--has-next {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: var(--social-card-pad);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 1px 0 0 rgba(255,255,255,0.05),
    inset -1px 0 0 rgba(255,255,255,0.05),
    0 0 0 1px color-mix(in srgb, var(--story-solid) 10%, transparent),
    0 14px 40px rgba(0,0,0,0.30);
}

.social-card--continuation {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: calc(-0.90rem) !important;
  padding-top: var(--social-card-pad);
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,0.05),
    inset -1px 0 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(255,255,255,0.05),
    0 0 0 1px color-mix(in srgb, var(--story-solid) 10%, transparent),
    0 14px 40px rgba(0,0,0,0.30);
}

/* Divider line */
.social-card--continuation::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.10);
  pointer-events: none;
  z-index: 2;
}
body[data-mode="light"] .social-card--continuation::after {
  background: rgba(0,0,0,0.08);
}

body[data-mode="light"] .social-card--has-next {
  box-shadow:
    inset 1px 0 0 rgba(0,0,0,0.08),
    inset -1px 0 0 rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.65),
    0 0 0 1px color-mix(in srgb, var(--story-solid) 10%, rgba(0,0,0,0.08)),
    0 12px 32px rgba(0,0,0,0.08);
}

body[data-mode="light"] .social-card--continuation {
  box-shadow:
    inset 1px 0 0 rgba(0,0,0,0.08),
    inset -1px 0 0 rgba(0,0,0,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.08),
    0 0 0 1px color-mix(in srgb, var(--story-solid) 10%, rgba(0,0,0,0.08)),
    0 12px 32px rgba(0,0,0,0.08);
}

/* Hide header on continuations entirely — footer has the actions */
.social-card--continuation .social-card-header {
  display: none;
}

.social-card--continuation .social-body { margin-top: 0; }
.social-card--continuation .social-text { margin-top: 0; }

.social-card--continuation.social-card--has-next {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.social-card--continuation:not(.social-card--has-next) {
  border-bottom-left-radius: var(--social-card-radius);
  border-bottom-right-radius: var(--social-card-radius);
}

/* ==========================================================
   Card header — avatar + author left, platform badge right
   (matches news social card layout)
   ========================================================== */
.social-card-header {
  display: flex;
  align-items: center;
  gap: var(--social-header-gap);
  margin-bottom: 0.45rem;
}

.social-avatar {
  width: var(--social-avatar-size);
  height: var(--social-avatar-size);
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
}
body[data-mode="light"] .social-avatar {
  border-color: rgba(0,0,0,0.10);
}

.social-avatar-placeholder {
  width: var(--social-avatar-size);
  height: var(--social-avatar-size);
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-size: 1rem;
}
body[data-mode="light"] .social-avatar-placeholder {
  border-color: rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.04);
}

.social-author {
  flex: 1 1 auto;
  min-width: 0;
}

.social-author-name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.social-handle-label {
  font-size: 0.76rem;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Verified badge (inline with name) */
.social-verified-badge {
  font-size: 0.72rem;
  opacity: 0.85;
  color: #3b82f6;
  line-height: 1;
}

.social-platform-badge {
  flex: 0 0 auto;
  font-size: 1.1rem;
  opacity: 0.6;
  color: inherit;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-bsky-badge,
.social-masto-badge,
.social-threads-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  border-radius: 0;
  line-height: 1;
  background: transparent !important;
  color: inherit;
}

body[data-mode="light"] .social-bsky-badge,
body[data-mode="light"] .social-masto-badge,
body[data-mode="light"] .social-threads-badge {
  background: transparent !important;
  color: inherit;
}

.social-bsky-badge i,
.social-masto-badge i,
.social-threads-badge i {
  font-size: 1em;
  line-height: 1;
  text-shadow: none;
  font-weight: inherit;
  position: static;
  top: auto;
}

/* ==========================================================
   Post body — full width (no avatar indent)
   ========================================================== */
.social-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-sizing: border-box;
  padding-bottom: 0.2rem;
}

.social-text {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  /* Clamp to ~8 lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
  position: relative;
}

.social-text a,
.social-quote-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255,255,255,0.35);
  transition: text-decoration-color 140ms ease;
}
body[data-mode="light"] .social-text a,
body[data-mode="light"] .social-quote-text a {
  text-decoration-color: rgba(0,0,0,0.25);
}
.social-text a:hover,
.social-quote-text a:hover {
  text-decoration-color: currentColor;
}

/* Main post text stays clamped by default */
.social-text{

}

/* Expanded state removes the clamp */
.social-card--expanded .social-text{
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  max-height: none !important;
}

/* Toggle link */
.social-text-toggle{
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin-top: .2rem;
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .9;
}

.social-text-toggle:hover,
.social-text-toggle:focus-visible{
  opacity: 1;
}

/* ==========================================================
   Footer — stats left, time + actions right
   (matches news social card .social-card-footer)
   ========================================================== */
.social-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.28rem;
  margin-top: 0.72rem;
  border-top: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.social-footer::before,
.social-footer::after {
  content: none !important;
  display: none !important;
}

body[data-mode="light"] .social-footer {
  border-top: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Stats (likes, reposts) — left side */
.social-footer-stats {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  opacity: 0.75;
}

.social-footer-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.social-footer-stat .fa-heart { color: #e25555; font-size: 0.72rem; }
.social-footer-stat .fa-retweet { color: #4caf50; font-size: 0.72rem; }

/* Actions (time + buttons) — right side */
.social-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.social-footer-time {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-right: 0.15rem;
}

/* Action buttons (share, mod) */
.social-mod,
.social-share {
  position: relative;
}

.social-action-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
  color: inherit;
  cursor: pointer;
  font-size: 0.72rem;
  transition: background 120ms ease;
}
body[data-mode="light"] .social-action-btn {
  border-color: rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.04);
}

.social-action-btn i {
  display: inline-block;
  width: 1em;
  line-height: 1;
  text-align: center;
}

.social-action-btn:hover,
.social-action-btn:focus-visible {
  background: rgba(255,255,255,0.12);
  outline: none;
}
body[data-mode="light"] .social-action-btn:hover,
body[data-mode="light"] .social-action-btn:focus-visible {
  background: rgba(0,0,0,0.08);
}

/* Dropdown menus (share + mod) */
.social-share-menu,
.social-mod-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 240px;
  padding: 0.35rem;
  border-radius: 16px;
  z-index: 20010;
  background: rgba(18,18,22,0.38);
  backdrop-filter: blur(26px) saturate(1.35);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 20px 60px rgba(0,0,0,0.45);
}
body[data-mode="light"] .social-share-menu,
body[data-mode="light"] .social-mod-menu {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 20px 55px rgba(0,0,0,0.12);
}

.social-share-menu.hidden,
.social-mod-menu.hidden { display: none !important; }

.social-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-family: var(--font-header, inherit);
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}
.social-menu-item i { width: 18px; text-align: center; opacity: 0.85; }
.social-menu-item:hover,
.social-menu-item:focus-visible { background: rgba(255,255,255,0.08); outline: none; }
body[data-mode="light"] .social-menu-item:hover,
body[data-mode="light"] .social-menu-item:focus-visible { background: rgba(0,0,0,0.06); }
.social-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================
   Story tags — pill style
   ========================================================== */
.social-story-tag {
  --pill-accent: var(--color-accent-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: baseline;
  padding: 0.28rem 0.68rem;
  margin-right: 0.5rem;
  margin-bottom: 0.15rem;
  font-size: 0.80rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.1;
  border-radius: 999px;
  position: relative;
  top: -1px;
}
.social-story-tag i { font-size: 0.78em; line-height: 1; opacity: 0.9; }

.social-story-tag[data-color="grey"]   { --pill-accent: #888; }
.social-story-tag[data-color="purple"] { --pill-accent: var(--pill-media, #c6a2ff); }
.social-story-tag[data-color="orange"] { --pill-accent: var(--pill-food, #f0a85a); }
.social-story-tag[data-color="blue"]   { --pill-accent: var(--pill-news, #86a8ff); }
.social-story-tag[data-color="teal"]   { --pill-accent: var(--pill-join_in, #9fe3e3); }
.social-story-tag[data-color="red"]    { --pill-accent: var(--pill-uplifting, #f6a6b8); }
.social-story-tag[data-color="pink"]   { --pill-accent: var(--pill-music, #e879a8); }
.social-story-tag[data-color="green"]  { --pill-accent: var(--pill-touching_grass, #a8e06f); }
.social-story-tag[data-color="brown"]  { --pill-accent: var(--pill-stuff, #b7c0cc); }

.social-story-tag {
  background: color-mix(in srgb, var(--pill-accent) 28%, rgba(0,0,0,0.22));
  color: color-mix(in srgb, var(--pill-accent) 78%, #fff 22%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}
body[data-mode="light"] .social-story-tag {
  background: color-mix(in srgb, var(--pill-accent) 42%, #fff 58%);
  color: color-mix(in oklab, var(--pill-accent) 55%, #111 45%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pill-accent) 35%, transparent);
}
body[data-mode="dark"] .social-story-tag {
  background: color-mix(in srgb, var(--pill-accent) 28%, #0c0f13 72%);
  color: color-mix(in srgb, var(--pill-accent) 100%, #ffffff 18%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pill-accent) 28%, transparent);
}

/* ==========================================================
   Media (images, video, carousel)
   ========================================================== */
.social-media {
  border-radius: 12px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.15);
  margin-top: 0.15rem;
}
body[data-mode="light"] .social-media {
  border-color: rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.04);
}

.social-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  cursor: pointer;
}

.social-video-el {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Carousel */
.social-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}
.social-carousel-btn:hover,
.social-carousel-btn:focus-visible { background: rgba(0,0,0,0.72); outline: none; }
.social-carousel-prev { left: 10px; }
.social-carousel-next { right: 10px; }

.social-carousel-indicator {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: #fff;
}

/* ==========================================================
   Quotes (embedded quote posts)
   ========================================================== */
.social-quote {
  position: relative;
  border-radius: 12px;
  margin: 0.3rem 0 0;
  padding: 0.7rem 0.8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
body[data-mode="light"] .social-quote {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}

.social-quote-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
  min-width: 0;
}
.social-quote-avatar {
  width: 28px;
  height: 28px;
  object-fit: cover;
  flex: 0 0 auto;
  border-radius: 999px;
}
.social-quote-author { min-width: 0; }
.social-quote-author-name {
  font-weight: 650;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.social-quote-author-meta {
  font-size: 0.82rem;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.social-quote-text {
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0.88;
}
.social-quote .social-media {
  margin-top: 0.5rem;
  width: 100%;
  max-width: 100%;
}

/* ==========================================================
   Reply context + quote snippet
   ========================================================== */
.social-reply-context {
  position: relative;
  border-radius: 12px;
  margin: 0.2rem 0 0.4rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}
body[data-mode="light"] .social-reply-context {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}

.social-context-jump {
  width: 100%;
  border: 0;
  padding: 0.6rem 0.8rem;
  background: transparent;
  color: inherit;
  text-align: left;
  display: block;
  cursor: pointer;
  transition: background 120ms ease;
}
.social-context-jump:hover,
.social-context-jump:focus-visible { background: rgba(255,255,255,0.05); outline: none; }
body[data-mode="light"] .social-context-jump:hover,
body[data-mode="light"] .social-context-jump:focus-visible { background: rgba(0,0,0,0.03); }

.social-context-label {
  font-size: 0.78rem;
  opacity: 0.6;
  letter-spacing: 0.02em;
  margin-top: 0.25rem;
  text-transform: uppercase;
}
.social-context-text {
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.social-reply-snippet {
  width: 100%;
  display: grid;
  gap: 0.2rem;
  text-align: left;
  margin: 0.2rem 0 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: background 120ms ease;
  color: inherit;
}
body[data-mode="light"] .social-reply-snippet {
  border-color: rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
}
.social-reply-snippet:hover,
.social-reply-snippet:focus-visible { background: rgba(255,255,255,0.07); outline: none; }
body[data-mode="light"] .social-reply-snippet:hover,
body[data-mode="light"] .social-reply-snippet:focus-visible { background: rgba(0,0,0,0.04); }

.social-reply-label {
  font-size: 0.78rem;
  opacity: 0.6;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.social-reply-text {
  font-size: 0.92rem;
  line-height: 1.35;
  opacity: 0.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ==========================================================
   Repost note
   ========================================================== */
.social-repost-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  opacity: 0.6;
  margin-bottom: 0.4rem;
}
.social-repost-icon { font-size: 0.78rem; }
.social-repost-name { font-weight: 650; }

/* ==========================================================
   Tooltips
   ========================================================== */
.social-tip { position: relative; }

.social-tip[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.80rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(18,18,22,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 20px rgba(0,0,0,0.30);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 4000;
  transition: opacity 140ms ease;
}
body[data-mode="light"] .social-tip[data-tooltip]::after {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.10);
  color: #14131a;
}

.social-tip[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(18,18,22,0.92);
  border-left: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.12);
  opacity: 0;
  pointer-events: none;
  z-index: 3999;
  transition: opacity 140ms ease;
}
body[data-mode="light"] .social-tip[data-tooltip]::before {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.10);
}

.social-tip[data-tooltip]:hover::after,
.social-tip[data-tooltip]:hover::before,
.social-tip[data-tooltip]:focus-visible::after,
.social-tip[data-tooltip]:focus-visible::before { opacity: 1; }

/* ==========================================================
   Animations
   ========================================================== */
.social-card.is-entering { opacity: 0; transform: translateY(8px); }
.social-card.is-entered {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 260ms ease;
}
.social-card.is-moving { transition: transform 260ms ease; }

.social-card-highlight {
  outline: 2px solid rgba(255,255,255,0.18);
  outline-offset: 4px;
  animation: socialPulse 1.4s ease-out;
}
body[data-mode="light"] .social-card-highlight { outline-color: rgba(0,0,0,0.12); }

@keyframes socialPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.15); }
  30%  { box-shadow: 0 0 0 6px rgba(255,255,255,0.08); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ==========================================================
   Latest pill
   ========================================================== */
.social-latest-pill {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(18,18,22,0.90);
  backdrop-filter: blur(16px);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.40);
  font-weight: 700;
  font-size: 0.88rem;
  transition: transform 120ms ease;
}
.social-latest-pill:hover { transform: translateY(-2px); }
body[data-mode="light"] .social-latest-pill {
  background: rgba(255,255,255,0.88);
  border-color: rgba(0,0,0,0.10);
  color: #14131a;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* ==========================================================
   Lightbox
   ========================================================== */
.social-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0,0,0,0.80);
  backdrop-filter: blur(4px);
  z-index: 9999;
  cursor: pointer;
}
.social-lightbox.is-open { display: flex; }
.social-lightbox-inner { max-width: 96vw; max-height: 96vh; }
.social-lightbox-img {
  display: block;
  max-width: 96vw;
  max-height: 96vh;
  border-radius: 8px;
}
body.no-scroll { overflow: hidden; }

/* ==========================================================
   Content Warning
   ========================================================== */
.social-cw-box {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 1.2rem;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
}
body[data-mode="light"] .social-cw-box {
  border-color: rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
}

.social-cw-icon { font-size: 1.1rem; opacity: 0.7; }
.social-cw-label { line-height: 1.35; opacity: 0.88; }
.social-cw-label strong { font-weight: 900; }
.social-cw-show { margin-top: 2px; }

.social-card.has-cw .social-body { display: none; }
.social-card.has-cw .social-footer { display: none; }
.social-card.has-cw.is-cw-revealed .social-body { display: flex; }
.social-card.has-cw.is-cw-revealed .social-footer { display: flex; }
.social-card.has-cw.is-cw-revealed .social-cw-box { display: none; }

/* ==========================================================
   Buttons
   ========================================================== */
.social-btn {
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-header, inherit);
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease;
}
body[data-mode="light"] .social-btn {
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
}
.social-btn:hover,
.social-btn:focus-visible { background: rgba(255,255,255,0.10); outline: none; }
body[data-mode="light"] .social-btn:hover,
body[data-mode="light"] .social-btn:focus-visible { background: rgba(0,0,0,0.07); }
.social-btn.primary {
  border-color: color-mix(in srgb, var(--color-accent-soft, #666) 40%, rgba(255,255,255,0.15));
  background: color-mix(in srgb, var(--color-accent-soft, #666) 18%, rgba(0,0,0,0.2));
}

/* ==========================================================
   Admin: Edit user label
   ========================================================== */
.social-handle-input {
  width: min(320px, 100%);
  max-width: 100%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
  color: inherit;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: inherit;
}
body[data-mode="light"] .social-handle-input {
  border-color: rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.5);
}
.social-handle-input:focus {
  border-color: color-mix(in srgb, var(--color-accent-soft, #666) 50%, rgba(255,255,255,0.20));
}

/* ==========================================================
   CW Modal
   ========================================================== */
.social-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
}
.social-modal-backdrop.is-open { display: flex; }

.social-modal {
  width: min(760px, 96vw);
  border: 1px solid var(--panel-border, rgba(255,255,255,0.12));
  background: var(--panel-bg, #1a1a1e);
  border-radius: var(--radius-panel, 18px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}
.social-modal-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
body[data-mode="light"] .social-modal-header { border-bottom-color: rgba(0,0,0,0.08); }
.social-modal-title {
  font-family: var(--font-header, inherit);
  font-weight: 900;
  font-size: 1.05rem;
  margin: 0;
}
.social-modal-subtitle { margin: 8px 0 0; opacity: 0.75; }
.social-modal-body { padding: 14px 16px 16px; }
.social-cw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.social-cw-list {
  border: 1px solid var(--panel-border, rgba(255,255,255,0.12));
  border-radius: 10px;
  overflow: hidden;
}
.social-cw-list button {
  width: 100%;
  text-align: left;
  border: 0;
  padding: 10px 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 100ms ease;
}
body[data-mode="light"] .social-cw-list button { border-bottom-color: rgba(0,0,0,0.06); }
.social-cw-list button:last-child { border-bottom: 0; }
.social-cw-list button:hover,
.social-cw-list button:focus-visible { background: rgba(255,255,255,0.06); outline: none; }
body[data-mode="light"] .social-cw-list button:hover,
body[data-mode="light"] .social-cw-list button:focus-visible { background: rgba(0,0,0,0.04); }
.social-cw-list button.is-selected { background: rgba(255,255,255,0.10); font-weight: 800; }
body[data-mode="light"] .social-cw-list button.is-selected { background: rgba(0,0,0,0.07); }
.social-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
body[data-mode="light"] .social-modal-footer { border-top-color: rgba(0,0,0,0.08); }

/* ==========================================================
   Link preview cards (OG unfurl)
   ========================================================== */
.social-link-preview {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  margin-top: 0.2rem;
  text-decoration: none;
  color: inherit;
  transition: background 140ms ease, border-color 140ms ease;
}
body[data-mode="light"] .social-link-preview {
  border-color: rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.02);
}
.social-link-preview:hover,
.social-link-preview:focus-visible {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.16);
  outline: none;
}
body[data-mode="light"] .social-link-preview:hover,
body[data-mode="light"] .social-link-preview:focus-visible {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.16);
}
.social-link-preview-thumb {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  overflow: hidden;
  background: rgba(0,0,0,0.10);
}
body[data-mode="light"] .social-link-preview-thumb { background: rgba(0,0,0,0.04); }
.social-link-preview-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.social-link-preview:hover .social-link-preview-thumb img { filter: brightness(1.06); }
.social-link-preview-body {
  padding: 0.6rem 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.social-link-preview-title {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.social-link-preview-desc {
  font-size: 0.84rem;
  line-height: 1.35;
  opacity: 0.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.social-link-preview-domain {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.55;
  margin-top: 0.15rem;
}
.social-link-preview-domain i { font-size: 0.72rem; }

.social-external-card{
  display: flex;
  gap: .7rem;
  margin-top: .55rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, var(--panel-bg) 82%, transparent);
}

.social-external-card:hover,
.social-external-card:focus-visible{
  background: var(--hover-bg);
}

.social-external-card-thumb{
  width: 96px;
  min-width: 96px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.social-external-card-body{
  min-width: 0;
  padding: .6rem .7rem .6rem 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.social-external-card-title{
  font-weight: 700;
  line-height: 1.25;
}

.social-external-card-desc{
  font-size: .85rem;
  opacity: .82;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.social-external-card-url{
  font-size: .78rem;
  opacity: .65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   Time dividers
   ========================================================== */
.social-time-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.02em;
  border-radius: 999px;
  opacity: 0.65;
  background: rgba(255,255,255,0.06);
}
body[data-mode="light"] .social-time-badge { background: rgba(0,0,0,0.05); }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 520px) {
  .social-feed { gap: 0.55rem; }
  .social-card {
    --social-card-pad: 0.7rem;
    border-radius: 14px;
  }
  .social-card--continuation { margin-top: calc(-0.68rem) !important; }
  .social-card--continuation:not(.social-card--has-next) {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
  }
  .social-cw-grid { grid-template-columns: 1fr; }
}

/* Legacy compat: hide old elements that may still be in DOM */
.social-rail,
.social-rail-left,
.social-header-actions,
.social-author-meta {
  /* These are replaced by the new layout; hide if still rendered */
}

/* ==========================================================
   Public alpha splash
   ========================================================== */
.social-splash {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.social-splash.is-open {
  display: flex;
}

.social-splash__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.social-splash__panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  border-radius: 22px;
  padding: 1.25rem 1.25rem 1rem;
  color: var(--text-color, #fff);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--panel-bg, #18181c) 92%, #fff 8%) 0%,
      color-mix(in srgb, var(--panel-bg, #18181c) 98%, #000 2%) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

body[data-mode="light"] .social-splash__panel {
  color: #15141a;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, #fff 94%, var(--panel-bg, #f5f5f7) 6%) 0%,
      color-mix(in srgb, #fff 88%, var(--panel-bg, #f5f5f7) 12%) 100%);
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 24px 80px rgba(0,0,0,0.16);
}

.social-splash__eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.55rem;
}

.social-splash__title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
  font-weight: 900;
}

.social-splash__body {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.social-splash__body p {
  margin: 0;
  line-height: 1.55;
  opacity: 0.92;
}

.social-splash__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .social-splash__panel {
    padding: 1rem 1rem 0.9rem;
    border-radius: 18px;
  }

  .social-splash__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .social-splash__actions .social-btn {
    width: 100%;
  }
}
