/* css/social.css — v2 Profile · Notifications · Messages · Social sheets (owner: social worker) */

/* ---------- Shared helpers ---------- */
.sx-av {
  border-radius: 9999px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: var(--content);
}
.sx-namerow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  font-family: var(--ds-font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--foreground);
}
.sx-muted { font-size: 13px; color: var(--muted-foreground); }
.sx-dot-sep { width: 3px; height: 3px; border-radius: 9999px; background: currentColor; opacity: .5; flex-shrink: 0; }
.sx-i12, .sx-i14, .sx-i15, .sx-i16, .sx-i18, .sx-i20 {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sx-i12 svg { width: 12px; height: 12px; }
.sx-i14 svg { width: 14px; height: 14px; }
.sx-i15 svg { width: 15px; height: 15px; }
.sx-i16 svg { width: 16px; height: 16px; }
.sx-i18 svg { width: 18px; height: 18px; }
.sx-i20 svg { width: 20px; height: 20px; }

/* =====================================================================
   PROFILE PAGE
   ===================================================================== */
.sx-profile { min-height: 100%; font-size: 15px; }

.sx-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
  min-height: 132px;
  max-height: 220px;
  overflow: hidden;
  background: var(--content);
  cursor: pointer;
  user-select: none;
}
.sx-cover.is-empty {
  cursor: default;
  background:
    radial-gradient(90% 130% at 88% 10%, color-mix(in srgb, #8b5cf6 32%, transparent), transparent 60%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--primary) 26%, var(--content)) 0%,
      color-mix(in srgb, #6366f1 18%, var(--card)) 52%,
      color-mix(in srgb, #ff5c8a 20%, var(--content)) 100%);
}
.sx-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 140ms ease;
}
.sx-cover:not(.is-empty)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .14) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .28) 100%);
  pointer-events: none;
}
.sx-cover-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: rgba(10, 14, 24, .58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background-color 150ms ease;
}
.sx-cover-btn:hover { background: rgba(10, 14, 24, .78); }
.sx-cover-btn:active { transform: scale(.92); }
.sx-cover-btn svg { width: 17px; height: 17px; }
.sx-cover-editbar {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(10, 14, 24, .78);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.sx-id { padding: 0 16px 14px; }
.sx-id-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: -44px;
  position: relative;
  z-index: 4;
}
.sx-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 9999px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: 0 8px 24px rgba(10, 14, 24, .22);
  flex-shrink: 0;
  cursor: pointer;
  overflow: visible;
  transition: transform 140ms var(--ds-ease);
}
.sx-avatar:active { transform: scale(.97); }
.sx-avatar-cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 6;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: var(--background);
  color: var(--foreground);
  border: 2px solid var(--background);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .24), 0 0 0 1px var(--card-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms var(--ds-ease), background-color 140ms ease;
}
.sx-avatar-cam:hover { background: var(--content); transform: scale(1.06); }
.sx-avatar-cam svg { width: 14px; height: 14px; }

.sx-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  min-width: 0;
}
.sx-name {
  font-family: var(--ds-font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sx-handle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}
.sx-bio {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.48;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
.sx-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.sx-meta-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.sx-meta-link { color: var(--link); font-weight: 600; }
.sx-meta-link:hover { text-decoration: underline; }
.sx-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sx-link-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 9999px;
  border: 1px solid var(--card-border); background: var(--card);
  font-size: 12.5px; font-weight: 600; color: var(--foreground);
  transition: background-color 140ms ease, border-color 140ms ease;
}
.sx-link-chip:hover { background: var(--ds-hover); border-color: var(--primary); }

.sx-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 12px;
}
.sx-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  color: var(--muted-foreground);
  padding: 2px 0;
  cursor: pointer;
}
.sx-stat b {
  font-family: var(--ds-font-display);
  font-weight: 800;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.sx-stat:hover span, .sx-stat:hover b { text-decoration: underline; text-underline-offset: 3px; }

.sx-mutual {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  text-align: left;
  font-size: 13px;
  color: var(--muted-foreground);
}
.sx-mutual:hover { color: var(--foreground); }
.sx-mutual b { color: var(--foreground); font-weight: 700; }
.sx-stack { display: inline-flex; align-items: center; flex-shrink: 0; }
.sx-stack > img + img { margin-left: -6px; }
.sx-stack > img { box-shadow: 0 0 0 1.5px var(--background); }

.sx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.sx-actions .ds-btn { min-width: 0; padding: 0 14px; }
.sx-ib { border: 1px solid var(--card-border); background: var(--background); }
.sx-ib:hover { background: var(--ds-hover); }

.sx-subnote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
}
.sx-owner-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
}
.sx-edit-plans-link {
  padding: 4px 2px;
}

/* ---------- Subscribed status card on creator profile ---------- */
.sx-subcard {
  margin-top: 14px;
  padding: 14px 15px;
  border-radius: var(--ds-radius-l);
  border: 1px solid var(--card-border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sx-subcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sx-subcard-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}
.sx-subcard-left {
  font-family: var(--ds-font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sx-subcard-left.is-warn { color: var(--warning); }
.sx-subcard-bar {
  height: 6px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--foreground) 10%, var(--background));
  overflow: hidden;
}
.sx-subcard-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 240ms var(--ds-ease);
}
.sx-subcard-bar > span.is-warn { background: var(--warning); }
.sx-subcard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sx-subcard-date {
  font-size: 12.5px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.sx-subcard-renew {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--foreground);
}
.sx-subcard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

/* ---------- Radio station console on profile ---------- */
.sx-radio-wrap { padding: 2px 16px 16px; }
.sx-radio {
  position: relative;
  overflow: hidden;
  border-radius: var(--ds-radius-l);
  padding: 16px;
  color: #fff;
  background:
    radial-gradient(120% 130% at 100% 0%, color-mix(in srgb, var(--primary) 40%, transparent) 0%, transparent 62%),
    linear-gradient(145deg, #121524 0%, #191e34 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: box-shadow 260ms var(--ds-ease), border-color 260ms ease;
}
.sx-radio[data-playing="true"] {
  background:
    radial-gradient(130% 120% at 95% 5%, rgba(255, 92, 138, .35) 0%, transparent 55%),
    var(--ds-grad);
  border-color: rgba(255, 255, 255, .22);
  box-shadow: 0 18px 42px -20px color-mix(in srgb, var(--primary) 75%, transparent);
}
.sx-radio-main { display: flex; align-items: center; gap: 13px; }
.sx-radio-play {
  width: 48px; height: 48px; border-radius: 9999px; flex-shrink: 0;
  background: #fff; color: #0f1419;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  transition: transform 140ms var(--ds-ease);
}
.sx-radio-play:hover { transform: scale(1.05); }
.sx-radio-play:active { transform: scale(.93); }
.sx-radio-play svg { width: 20px; height: 20px; }
.sx-radio-main .ds-live { color: #fff; background: rgba(255, 255, 255, .14); padding: 3px 9px; border-radius: 9999px; font-size: 10.5px; white-space: nowrap; flex-shrink: 0; }
.sx-radio-main .ds-live-dot { background: var(--ds-live); }
.sx-radio-freq { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .74); }
.sx-radio-now {
  font-family: var(--ds-font-display);
  font-size: 16px; font-weight: 800; line-height: 1.25; margin-top: 5px;
  color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sx-radio-meta {
  display: flex; align-items: center; gap: 7px; margin-top: 4px;
  font-size: 12.5px; color: rgba(255, 255, 255, .76);
}
.sx-eq {
  display: flex; align-items: flex-end; gap: 2.5px; height: 22px; flex-shrink: 0;
}
.sx-eq span {
  width: 3px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .45);
  transition: height 180ms ease;
}
.sx-radio[data-playing="true"] .sx-eq span {
  background: #fff;
  animation: sxEq var(--d, .7s) ease-in-out var(--dl, 0s) infinite alternate;
}
@keyframes sxEq {
  0% { height: 5px; opacity: .7; }
  100% { height: 22px; opacity: 1; }
}
.sx-radio-ctrl {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.sx-radio-mute {
  width: 30px; height: 30px; border-radius: 9999px;
  background: rgba(255, 255, 255, .14); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sx-radio-mute:hover { background: rgba(255, 255, 255, .24); }
.sx-radio-mute svg { width: 15px; height: 15px; }
.sx-radio-vol { width: 112px; max-width: 36%; accent-color: #fff; cursor: pointer; }
.sx-radio-state { margin-left: auto; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .75); white-space: nowrap; }
.sx-radio[data-playing="false"] .sx-when-on,
.sx-radio:not([data-playing="true"]) .sx-when-on { display: none; }
.sx-radio[data-playing="true"] .sx-when-idle { display: none; }

.sx-radio-sched {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14);
}
.sx-radio-sched-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
}
.sx-radio-sched-h {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72); display: inline-flex; align-items: center; gap: 6px;
}
.sx-radio-sched-acts {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.sx-radio-sched-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border-radius: 9999px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer;
  transition: background-color 140ms ease, transform 120ms ease;
}
.sx-radio-sched-btn:hover { background: rgba(255, 255, 255, .26); }
.sx-radio-sched-btn:active { transform: scale(.95); }
.sx-radio-sched-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.sx-radio-cur {
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
  margin-bottom: 10px;
}
.sx-radio-cur-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .86);
}
.sx-radio-cur-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 9999px;
  background: rgba(239, 68, 68, .28); border: 1px solid rgba(255, 255, 255, .26);
  color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.sx-radio-cur-dot {
  width: 6px; height: 6px; border-radius: 9999px; background: #ff5c7c;
  box-shadow: 0 0 0 3px rgba(255, 92, 124, .32);
}
.sx-radio-cur-show {
  font-family: var(--ds-font-display); font-size: 14px; font-weight: 800;
  color: #fff; margin-top: 5px; line-height: 1.25;
}
.sx-radio-cur-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 3px; font-size: 11.5px; color: rgba(255, 255, 255, .76);
}
.sx-radio-prog {
  height: 4px; width: 100%; border-radius: 9999px;
  background: rgba(255, 255, 255, .18); overflow: hidden; margin-top: 8px;
}
.sx-radio-prog > span {
  display: block; height: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, .75));
  transition: width 400ms ease;
}
.sx-radio-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.sx-radio-slot {
  display: flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0;
  padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, .05);
  border: 1px solid transparent;
}
.sx-radio-slot.is-current {
  background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28);
}
.sx-radio-slot-t { font-family: ui-monospace, SFMono-Regular, monospace; font-weight: 700; color: rgba(255, 255, 255, .68); flex-shrink: 0; font-size: 11.5px; }
.sx-radio-slot.is-current .sx-radio-slot-t { color: #fff; }
.sx-radio-slot-n { color: rgba(255, 255, 255, .92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.sx-radio-slot.is-current .sx-radio-slot-n { font-weight: 700; color: #fff; }
.sx-radio-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 1.5px 6px; border-radius: 9999px; flex-shrink: 0;
}
.sx-radio-tag.is-now { background: #ef4444; color: #fff; }
.sx-radio-tag.is-next { background: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .92); }
@media (max-width: 440px) { .sx-radio-slots { grid-template-columns: 1fr; } }

/* ---------- Radio Schedule Full Modal ---------- */
.sx-rs-hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 16px;
  color: #fff; background: linear-gradient(145deg, var(--st-a, #f43f5e), var(--st-b, #8b5cf6));
  box-shadow: 0 14px 32px -18px color-mix(in srgb, var(--st-a, #f43f5e) 70%, transparent);
}
.sx-rs-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sx-rs-hero-time {
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 9999px; background: rgba(0, 0, 0, .24);
}
.sx-rs-hero-show {
  font-family: var(--ds-font-display); font-size: 19px; font-weight: 800;
  line-height: 1.2; letter-spacing: -0.02em; margin-top: 10px;
}
.sx-rs-hero-host { font-size: 13px; color: rgba(255, 255, 255, .86); margin-top: 3px; }
.sx-rs-hero-next {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: rgba(255, 255, 255, .9);
}
.sx-rs-list { display: flex; flex-direction: column; gap: 8px; }
.sx-rs-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 13px;
  border-radius: 14px; border: 1px solid var(--card-border); background: var(--card);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.sx-rs-item.is-current {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--card-border));
  background: color-mix(in srgb, var(--primary) 8%, var(--background));
}
.sx-rs-time {
  min-width: 78px; flex-shrink: 0; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; font-weight: 700; color: var(--muted-foreground); line-height: 1.3;
}
.sx-rs-item.is-current .sx-rs-time { color: var(--primary); }
.sx-rs-info { flex: 1; min-width: 0; }
.sx-rs-title {
  font-family: var(--ds-font-display); font-size: 14.5px; font-weight: 700;
  color: var(--foreground); display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sx-rs-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.sx-rs-pill-now {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 9999px;
  background: color-mix(in srgb, var(--ds-live, #ef4444) 14%, transparent);
  color: var(--ds-live, #ef4444); font-size: 10.5px; font-weight: 800; text-transform: uppercase;
}
.sx-rs-pill-next {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 9999px;
  background: var(--content); color: var(--muted-foreground);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
}
.sx-rs-form {
  padding: 14px; border-radius: 16px; border: 1px solid var(--card-border); background: var(--card);
  display: flex; flex-direction: column; gap: 10px;
}

/* ---------- Profile tabs, media grid, replies, paywall ---------- */
.sx-tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ds-glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.sx-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding-top: 2px;
}
.sx-media-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--content);
  cursor: zoom-in;
}
.sx-media-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 280ms var(--ds-ease);
}
.sx-media-cell:hover img { transform: scale(1.04); }

.sx-reply {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 120ms ease;
}
.sx-reply:hover { background: var(--ds-hover); }
.sx-reply-head { display: flex; align-items: center; gap: 6px; font-size: 14.5px; min-width: 0; }
.sx-reply-to { font-size: 13px; margin-top: 2px; }
.sx-reply-text { font-size: 15px; line-height: 1.48; margin-top: 5px; color: var(--foreground); overflow-wrap: anywhere; }

.sx-gate {
  margin: 16px;
  padding: 24px 20px;
  border-radius: var(--ds-radius-l);
  border: 1px solid var(--card-border);
  background: var(--card);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sx-gate-ico {
  width: 48px; height: 48px; border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.sx-gate-ico svg { width: 22px; height: 22px; }
.sx-gate-title { font-family: var(--ds-font-display); font-size: 17px; font-weight: 800; color: var(--foreground); }
.sx-gate-text { font-size: 13.5px; color: var(--muted-foreground); max-width: 310px; line-height: 1.45; margin-bottom: 4px; }

/* ---------- Visitor locked paywall panel with 1/3/6/12 plan picker ---------- */
.sx-paywall {
  margin: 16px;
  padding: 22px 16px 18px;
  border-radius: var(--ds-radius-xl);
  border: 1px solid var(--card-border);
  background:
    radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 58%),
    var(--card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sx-pw-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.sx-pw-ico {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 14%, var(--background));
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--card-border));
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.sx-pw-ico svg { width: 22px; height: 22px; }
.sx-pw-title {
  font-family: var(--ds-font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--foreground);
  margin: 0;
}
.sx-pw-sub {
  font-size: 13.5px;
  color: var(--muted-foreground);
  line-height: 1.42;
  max-width: 340px;
  margin: 0;
}
.sx-pw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sx-pw-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--ds-radius-m);
  border: 1.5px solid var(--card-border);
  background: var(--background);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}
.sx-pw-card:hover { background: var(--ds-hover); }
.sx-pw-card:active { transform: scale(.98); }
.sx-pw-card.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--background));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent);
}
.sx-pw-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 20px;
}
.sx-pw-dur {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
}
.sx-pw-price {
  font-family: var(--ds-font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  line-height: 1.1;
}
.sx-pw-card-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}
.sx-pw-per {
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.sx-pw-save {
  color: var(--success);
  font-weight: 800;
  white-space: nowrap;
}
.sx-pw-renew {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--ds-radius-m);
  border: 1px solid var(--card-border);
  background: var(--background);
}
.sx-pw-renew-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
}
.sx-pw-renew-sub {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.35;
  margin-top: 2px;
}

/* =====================================================================
   FULL-SCREEN (MOBILE) / CENTERED DIALOG (DESKTOP) SHEETS
   (Edit Profile · Followers/Following)
   ===================================================================== */
@media (max-width: 767px) {
  .vp-sheet-wrap.sx-full-wrap {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  .vp-sheet.sx-full {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
}
body.mobile-sim .vp-sheet-wrap.sx-full-wrap {
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
body.mobile-sim .vp-sheet.sx-full {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
@media (min-width: 768px) {
  body:not(.mobile-sim) .vp-sheet.sx-full {
    width: 100% !important;
    max-width: 580px !important;
    height: min(85dvh, 720px) !important;
    max-height: min(85dvh, 720px) !important;
    border-radius: 24px !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
}
.sx-anim-up { animation: sxUp 240ms var(--ds-ease) !important; }
.sx-anim-push { animation: sxPush 220ms var(--ds-ease) !important; }
@keyframes sxUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes sxPush { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.sx-sheet-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sx-sheet-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--ds-glass);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}
.sx-sheet-tabs { border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* Followers / Following rows */
.sx-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.sx-person + .sx-person { border-top: 1px solid var(--border); }
.sx-person:hover { background: var(--ds-hover); }
.sx-person-name { font-size: 15px; }
.sx-person-bio {
  font-size: 13.5px;
  color: var(--foreground);
  opacity: .84;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Edit profile form */
.sx-ep-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
  min-height: 120px;
  max-height: 180px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 26%, var(--content)), color-mix(in srgb, #8b5cf6 22%, var(--card)));
  overflow: hidden;
}
.sx-ep-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-ep-camera {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: rgba(10, 14, 24, .65);
  backdrop-filter: blur(8px);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sx-ep-camera svg { width: 18px; height: 18px; }
.sx-ep-cover-clear {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgba(10, 14, 24, .65);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.sx-ep-av {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  margin-top: -42px;
  position: relative;
  z-index: 2;
}
.sx-ep-av-inner {
  position: relative;
  display: inline-block;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
}
.sx-ep-av-cam {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 9999px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sx-ep-av-cam svg { width: 22px; height: 22px; }
.sx-ep-presets { display: flex; align-items: center; gap: 7px; padding-bottom: 6px; }
.sx-ep-swatch {
  width: 24px; height: 24px; border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, .35);
  transition: transform 120ms ease;
}
.sx-ep-swatch:hover { transform: scale(1.12); }
.sx-ep-covers {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 14px 16px 2px;
}
.sx-ep-covers::-webkit-scrollbar { display: none; }
.sx-ep-cover-opt {
  width: 82px; height: 42px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  border: 2px solid transparent; transition: border-color 140ms ease;
}
.sx-ep-cover-opt.is-on { border-color: var(--primary); }
.sx-ep-cover-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sx-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sx-field { display: flex; flex-direction: column; gap: 6px; }
.sx-field-l {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 700; color: var(--muted-foreground);
}
.sx-field-c { font-variant-numeric: tabular-nums; font-weight: 600; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sx-more-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}
.sx-more-toggle:hover { background: var(--ds-hover); }
.sx-chev { display: inline-flex; transition: transform 180ms var(--ds-ease); }
.sx-chev.is-open { transform: rotate(90deg); }
.sx-addlink {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.sx-addlink .ds-input { padding: 8px 11px; font-size: 14px; }

/* =====================================================================
   NOTIFICATIONS PAGE
   ===================================================================== */
.sx-notifs { min-height: 100%; font-size: 15px; }
@media (max-width: 440px) {
  .sx-notifs .ds-tab { padding: 12px 9px; font-size: 13px; }
}
body.mobile-sim .sx-notifs .ds-tab { padding: 12px 9px; font-size: 13px; }
.sx-notif-day {
  padding: 16px 16px 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.sx-notif-day--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sx-notif-day + .sx-notif-list { border-top: 1px solid var(--border); }
.sx-notif-list { border-bottom: 1px solid var(--border); }
.sx-notif {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.sx-notif + .sx-notif { border-top: 1px solid var(--border); }
.sx-notif:hover { background: var(--ds-hover); }
.sx-notif:active { background: var(--ds-press); }
.sx-notif.is-unread {
  background: color-mix(in srgb, var(--primary) 6.5%, var(--background));
}
.sx-notif.is-unread:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--background));
}

.sx-notif-lead {
  position: relative;
  width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sx-notif-type {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--background);
}
.sx-notif-type svg { width: 10px; height: 10px; }
.sx-notif-type.is-like { background: #ff3b5c; }
.sx-notif-type.is-repost { background: #00ba7c; }
.sx-notif-type.is-reply { background: var(--primary); }
.sx-notif-type.is-follow { background: #6366f1; }
.sx-notif-type.is-vip { background: #f59e0b; }

.sx-notif-group-av {
  position: relative;
  width: 46px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sx-notif-stack {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sx-notif-stack img {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--background);
  background: var(--content);
}
.sx-notif-stack img + img { margin-left: -10px; }

.sx-notif-body { flex: 1; min-width: 0; }
.sx-notif-title { font-size: 14.5px; line-height: 1.38; color: var(--foreground); }
.sx-notif-title b { font-weight: 700; }
.sx-notif.is-unread .sx-notif-title { font-weight: 500; }
.sx-notif-snippet {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted-foreground);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sx-notif-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.sx-notif-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sx-notif-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.sx-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--primary);
  flex-shrink: 0;
}

/* =====================================================================
   MESSAGES — Desktop 2026 Messenger (72px Rail + 360px List + Flex Chat + 320px Details)
   & Mobile List -> Full-Screen Chat
   ===================================================================== */

/* Collapse left nav rail to 72px icon rail automatically on Desktop Messages */
@media (min-width: 768px) {
  body.route-messages:not(.mobile-sim) #desktopGrid {
    grid-template-columns: 72px minmax(0, 1fr) !important;
    max-width: 1440px !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 100dvh;
    overflow: hidden;
  }
  body.route-messages:not(.mobile-sim) #leftSidebar {
    display: flex !important;
    width: 72px !important;
    padding: 14px 6px 16px !important;
    align-items: center !important;
  }
  body.route-messages:not(.mobile-sim) .nav-rail-lbl,
  body.route-messages:not(.mobile-sim) .nav-rail-brand,
  body.route-messages:not(.mobile-sim) .nav-rail-profile-meta,
  body.route-messages:not(.mobile-sim) .nav-rail-compose-lbl,
  body.route-messages:not(.mobile-sim) .nav-rail-badge-inline {
    display: none !important;
  }
  body.route-messages:not(.mobile-sim) .sh-rail-logo {
    padding: 7px !important;
    margin: 0 auto 10px !important;
    justify-content: center !important;
  }
  body.route-messages:not(.mobile-sim) .sh-rail-item {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    justify-content: center !important;
    gap: 0 !important;
  }
  body.route-messages:not(.mobile-sim) .sh-rail-dot {
    display: flex !important;
  }
  body.route-messages:not(.mobile-sim) .sh-compose-btn {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin: 14px auto 0 !important;
    border-radius: 9999px !important;
  }
  body.route-messages:not(.mobile-sim) .nav-rail-compose-ico {
    display: inline-flex !important;
  }
  body.route-messages:not(.mobile-sim) .sh-rail-account {
    width: 48px !important;
    height: 48px !important;
    padding: 4px !important;
    margin: 0 auto !important;
    justify-content: center !important;
  }
  body.route-messages:not(.mobile-sim) #centerColumn {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
}

.sx-dm-shell {
  position: relative;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: var(--sx-dm-h, 100dvh);
  overflow: hidden;
  background: var(--background);
}
.sx-dm-shell.has-details {
  grid-template-columns: 360px minmax(0, 1fr) 320px;
}
@media (max-width: 1140px) {
  .sx-dm-shell { grid-template-columns: 310px minmax(0, 1fr); }
  .sx-dm-shell.has-details { grid-template-columns: 310px minmax(0, 1fr); }
}

/* ---------- Conversation List Pane ---------- */
.sx-dm-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-right: 1px solid var(--border);
  background: var(--background);
}
.sx-dm-pane-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.sx-dm-pane-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sx-dm-pane-title {
  font-family: var(--ds-font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--foreground);
  line-height: 1.1;
}
.sx-dm-compose-btn {
  width: 36px;
  height: 36px;
  background: var(--content);
}
.sx-dm-compose-btn:hover { background: var(--ds-press); }
.sx-dm-compose-btn svg { width: 19px; height: 19px; }

.sx-dm-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sx-dm-filters::-webkit-scrollbar { display: none; }
.sx-dm-fchip {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  gap: 6px;
}
.sx-dm-fcount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--content);
  color: var(--muted-foreground);
}
.sx-dm-fchip.is-active .sx-dm-fcount {
  background: color-mix(in srgb, var(--background) 22%, transparent);
  color: var(--background);
}

.sx-dm-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 6px 0 12px;
}
.sx-dm-list::-webkit-scrollbar { display: none; }

.sx-dm-list-sec {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.sx-dm-sec-ico { display: inline-flex; width: 12px; height: 12px; }
.sx-dm-sec-ico svg { width: 12px; height: 12px; }

.sx-dm-row-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sx-dm-row-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background-color 140ms ease;
  pointer-events: none;
  z-index: 2;
}
.sx-dm-row-wrap.is-active::before {
  background: var(--primary);
}
.sx-dm-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
  min-width: 0;
}
.sx-dm-row-wrap:hover .sx-dm-row { background: var(--ds-hover); }
.sx-dm-row-wrap.is-active .sx-dm-row {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.sx-dm-row-av { position: relative; flex-shrink: 0; }
.sx-dm-online {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: var(--success);
  border: 2px solid var(--background);
}
.sx-dm-online.is-sm { width: 10px; height: 10px; right: 0; bottom: 0; }
.sx-dm-online.is-lg { width: 15px; height: 15px; right: 2px; bottom: 2px; border-width: 2.5px; }

.sx-dm-row-body { flex: 1; min-width: 0; }
.sx-dm-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sx-dm-row-title-grp { display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.sx-dm-row-name { font-size: 15px; }
.sx-dm-muted-ico { display: inline-flex; color: var(--muted-foreground); opacity: .7; flex-shrink: 0; }
.sx-dm-muted-ico svg { width: 13px; height: 13px; }
.sx-dm-row-time { font-size: 12px; color: var(--muted-foreground); flex-shrink: 0; font-variant-numeric: tabular-nums; transition: opacity 120ms ease; }
.sx-dm-row-time.is-unread { color: var(--primary); font-weight: 700; }

.sx-dm-row-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; min-width: 0; }
.sx-dm-row-preview {
  display: block;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sx-dm-row-preview.is-unread { font-weight: 700; color: var(--foreground); }
.sx-dm-unread-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 120ms ease;
}

.sx-dm-row-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
}
.sx-dm-dots { display: inline-flex; align-items: center; gap: 2px; padding-top: 2px; }
.sx-dm-dots i {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: currentColor;
  animation: sxDmType 1.2s ease-in-out infinite;
}
.sx-dm-dots i:nth-child(2) { animation-delay: .18s; }
.sx-dm-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes sxDmType { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.sx-dm-row-more {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background-color 120ms ease;
  z-index: 3;
}
.sx-dm-row-more svg { width: 16px; height: 16px; }
.sx-dm-row-wrap:hover .sx-dm-row-more,
.sx-dm-row-more:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.sx-dm-row-more:hover { background: var(--content); }
@media (hover: none) { .sx-dm-row-more { display: none; } }

/* Mobile list mode */
.sx-dm-mobile-list {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.sx-dm-mobile-tools {
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sx-dm-mobile-searchrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile full-height chat containment */
body.in-mobile-chat #installBanner,
body.in-mobile-chat #mobileBottomNav {
  display: none !important;
}
#centerColumn:has(.sx-dm-mobile-chat) {
  flex: 1 1 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.sx-dm-mobile-chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* ---------- Chat Pane ---------- */
.sx-dm-chat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: color-mix(in srgb, var(--card) 58%, var(--background));
}
.sx-dm-chat-empty {
  background: var(--background);
  align-items: center;
  justify-content: center;
}
.sx-dm-empty-canvas {
  max-width: 360px;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sx-dm-empty-illus { width: 88px; height: 88px; color: var(--foreground); margin-bottom: 4px; }
.sx-dm-empty-illus svg { width: 100%; height: 100%; display: block; }
.sx-dm-empty-title {
  font-family: var(--ds-font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 0;
}
.sx-dm-empty-sub {
  font-size: 14.5px;
  line-height: 1.48;
  color: var(--muted-foreground);
  margin: 0 0 6px;
}

.sx-dm-chat-head {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--ds-glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  flex-shrink: 0;
}
.sx-dm-peer {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-align: left;
  cursor: pointer;
}
.sx-dm-peer-av { position: relative; flex-shrink: 0; }
.sx-dm-peer-name { font-size: 16px; }
.sx-dm-peer-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 1px; }
.sx-dm-info-btn.is-active {
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--primary);
}

.sx-dm-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 14px;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 767px) {
  .sx-dm-scroll { padding: 14px 14px 10px; }
}
.sx-dm-scroll::-webkit-scrollbar { display: none; }

.sx-dm-intro {
  max-width: 340px;
  margin: 4px auto 8px;
  padding: 16px 18px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.sx-dm-intro:hover .sx-dm-intro-name { text-decoration: underline; }
.sx-dm-intro-name { font-size: 17px; margin-top: 5px; }
.sx-dm-intro-bio { font-size: 13.5px; color: var(--muted-foreground); line-height: 1.45; margin-top: 2px; }

.sx-dm-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.sx-dm-day {
  display: flex;
  justify-content: center;
  margin: 6px 0 2px;
}
.sx-dm-day span {
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-foreground);
}

.sx-dm-cluster {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}
.sx-dm-cluster.is-me { align-items: flex-end; }
.sx-dm-cluster.is-them { align-items: flex-start; }

.sx-dm-row-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border-radius: 14px;
  transition: background-color 240ms ease;
}
.sx-dm-row-msg.has-reacts { margin-bottom: 4px; }
.sx-dm-cluster.is-me .sx-dm-row-msg { justify-content: flex-end; }
.sx-dm-cluster.is-them .sx-dm-row-msg { justify-content: flex-start; }
.sx-dm-row-msg.is-flash .sx-dm-bubble {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 42%, transparent);
}

.sx-dm-msg-col {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 70%;
  min-width: 0;
}
.sx-dm-cluster.is-me .sx-dm-msg-col { align-items: flex-end; }
.sx-dm-cluster.is-them .sx-dm-msg-col { align-items: flex-start; }
@media (max-width: 767px) {
  .sx-dm-msg-col { max-width: 82%; }
}

.sx-dm-bubble {
  padding: 10px 15px;
  font-size: var(--dm-font-size, 15px);
  line-height: 1.44;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  border-radius: 20px;
  transition: box-shadow 180ms ease, transform 140ms var(--ds-ease);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}
.sx-dm-bubble.is-pressing,
.sx-dm-sticker-wrap.is-pressing {
  transform: scale(.96);
}
.sx-dm-bubble.has-media { padding: 4px; overflow: hidden; }
.sx-dm-bubble.has-media .sx-dm-txt { padding: 7px 11px 6px; }
.sx-dm-bubble.has-media.has-quote .sx-dm-quote { margin: 4px 4px 4px; }
.sx-dm-bubble.has-media > div:not(.sx-dm-txt):not(.sx-dm-quote):not(.sx-dm-bubble-meta):not(.sx-dm-fwd):not(.sx-dm-linkprev) {
  max-width: 100% !important;
  width: 100%;
  min-width: 240px;
  border: 0 !important;
  border-radius: 16px !important;
}
.sx-dm-bubble.has-media img {
  max-height: 230px;
}

/* Outgoing (mine): rich theme gradient solid + grouped radii */
.sx-dm-cluster.is-me .sx-dm-bubble {
  background: linear-gradient(135deg, var(--dm-theme, var(--primary)) 0%, var(--dm-theme-2, color-mix(in srgb, var(--primary) 82%, #7c3aed)) 100%);
  color: var(--dm-theme-fg, var(--primary-foreground));
  box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--dm-theme, var(--primary)) 45%, transparent);
}
.sx-dm-cluster.is-me .sx-dm-bubble.is-only { border-radius: 20px 20px 6px 20px; }
.sx-dm-cluster.is-me .sx-dm-bubble.is-first { border-radius: 20px 20px 6px 20px; }
.sx-dm-cluster.is-me .sx-dm-bubble.is-mid { border-radius: 20px 6px 6px 20px; }
.sx-dm-cluster.is-me .sx-dm-bubble.is-last { border-radius: 20px 6px 20px 20px; }

/* Incoming (theirs): crisp surface + grouped radii */
.sx-dm-cluster.is-them .sx-dm-bubble {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 20, 25, .04);
}
html.dark .sx-dm-cluster.is-them .sx-dm-bubble {
  background: var(--content);
  border-color: var(--card-border);
}
.sx-dm-cluster.is-them .sx-dm-bubble.is-only { border-radius: 20px 20px 20px 6px; }
.sx-dm-cluster.is-them .sx-dm-bubble.is-first { border-radius: 20px 20px 20px 6px; }
.sx-dm-cluster.is-them .sx-dm-bubble.is-mid { border-radius: 6px 20px 20px 6px; }
.sx-dm-cluster.is-them .sx-dm-bubble.is-last { border-radius: 6px 20px 20px 20px; }

/* Reply-to quote inside bubble */
.sx-dm-quote {
  position: relative;
  padding: 7px 10px 7px 16px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  cursor: pointer;
  max-width: 100%;
}
.sx-dm-quote::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--primary);
}
.sx-dm-quote-who {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}
.sx-dm-quote-txt {
  font-size: 12.5px;
  line-height: 1.35;
  opacity: .88;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sx-dm-cluster.is-me .sx-dm-quote {
  background: color-mix(in srgb, var(--primary-foreground) 15%, transparent);
}
.sx-dm-cluster.is-me .sx-dm-quote::before {
  background: var(--primary-foreground);
}
.sx-dm-cluster.is-me .sx-dm-quote-who,
.sx-dm-cluster.is-me .sx-dm-quote-txt {
  color: var(--primary-foreground);
}

/* Reaction chips under bubble */
.sx-dm-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: -6px;
  padding: 0 6px;
  position: relative;
  z-index: 2;
}
.sx-dm-react-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--foreground);
  transition: transform 110ms ease, border-color 140ms ease, background-color 140ms ease;
}
.sx-dm-react-chip:hover { transform: scale(1.06); }
.sx-dm-react-chip:active { transform: scale(.94); }
.sx-dm-react-chip.is-mine {
  border-color: var(--dm-theme, var(--primary));
  background: color-mix(in srgb, var(--dm-theme, var(--primary)) 13%, var(--background));
  color: var(--dm-theme, var(--primary));
}
.sx-dm-react-n { font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* Hover toolbar on bubble (desktop hover) */
.sx-dm-hover-tools {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(.96);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 130ms ease, transform 140ms var(--ds-ease);
  z-index: 12;
  white-space: nowrap;
}
.sx-dm-cluster.is-me .sx-dm-hover-tools {
  right: 100%;
  padding-right: 10px;
  flex-direction: row;
}
.sx-dm-cluster.is-them .sx-dm-hover-tools {
  left: 100%;
  padding-left: 10px;
  flex-direction: row-reverse;
}
.sx-dm-row-msg:hover .sx-dm-hover-tools,
.sx-dm-row-msg:focus-within .sx-dm-hover-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.sx-dm-msg-hover-ts {
  font-size: 11.5px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.sx-dm-hover-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 5px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: var(--ds-shadow-pop);
}
.sx-dm-react-strip { display: inline-flex; align-items: center; gap: 1px; }
.sx-dm-react-q {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 100ms ease, background-color 100ms ease;
}
.sx-dm-react-q:hover { background: var(--ds-hover); transform: scale(1.18); }
.sx-dm-react-q.is-mine { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.sx-dm-hover-sep { width: 1px; height: 16px; background: var(--border); margin: 0 2px; }
.sx-dm-msg-act {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: background-color 110ms ease, color 110ms ease;
}
.sx-dm-msg-act:hover { background: var(--ds-hover); color: var(--foreground); }
.sx-dm-msg-act svg { width: 15px; height: 15px; }

/* Popover quick react strip (used by openDmMenu on touch / desktop) */
.sx-dm-pop-reacts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 2px 4px 4px;
}
.sx-dm-pop-react {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 110ms ease, transform 110ms ease;
}
.sx-dm-pop-react:hover { background: var(--ds-hover); transform: scale(1.14); }
.sx-dm-pop-react.is-mine { background: color-mix(in srgb, var(--primary) 16%, transparent); }

/* Mobile compact message actions button */
.sx-dm-msg-more-mob { display: none; }
@media (hover: none), (max-width: 767px) {
  .sx-dm-hover-tools { display: none !important; }
  .sx-dm-cluster.is-me .sx-dm-row-msg { flex-direction: row-reverse; justify-content: flex-start; }
  .sx-dm-msg-more-mob {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    color: var(--muted-foreground);
    opacity: .65;
    flex-shrink: 0;
  }
  .sx-dm-msg-more-mob svg { width: 16px; height: 16px; }
}

.sx-dm-ts {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted-foreground);
  padding: 2px 6px 0;
}
.sx-dm-seen {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--primary);
  font-weight: 700;
}
.sx-dm-seen svg { width: 14px; height: 14px; }
.sx-dm-edited { color: var(--link); font-weight: 600; }
.sx-dm-edited:hover { text-decoration: underline; }

/* Message request / blocked banner */
.sx-dm-reqbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--background);
  flex-shrink: 0;
}

/* ---------- Floating Pill Composer ---------- */
.sx-dm-compose {
  position: relative;
  z-index: 2;
  padding: 8px 18px max(14px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  background: transparent;
}
.sx-dm-compose-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sx-dm-replybar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
  animation: dsPageIn 140ms var(--ds-ease);
}
.sx-dm-replybar-stripe {
  width: 3px;
  height: 30px;
  border-radius: 3px;
  background: var(--primary);
  flex-shrink: 0;
}
.sx-dm-replybar-who {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.sx-dm-replybar-txt {
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sx-dm-staged {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--background);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}
.sx-dm-staged img { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

.sx-dm-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 26px;
  border: 1px solid var(--card-border);
  background: var(--background);
  box-shadow: 0 6px 24px -8px rgba(15, 20, 25, .12), 0 1px 3px rgba(15, 20, 25, .05);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
html.dark .sx-dm-inputbar {
  background: var(--content);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.sx-dm-inputbar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent), 0 6px 24px -8px rgba(15, 20, 25, .14);
}
.sx-dm-tool {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: background-color 120ms ease, color 120ms ease;
  flex-shrink: 0;
}
.sx-dm-tool:hover { background: var(--ds-hover); color: var(--foreground); }
.sx-dm-tool.is-active { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.sx-dm-tool svg { width: 20px; height: 20px; }

.sx-dm-in {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 7px 4px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--foreground);
  resize: none;
  max-height: 132px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sx-dm-in::-webkit-scrollbar { display: none; }
.sx-dm-in:focus { outline: none; }
.sx-dm-in::placeholder { color: var(--muted-foreground); }

.sx-dm-send {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--content);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 150ms ease, color 150ms ease, transform 120ms ease;
}
html.dark .sx-dm-send { background: var(--background); }
.sx-dm-send.is-ready {
  background: var(--dm-theme, var(--primary));
  color: var(--dm-theme-fg, var(--primary-foreground));
}
.sx-dm-send.is-ready:hover { opacity: .92; }
.sx-dm-send:active { transform: scale(.92); }
.sx-dm-send svg { width: 17px; height: 17px; }

/* Inline Emoji / GIF / Image Tray under DM input */
.sx-dm-tray {
  padding: 10px;
  border-radius: var(--ds-radius-l);
  border: 1px solid var(--card-border);
  background: var(--background);
  box-shadow: var(--ds-shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: dsPageIn 160ms var(--ds-ease);
}
.sx-dm-tray-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sx-dm-tray-grid {
  max-height: 196px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sx-dm-tray-grid::-webkit-scrollbar { display: none; }
.sx-dm-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}
@media (min-width: 640px) {
  body:not(.mobile-sim) .sx-dm-emoji-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
.sx-dm-emoji-btn {
  height: 36px;
  border-radius: 10px;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms ease, transform 100ms ease;
}
.sx-dm-emoji-btn:hover { background: var(--ds-hover); }
.sx-dm-emoji-btn:active { transform: scale(1.18); }

.sx-dm-tray-search input {
  height: 38px;
  font-size: 16px;
}

.sx-dm-gif-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
  width: 100%;
}
.sx-dm-gif-btn {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b0f1a;
}
.sx-dm-gif-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-dm-gif-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}
.sx-dm-gif-lbl {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 6px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sx-dm-img-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--ds-radius-m);
  border: 1px dashed color-mix(in srgb, var(--primary) 55%, transparent);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.sx-dm-img-upload:hover { background: color-mix(in srgb, var(--primary) 13%, transparent); }
.sx-dm-img-upload svg { width: 18px; height: 18px; }

/* ---------- Right Details Panel (320px) ---------- */
.sx-dm-details {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-left: 1px solid var(--border);
  background: var(--background);
}
@media (max-width: 1140px) {
  .sx-dm-details {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90%;
    z-index: 25;
    box-shadow: -12px 0 36px rgba(0, 0, 0, .18);
  }
}
.sx-dm-det-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sx-dm-det-title {
  font-family: var(--ds-font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.sx-dm-det-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sx-dm-det-scroll::-webkit-scrollbar { display: none; }

.sx-dm-det-prof {
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.sx-dm-det-av {
  position: relative;
  border-radius: 9999px;
  transition: transform 140ms var(--ds-ease);
}
.sx-dm-det-av:hover { transform: scale(1.02); }
.sx-dm-det-namewrap { margin-top: 12px; max-width: 100%; }
.sx-dm-det-name { font-size: 18px; }
.sx-dm-det-handle { font-size: 13px; color: var(--muted-foreground); margin-top: 2px; }
.sx-dm-det-bio {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--foreground);
  opacity: .88;
}
.sx-dm-det-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
}

.sx-dm-det-sec {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.sx-dm-det-row {
  display: flex;
  align-items: center;
  gap: 11px;
}
.sx-dm-det-row-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--content);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sx-dm-det-row-ico svg { width: 17px; height: 17px; }

.sx-dm-det-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--foreground);
  margin-bottom: 10px;
}
.sx-dm-det-count {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  background: var(--content);
  color: var(--muted-foreground);
}
.sx-dm-det-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.sx-dm-det-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--content);
  cursor: zoom-in;
}
.sx-dm-det-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms var(--ds-ease);
}
.sx-dm-det-thumb:hover img { transform: scale(1.06); }
.sx-dm-det-empty {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.sx-dm-det-danger {
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 18px;
}
.sx-dm-danger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--error);
  text-align: left;
  transition: background-color 120ms ease;
}
.sx-dm-danger-btn:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }
.sx-dm-danger-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

/* =====================================================================
   MESSAGES v2.1: LONG-PRESS CONTEXT OVERLAYS · ARCHIVED · THEMES · SETTINGS
   ===================================================================== */

.sx-dm-row-wrap {
  transition: transform 140ms var(--ds-ease);
  touch-action: pan-y;
}
.sx-dm-row-wrap.is-pressing {
  transform: scale(.97);
}
.sx-dm-unread-pill.is-muted {
  background: var(--muted-foreground);
  opacity: .75;
}

/* Archived Banner Row & Pushed Pane */
.sx-dm-arch-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--content) 45%, var(--background));
  transition: background-color 120ms ease;
}
.sx-dm-arch-row:hover { background: var(--ds-hover); }
.sx-dm-arch-row:active { background: var(--ds-press); }
.sx-dm-arch-ico {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: var(--content);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sx-dm-arch-ico svg { width: 20px; height: 20px; }
.sx-dm-arch-body { flex: 1; min-width: 0; }
.sx-dm-arch-title { display: block; font-family: var(--ds-font-display); font-size: 15px; font-weight: 700; color: var(--foreground); }
.sx-dm-arch-sub { display: block; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sx-dm-arch-right { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--muted-foreground); }
.sx-dm-arch-count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 9999px;
  background: var(--content); color: var(--muted-foreground);
  font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.sx-dm-arch-count.has-unread { background: var(--primary); color: var(--primary-foreground); }
.sx-dm-arch-head { gap: 4px !important; animation: sxPush 200ms var(--ds-ease); }
.sx-dm-arch-list { padding: 4px 0; }

/* Blurred Backdrop Context Menu Overlay (iOS / Telegram style) */
.sx-dm-ctx-ov {
  position: fixed;
  inset: 0;
  z-index: 94;
  user-select: none;
  -webkit-user-select: none;
}
body.mobile-sim .sx-dm-ctx-ov,
.sx-dm-ctx-ov.is-sim {
  position: absolute;
}
.sx-dm-ctx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 20, .38);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  opacity: 0;
  transition: opacity 160ms ease;
}
html.dark .sx-dm-ctx-backdrop {
  background: rgba(0, 0, 0, .58);
}
.sx-dm-ctx-ov.is-open .sx-dm-ctx-backdrop { opacity: 1; }
.sx-dm-ctx-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sx-dm-ctx-lifted-row {
  position: absolute;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 44px rgba(10, 14, 24, .24);
  transform: scale(.96);
  opacity: 0;
  transition: transform 220ms var(--ds-ease), opacity 160ms ease, top 220ms var(--ds-ease);
}
html.dark .sx-dm-ctx-lifted-row {
  background: var(--card);
  box-shadow: 0 20px 52px rgba(0, 0, 0, .62);
}
.sx-dm-ctx-ov.is-open .sx-dm-ctx-lifted-row {
  transform: scale(1);
  opacity: 1;
}

.sx-dm-ctx-menu {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--background) 94%, transparent);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--card-border);
  box-shadow: var(--ds-shadow-pop);
  transform: scale(.94) translateY(-6px);
  opacity: 0;
  transition: transform 220ms var(--ds-ease), opacity 160ms ease;
}
html.dark .sx-dm-ctx-menu {
  background: color-mix(in srgb, var(--card) 95%, transparent);
}
.sx-dm-ctx-ov.is-open .sx-dm-ctx-menu {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.sx-dm-ctx-menu.is-msg {
  position: static;
  width: 100%;
  max-width: 248px;
}

.sx-dm-ctx-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  transition: background-color 110ms ease, transform 100ms ease;
}
.sx-dm-ctx-item:hover { background: var(--ds-hover); }
.sx-dm-ctx-item:active { transform: scale(.98); background: var(--ds-press); }
.sx-dm-ctx-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sx-dm-ctx-item.is-head { font-weight: 800; color: var(--primary); }
.sx-dm-ctx-item.is-danger { color: var(--error); }
.sx-dm-ctx-item.is-danger:hover { background: color-mix(in srgb, var(--error) 11%, transparent); }
.sx-dm-ctx-chev svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.sx-dm-ctx-sep { height: 1px; margin: 4px 10px; background: var(--border); flex-shrink: 0; }

/* Message Context Overlay (Reaction Bar + Bubble + Menu) */
.sx-dm-ctx-msgwrap {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: scale(.95);
  opacity: 0;
  transition: transform 220ms var(--ds-ease), opacity 160ms ease;
}
.sx-dm-ctx-msgwrap.is-me { align-items: flex-end; }
.sx-dm-ctx-msgwrap.is-them { align-items: flex-start; }
.sx-dm-ctx-ov.is-open .sx-dm-ctx-msgwrap {
  transform: scale(1);
  opacity: 1;
}

.sx-dm-ctx-reactbar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: var(--ds-shadow-pop);
  max-width: 100%;
}
html.dark .sx-dm-ctx-reactbar { background: var(--card); }
.sx-dm-ctx-react {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background-color 120ms ease;
}
.sx-dm-ctx-react:hover { transform: scale(1.18); background: var(--ds-hover); }
.sx-dm-ctx-react:active { transform: scale(.92); }
.sx-dm-ctx-react.is-mine { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.sx-dm-ctx-react-more {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: var(--content);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  transition: background-color 120ms ease, transform 120ms ease;
}
.sx-dm-ctx-react-more:hover { background: var(--ds-press); }
.sx-dm-ctx-react-more svg { width: 16px; height: 16px; }

.sx-dm-ctx-moregrid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: 8px;
  border-radius: 16px;
  background: var(--background);
  border: 1px solid var(--card-border);
  box-shadow: var(--ds-shadow-pop);
}
html.dark .sx-dm-ctx-moregrid { background: var(--card); }
.sx-dm-ctx-more-em {
  height: 34px;
  border-radius: 10px;
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sx-dm-ctx-more-em:hover { background: var(--ds-hover); }

.sx-dm-ctx-bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.42;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .24);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.sx-dm-ctx-bubble.is-me {
  background: linear-gradient(135deg, var(--dm-theme, var(--primary)) 0%, var(--dm-theme-2, color-mix(in srgb, var(--primary) 82%, #7c3aed)) 100%);
  color: var(--dm-theme-fg, var(--primary-foreground));
}
.sx-dm-ctx-bubble.is-them {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--card-border);
}
html.dark .sx-dm-ctx-bubble.is-them { background: var(--content); }
.sx-dm-ctx-thumb {
  max-height: 136px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* Chat Wallpapers */
.sx-dm-wallpaper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.sx-dm-wp-aurora {
  background:
    radial-gradient(90% 70% at 15% 15%, rgba(91, 91, 246, .22), transparent 60%),
    radial-gradient(80% 70% at 85% 80%, rgba(236, 72, 153, .18), transparent 60%),
    linear-gradient(155deg, color-mix(in srgb, var(--primary) 8%, var(--background)), var(--background));
}
.sx-dm-wp-sunset {
  background:
    radial-gradient(90% 80% at 85% 10%, rgba(244, 63, 94, .22), transparent 60%),
    radial-gradient(85% 75% at 15% 85%, rgba(245, 158, 11, .2), transparent 60%),
    var(--background);
}
.sx-dm-wp-ocean {
  background:
    radial-gradient(90% 70% at 20% 20%, rgba(14, 165, 233, .24), transparent 60%),
    radial-gradient(85% 70% at 80% 85%, rgba(16, 185, 129, .2), transparent 60%),
    var(--background);
}
.sx-dm-wp-forest {
  background:
    radial-gradient(90% 75% at 75% 15%, rgba(16, 185, 129, .22), transparent 60%),
    radial-gradient(80% 75% at 20% 85%, rgba(59, 130, 246, .16), transparent 60%),
    var(--background);
}
.sx-dm-wp-midnight {
  background:
    radial-gradient(100% 80% at 80% 10%, rgba(99, 102, 241, .28), transparent 65%),
    linear-gradient(160deg, color-mix(in srgb, #1e293b 32%, var(--background)), var(--background));
}
.sx-dm-wp-dots {
  background-color: var(--card);
  background-image: radial-gradient(color-mix(in srgb, var(--dm-theme, var(--primary)) 28%, transparent) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}
.sx-dm-wp-grid {
  background-color: var(--card);
  background-image:
    linear-gradient(color-mix(in srgb, var(--dm-theme, var(--primary)) 12%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--dm-theme, var(--primary)) 12%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sx-dm-wp-waves {
  background-color: var(--card);
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--dm-theme, var(--primary)) 9%, transparent),
    color-mix(in srgb, var(--dm-theme, var(--primary)) 9%, transparent) 8px,
    transparent 8px,
    transparent 22px
  );
}
.sx-dm-wallpaper.is-custom {
  background-size: cover;
  background-position: center;
  opacity: .34;
}
html.dark .sx-dm-wallpaper.is-custom { opacity: .28; }

/* Pinned Message Bar & In-Chat Search */
.sx-dm-pinbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--ds-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  flex-shrink: 0;
}
.sx-dm-pinbar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sx-dm-pinbar-stripe {
  width: 3px;
  height: 28px;
  border-radius: 3px;
  background: var(--dm-theme, var(--primary));
  flex-shrink: 0;
}
.sx-dm-pinbar-ico {
  width: 16px;
  height: 16px;
  color: var(--dm-theme, var(--primary));
  display: inline-flex;
  flex-shrink: 0;
}
.sx-dm-pinbar-ico svg { width: 15px; height: 15px; }
.sx-dm-pinbar-lbl { display: block; font-size: 11.5px; font-weight: 800; color: var(--dm-theme, var(--primary)); line-height: 1.2; }
.sx-dm-pinbar-txt { display: block; font-size: 13px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sx-dm-insearch {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  flex-shrink: 0;
}
.sx-dm-insearch .ds-search input { height: 36px; font-size: 14px; }
.sx-dm-insearch-cnt { font-size: 12px; font-weight: 700; color: var(--muted-foreground); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sx-dm-mark {
  background: color-mix(in srgb, #facc15 48%, transparent);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

/* Disappearing System Pill, File Card, Link Preview, Forwarded, Bubble Meta */
.sx-dm-sys-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
  margin: 4px 0;
}
.sx-dm-sys-pill svg { width: 14px; height: 14px; color: var(--dm-theme, var(--primary)); }

.sx-dm-fwd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  opacity: .78;
  margin-bottom: 3px;
}
.sx-dm-fwd svg { width: 12px; height: 12px; }

.sx-dm-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--foreground) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
}
.sx-dm-cluster.is-me .sx-dm-file-card {
  background: color-mix(in srgb, var(--dm-theme-fg, #fff) 16%, transparent);
  border-color: color-mix(in srgb, var(--dm-theme-fg, #fff) 24%, transparent);
}
.sx-dm-file-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 16%, var(--background));
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sx-dm-file-ico svg { width: 17px; height: 17px; }
.sx-dm-file-meta { min-width: 0; flex: 1; }
.sx-dm-file-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-dm-file-sub { font-size: 11.5px; opacity: .78; margin-top: 1px; }

.sx-dm-linkprev {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--foreground) 6%, transparent);
  text-decoration: none;
  color: inherit;
}
.sx-dm-cluster.is-me .sx-dm-linkprev {
  background: color-mix(in srgb, var(--dm-theme-fg, #fff) 15%, transparent);
}
.sx-dm-linkprev-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--foreground) 10%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sx-dm-linkprev-ico svg { width: 14px; height: 14px; }
.sx-dm-linkprev-body { min-width: 0; flex: 1; }
.sx-dm-linkprev-host { display: block; font-size: 12px; font-weight: 800; }
.sx-dm-linkprev-url { display: block; font-size: 11.5px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sx-dm-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  opacity: .8;
}
.sx-dm-bubble.has-media .sx-dm-bubble-meta { padding: 0 8px 4px; }
.sx-dm-bmeta-ico { display: inline-flex; width: 12px; height: 12px; }
.sx-dm-bmeta-ico svg { width: 12px; height: 12px; }
.sx-dm-bmeta-ico.is-star { color: #f59e0b; }
.sx-dm-cluster.is-me .sx-dm-bmeta-ico.is-star { color: #fde047; }
.sx-dm-bmeta-edit { font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; color: inherit; }

/* Multi-select Mode */
.sx-dm-sel-chk {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid var(--card-border);
  background: var(--background);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.sx-dm-sel-chk.is-on {
  background: var(--primary);
  border-color: var(--primary);
}
.sx-dm-sel-chk svg { width: 13px; height: 13px; }
.sx-dm-stream.is-selecting .sx-dm-row-msg { cursor: pointer; padding: 2px 4px; }
.sx-dm-row-msg.is-selected { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.sx-dm-selbar {
  position: relative;
  z-index: 2;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--background);
  flex-shrink: 0;
}
.sx-dm-selbar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sx-dm-selbar-cnt { font-family: var(--ds-font-display); font-size: 14.5px; font-weight: 800; color: var(--foreground); }

/* =====================================================================
   CHAT SETTINGS & GENERAL MESSAGES SETTINGS PAGES
   ===================================================================== */
.sx-cs-page { min-height: 100%; font-size: 15px; }
.sx-cs-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px 12px;
  gap: 4px;
}
.sx-cs-av { border-radius: 9999px; margin-bottom: 6px; }
.sx-cs-namewrap { max-width: 100%; }
.sx-cs-qacts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}
.sx-cs-qbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  min-width: 58px;
}
.sx-cs-qico {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: var(--content);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, transform 120ms ease;
}
.sx-cs-qbtn:hover .sx-cs-qico { background: var(--ds-press); }
.sx-cs-qbtn:active .sx-cs-qico { transform: scale(.93); }
.sx-cs-qbtn.is-on .sx-cs-qico { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.sx-cs-qico svg { width: 19px; height: 19px; }

.sx-cs-block { padding: 14px 16px; }
.ds-row + .sx-cs-block, .sx-cs-block + .sx-cs-block, .sx-cs-block + .ds-row {
  border-top: 1px solid var(--border);
}

.sx-cs-preview {
  position: relative;
  overflow: hidden;
  border-radius: var(--ds-radius-m);
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--card) 60%, var(--background));
  padding: 14px 12px;
}
.sx-cs-prev-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sx-cs-prev-bub {
  max-width: 82%;
  padding: 8px 13px;
  font-size: var(--dm-font-size, 15px);
  line-height: 1.4;
  border-radius: 18px;
}
.sx-cs-prev-bub.is-them {
  align-self: flex-start;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
html.dark .sx-cs-prev-bub.is-them { background: var(--content); }
.sx-cs-prev-bub.is-me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--dm-theme, var(--primary)), var(--dm-theme-2, var(--primary)));
  color: var(--dm-theme-fg, #fff);
  border-bottom-right-radius: 6px;
}
.sx-cs-prev-dis {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--background);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-foreground);
}
.sx-cs-prev-dis svg { width: 12px; height: 12px; }

.sx-cs-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sx-cs-swatch {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  transition: transform 130ms ease, box-shadow 130ms ease;
}
.sx-cs-swatch:hover { transform: scale(1.08); }
.sx-cs-swatch.is-active { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary); }
.sx-cs-swatch svg { width: 15px; height: 15px; }
.sx-cs-swatch.is-default {
  width: auto;
  padding: 0 12px;
  background: var(--content);
  color: var(--foreground);
  font-size: 12.5px;
  font-weight: 700;
}

.sx-cs-wpgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 440px) {
  .sx-cs-wpgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.sx-cs-wp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 12px;
  border: 1.5px solid var(--card-border);
  background: var(--background);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.sx-cs-wp:hover { background: var(--ds-hover); }
.sx-cs-wp.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--background));
}
.sx-cs-wp-swatch {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.sx-cs-wp-dots { background-color: var(--card) !important; background-size: 10px 10px !important; }
.sx-cs-wp-grid { background-color: var(--card) !important; background-size: 12px 12px !important; }
.sx-cs-wp-lbl { font-size: 11.5px; font-weight: 700; color: var(--foreground); }

.sx-cs-seghead {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.sx-cs-seghead .ds-segment { width: 100%; display: flex; }
.sx-cs-seghead .ds-segment button { flex: 1; }
.sx-cs-mgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
}
.sx-cs-mcell {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--content);
  cursor: zoom-in;
}
.sx-cs-mcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-cs-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  transition: background-color 120ms ease;
}
.sx-cs-list-item:hover { background: var(--ds-hover); }
.sx-cs-empty-tab {
  padding: 24px 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted-foreground);
}

.sx-ms-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-ms-slider { accent-color: var(--primary); cursor: pointer; height: 6px; }

