/* CHAT2 · MESSENGER TELEGRAM/MAX VISUAL · 2026-07-31
 * Cascade-last after pixel-polish. Messenger = Telegram-like list+thread.
 * KEEP purged: bottom Profile/Chat/Voice/Channels tabbar · Discord text+voice rail.
 * ALLOW: stories · filters · favorites · channel badges · call overlay · voice bubbles · ONE product switcher.
 */
body[data-page="messenger"] {
  --tg-story: 62px;
  --tg-cobalt: #1d4ed8;
  --tg-voice: #0ea571;
  --tg-line: #d8e1ec;
  --tg-surface: #ffffff;
  --tg-bg: #f4f7fb;
}

/* ── Hard-kill Discord/office leftovers (never resurrect tabbar / voice rail) ── */
html body[data-page="messenger"] .vm-tabbar,
html body[data-page="messenger"] .mtabbar,
html body[data-page="messenger"] .dsnav,
html body[data-page="messenger"] .rail,
html body[data-page="messenger"] .vshell-rail,
html body[data-page="messenger"] .vshell-ch,
html body[data-page="messenger"] .vshell-burger,
html body[data-page="messenger"] .vshell-scrim,
html body[data-page="messenger"] .m-burger,
html body[data-page="messenger"] .m-chat,
html body[data-page="messenger"] .chsw,
html body[data-page="messenger"] .cl-groups,
html body[data-page="messenger"] #vyClGroups,
html body[data-page="messenger"] #vyAiFab,
html body[data-page="messenger"] #vyNews,
html body[data-page="messenger"] #vyBug,
html body[data-page="messenger"] .vy-eco-assistant,
html body[data-page="messenger"] #vyEcoAssistant,
html body[data-page="messenger"] [data-vy-assistant],
html body[data-page="messenger"] .vy-assistant-fab,
html body[data-page="messenger"] button.vy-assistant {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Guest shell: auth-gate must not blank the page */
html[data-auth-state="guest"] body > :not(.vy-auth-gate),
html[data-auth-state="guest"] body {
  visibility: visible !important;
}
html[data-auth-state="guest"] .vy-auth-gate {
  display: none !important;
}

/* Desktop: compact switcher in header slot. Mobile WAVE07: body thumb FAB only. */
@media (min-width: 641px) {
  html body[data-page="messenger"] .vy-msg-switcher-slot {
    display: inline-flex !important;
    align-items: center;
    position: relative;
    z-index: 40;
    flex: none;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  html body[data-page="messenger"] .vy-msg-switcher-slot .vy-product-switcher {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 50;
  }
  html body[data-page="messenger"] .vy-msg-switcher-slot .vy-product-launcher {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 12px !important;
    justify-content: center;
    gap: 0;
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid var(--tg-line) !important;
  }
  html body[data-page="messenger"] .vy-msg-switcher-slot .vy-product-launcher__label,
  html body[data-page="messenger"] .vy-msg-switcher-slot .vy-product-launcher__chevron {
    display: none !important;
  }
  html body[data-page="messenger"] .vy-msg-switcher-slot .vy-product-launcher__mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--tg-cobalt) !important;
    background-image: none !important;
    box-shadow: none !important;
  }
  html body[data-page="messenger"] .vy-msg-switcher-slot .vy-product-panel {
    right: 0;
    left: auto;
    width: min(360px, calc(100vw - 24px));
  }
  html body[data-page="messenger"] > .vy-product-switcher {
    display: none !important;
  }
}
@media (max-width: 640px) {
  html body[data-page="messenger"] .vy-msg-switcher-slot,
  html body[data-page="messenger"] .vy-messenger-product-slot {
    display: none !important;
  }
  html body[data-page="messenger"] > .vy-product-switcher {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: auto !important;
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(18px, calc(18px + env(safe-area-inset-bottom, 0px))) !important;
    left: auto !important;
    z-index: 1900 !important;
  }
  html body[data-page="messenger"] .app > .chatlist {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden; /* contain filter/stories OX inside chatlist */
  }
  html body[data-page="messenger"] .tg-filters {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 4px;
    padding: 8px 10px 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  html body[data-page="messenger"] .tg-filters::-webkit-scrollbar { display: none; }
  html body[data-page="messenger"] .tg-filter {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }
}

/* ── Stories rail ─────────────────────────────────────────────────────────── */
.tg-stories {
  display: flex;
  gap: 12px;
  padding: 8px 12px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--tg-line);
  background: var(--tg-surface);
  flex: none;
}
.tg-stories::-webkit-scrollbar { display: none; }
.tg-story {
  flex: 0 0 auto;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--txt, #111827);
  cursor: pointer;
  padding: 0;
  font: 600 11px/1.2 var(--font, Onest, system-ui, sans-serif);
}
.tg-story:focus-visible {
  outline: 2px solid var(--tg-cobalt);
  outline-offset: 3px;
  border-radius: 12px;
}
.tg-story__ring {
  width: var(--tg-story);
  height: var(--tg-story);
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #1d4ed8, #38bdf8 55%, #2ccf9b);
  display: grid;
  place-items: center;
}
.tg-story[data-seen="true"] .tg-story__ring {
  background: #cbd5e1;
}
.tg-story__av {
  width: calc(var(--tg-story) - 6px);
  height: calc(var(--tg-story) - 6px);
  border-radius: 50%;
  border: 2px solid #fff;
  background: #e2e8f0;
  color: #1e293b;
  display: grid;
  place-items: center;
  font: 700 15px/1 Unbounded, system-ui, sans-serif;
  overflow: hidden;
}
.tg-story--add .tg-story__ring {
  background: #e2e8f0;
}
.tg-story--add .tg-story__av {
  background: #eff6ff;
  color: var(--tg-cobalt);
  font-size: 22px;
}
.tg-story__name {
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}
.tg-story-viewer[hidden] { display: none !important; }
.tg-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.tg-story-viewer__bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
  margin-bottom: 14px;
}
.tg-story-viewer__bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: inherit;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-story-viewer.is-open .tg-story-viewer__bar > i {
    animation: tgStoryProgress 4.2s linear forwards;
  }
}
@keyframes tgStoryProgress {
  from { width: 0; }
  to { width: 100%; }
}
.tg-story-viewer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.tg-story-viewer__body {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.tg-story-viewer__body strong {
  display: block;
  font: 700 22px/1.2 Unbounded, system-ui, sans-serif;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.tg-story-viewer__body p {
  margin: 0;
  color: rgba(255,255,255,.78);
  font: 400 14px/1.5 Onest, system-ui, sans-serif;
  max-width: 28ch;
}
.tg-story-viewer__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ── Inbox filters (chats / groups / channels / saved) ────────────────────── */
.tg-filters {
  display: flex;
  gap: 6px;
  padding: 8px 12px 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--tg-surface);
  flex: none;
}
.tg-filters::-webkit-scrollbar { display: none; }
.tg-filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--tg-line);
  background: #f8fafc;
  color: #334155;
  font: 650 12.5px/1 Onest, system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.tg-filter[aria-selected="true"] {
  background: #eff6ff;
  border-color: color-mix(in srgb, var(--tg-cobalt) 40%, var(--tg-line));
  color: var(--tg-cobalt);
}
.tg-filter:focus-visible {
  outline: 2px solid var(--tg-cobalt);
  outline-offset: 2px;
}

/* Channel / group row badges */
.conv[data-kind="group"] .cv-nm::before,
.conv[data-kind="channel"] .cv-nm::before,
.cl-ch[data-kind="channel"] .nm::before {
  content: "";
  display: inline-block;
  width: 0;
}
.tg-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font: 700 10px/1.4 Onest, system-ui, sans-serif;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}
.tg-kind--group { background: #ecfdf5; color: #047857; }
.tg-kind--channel-open { background: #eff6ff; color: #1d4ed8; }
.tg-kind--channel-closed { background: #f1f5f9; color: #475569; }
.tg-kind--invite { background: #fff7ed; color: #c2410c; }

/* Channel feed chrome (posts / comments / invite) — UI only */
.tg-channel-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--tg-line);
  background: #fff;
  flex: none;
}
body[data-page="messenger"].tg-channel-mode .tg-channel-bar {
  display: flex !important;
}
.tg-channel-bar__meta {
  flex: 1;
  min-width: 0;
  font: 600 12.5px/1.35 Onest, system-ui, sans-serif;
  color: #475569;
}
.tg-channel-bar__meta strong {
  color: #111827;
  font-weight: 750;
}
.tg-channel-chip {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--tg-line);
  background: #f8fafc;
  color: #334155;
  font: 650 11.5px/1 Onest, system-ui, sans-serif;
  cursor: pointer;
  flex: none;
}
.tg-channel-chip:hover { border-color: var(--tg-cobalt); color: var(--tg-cobalt); }
.tg-channel-chip[aria-pressed="true"] {
  background: #eff6ff;
  border-color: color-mix(in srgb, var(--tg-cobalt) 42%, var(--tg-line));
  color: var(--tg-cobalt);
}

/* Favorites stay first */
.cl-saved {
  display: flex !important;
  visibility: visible !important;
}

/* ── Thread call actions (Telegram-style, NOT Discord voice rail) ─────────── */
.tg-call-btn,
.th-head .tg-call-btn,
.tg-head .tg-call-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  /* MSG_SWARM_07: do not force visibility — inactive thread must stay inert @390 */
  pointer-events: auto;
  opacity: 1;
  transition: background .2s ease, color .2s ease, transform .22s cubic-bezier(.22,1,.36,1);
}
.tg-call-btn:hover { background: #eff6ff; color: var(--tg-cobalt); }
.tg-call-btn:active { transform: scale(.92); }
.tg-call-btn svg { width: 20px; height: 20px; }
.tg-call-btn--video:hover { color: #0ea5e9; background: #f0f9ff; }
@media (prefers-reduced-motion: no-preference) {
  .tg-call-btn--tap {
    animation: tgCallBtnTap .36s cubic-bezier(.22,1,.36,1);
  }
}
@keyframes tgCallBtnTap {
  0% { transform: scale(1); }
  40% { transform: scale(.86); background: #dbeafe; color: var(--tg-cobalt); }
  100% { transform: scale(1); }
}

/* Full-screen call overlay · MSG_SWARM_04 · MSG_VIS_05 dead-overlay harden */
.tg-call-ui[hidden],
.tg-call-ui[aria-hidden="true"]:not(.tg-call-ui--pip):not([data-minimized="1"]) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  inset: auto !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}
.tg-call-ui:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  grid-template-rows: 1fr auto;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(29,78,216,.42), transparent 55%),
    radial-gradient(90% 60% at 80% 100%, rgba(56,189,248,.18), transparent 50%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #fff;
  padding: max(18px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  pointer-events: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ui:not([hidden]):not(.tg-call-ui--leaving) {
    animation: tgCallEnter .48s cubic-bezier(.22,1,.36,1) both;
  }
  .tg-call-ui--leaving {
    animation: tgCallLeave .4s cubic-bezier(.4,0,.2,1) both;
    pointer-events: none;
  }
}
@keyframes tgCallEnter {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes tgCallLeave {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(18px) scale(.97); }
}
.tg-call-ui__min {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s ease, transform .2s ease;
}
.tg-call-ui__min:hover { background: rgba(255,255,255,.22); }
.tg-call-ui__min svg { width: 18px; height: 18px; }
.tg-call-ui[data-state="guest"] .tg-call-ui__min { display: none; }
.tg-call-ui__stage {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.tg-call-ui__glow {
  position: absolute;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.22), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ui[data-state="ringing"] .tg-call-ui__glow,
  .tg-call-ui[data-state="active"] .tg-call-ui__glow {
    animation: tgCallGlow 2.8s ease-in-out infinite;
  }
}
@keyframes tgCallGlow {
  0%, 100% { transform: scale(.92); opacity: .55; }
  50% { transform: scale(1.08); opacity: 1; }
}
.tg-call-ui__av {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 800 36px/1 Unbounded, system-ui, sans-serif;
  background: linear-gradient(145deg, #1d4ed8, #38bdf8);
  box-shadow: 0 18px 48px rgba(29,78,216,.35);
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ui[data-state="ringing"] .tg-call-ui__av::before,
  .tg-call-ui[data-state="ringing"] .tg-call-ui__av::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(56,189,248,.45);
    animation: tgCallPulse 1.6s ease-out infinite;
  }
  .tg-call-ui[data-state="ringing"] .tg-call-ui__av::after {
    animation-delay: .55s;
  }
  .tg-call-ui[data-state="active"] .tg-call-ui__av {
    animation: tgCallAvBreath 3.2s ease-in-out infinite;
  }
}
@keyframes tgCallPulse {
  0% { transform: scale(.92); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes tgCallAvBreath {
  0%, 100% { box-shadow: 0 18px 48px rgba(29,78,216,.35); transform: scale(1); }
  50% { box-shadow: 0 22px 56px rgba(56,189,248,.45); transform: scale(1.03); }
}
.tg-call-ui__title {
  margin: 0;
  font: 700 22px/1.2 Unbounded, system-ui, sans-serif;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}
.tg-call-ui__sub {
  margin: 0;
  color: rgba(255,255,255,.72);
  font: 500 14px/1.4 Onest, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
  position: relative;
  z-index: 1;
}
.tg-call-ui__hint {
  margin: 0;
  min-height: 1.2em;
  color: #93c5fd;
  font: 700 13px/1.3 Onest, system-ui, sans-serif;
  position: relative;
  z-index: 1;
}
.tg-call-ui__hint[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ui__hint--flash {
    animation: tgCallHint .55s cubic-bezier(.22,1,.36,1) both;
  }
}
@keyframes tgCallHint {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.tg-call-ui__wave {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 28px;
  position: relative;
  z-index: 1;
}
.tg-call-ui[data-mode="audio"][data-state="active"]:not(.tg-call-ui--muted) .tg-call-ui__wave {
  display: flex;
}
.tg-call-ui__wave i {
  display: block;
  width: 4px;
  height: 10px;
  border-radius: 99px;
  background: #38bdf8;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ui__wave i {
    animation: tgCallWave 1s ease-in-out infinite;
  }
  .tg-call-ui__wave i:nth-child(2) { animation-delay: .12s; }
  .tg-call-ui__wave i:nth-child(3) { animation-delay: .24s; }
  .tg-call-ui__wave i:nth-child(4) { animation-delay: .08s; }
  .tg-call-ui__wave i:nth-child(5) { animation-delay: .2s; }
}
@keyframes tgCallWave {
  0%, 100% { height: 8px; opacity: .55; }
  50% { height: 26px; opacity: 1; }
}
.tg-call-ui__video {
  width: min(720px, 92vw);
  aspect-ratio: 16/10;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(15,23,42,.55), rgba(29,78,216,.32)),
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px);
  border: 1px solid rgba(255,255,255,.12);
  display: none;
  place-items: center;
  color: rgba(255,255,255,.7);
  font: 600 14px/1.4 Onest, system-ui, sans-serif;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: transform .45s cubic-bezier(.22,1,.36,1);
}
.tg-call-ui__video-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.04) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(255,255,255,.04) 50%, transparent 51%);
  background-size: 48px 48px;
  pointer-events: none;
}
.tg-call-ui__video-label { position: relative; z-index: 1; }
.tg-call-ui__self {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 72px;
  height: 96px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1e3a8a, #1d4ed8);
  border: 2px solid rgba(255,255,255,.35);
  font: 700 12px/1 Onest, system-ui, sans-serif;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.tg-call-ui--flipped .tg-call-ui__video { transform: scaleX(-1); }
.tg-call-ui--flipped .tg-call-ui__self { transform: scaleX(-1); }
.tg-call-ui--cam-off .tg-call-ui__self {
  opacity: .45;
  filter: grayscale(.4);
}
.tg-call-ui[data-mode="video"] .tg-call-ui__video { display: grid; }
.tg-call-ui[data-mode="video"] .tg-call-ui__av { display: none; }
.tg-call-ui[data-mode="video"] .tg-call-ui__wave { display: none !important; }
.tg-call-ui__controls {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 18px;
  position: relative;
  z-index: 2;
}
.tg-call-ctrl {
  width: 58px;
  min-width: 58px;
  height: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  place-content: center;
  gap: 0;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  transition: transform .22s cubic-bezier(.22,1,.36,1), background .2s ease, filter .2s ease, box-shadow .2s ease;
}
.tg-call-ctrl svg { width: 22px; height: 22px; }
.tg-call-ctrl__lab {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  font: 600 10px/1 Onest, system-ui, sans-serif;
  color: rgba(255,255,255,.62);
  white-space: nowrap;
  pointer-events: none;
}
.tg-call-ctrl:hover { background: rgba(255,255,255,.2); transform: translateY(-2px) scale(1.04); }
.tg-call-ctrl:active { transform: scale(.94); }
.tg-call-ctrl[aria-pressed="true"] {
  background: rgba(255,255,255,.28);
  box-shadow: 0 0 0 2px rgba(147,197,253,.35);
}
.tg-call-ui--muted [data-tg-call-mute],
.tg-call-ui--spk-off [data-tg-call-speaker],
.tg-call-ui--cam-off [data-tg-call-cam] {
  background: rgba(248,113,113,.28);
  box-shadow: 0 0 0 2px rgba(248,113,113,.35);
}
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ctrl--bump {
    animation: tgCallCtrlBump .3s cubic-bezier(.22,1,.36,1);
  }
}
@keyframes tgCallCtrlBump {
  0% { transform: scale(1); }
  45% { transform: scale(.88); }
  100% { transform: scale(1); }
}
.tg-call-ctrl--hang {
  background: #dc2626;
  width: 68px;
  min-width: 68px;
  height: 68px;
  min-height: 68px;
  box-shadow: 0 14px 32px -10px rgba(220,38,38,.65);
}
.tg-call-ctrl--hang:hover { filter: brightness(1.08); transform: translateY(-2px) scale(1.05); }
.tg-call-ctrl[hidden] { display: none !important; }

/* TECH_MSG_06 · incoming accept / reject row */
.tg-call-ui__incoming[hidden] { display: none !important; }
.tg-call-ui__incoming {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 8px 16px 28px;
  z-index: 2;
}
.tg-call-ctrl--accept {
  background: #16a34a;
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  box-shadow: 0 14px 32px -10px rgba(22,163,74,.65);
}
.tg-call-ctrl--accept:hover { filter: brightness(1.08); transform: translateY(-2px) scale(1.05); }
.tg-call-ui[data-state="incoming"] .tg-call-ui__controls { display: none !important; }
.tg-call-ui[data-state="incoming"] .tg-call-ui__min { display: none !important; }

/* PiP minimized call bar */
.tg-call-ui__pip[hidden] { display: none !important; }
.tg-call-ui__pip {
  display: none;
  align-items: center;
  gap: 10px;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 5;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(15,23,42,.92);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.tg-call-ui--pip {
  background: transparent !important;
  padding: 0 !important;
  pointer-events: none;
}
.tg-call-ui--pip .tg-call-ui__stage,
.tg-call-ui--pip .tg-call-ui__controls,
.tg-call-ui--pip .tg-call-ui__min {
  display: none !important;
}
.tg-call-ui--pip .tg-call-ui__pip {
  display: flex;
  pointer-events: auto;
}
.tg-call-ui__pip-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 800 14px/1 Unbounded, system-ui, sans-serif;
  background: linear-gradient(145deg, #1d4ed8, #38bdf8);
  flex: none;
}
.tg-call-ui__pip-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tg-call-ui__pip-meta b {
  font: 700 13px/1.2 Onest, system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-call-ui__pip-meta i {
  font: 500 12px/1.2 Onest, system-ui, sans-serif;
  color: #93c5fd;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.tg-call-ui__pip-exp,
.tg-call-ui__pip-hang {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.tg-call-ui__pip-exp { background: rgba(255,255,255,.12); }
.tg-call-ui__pip-hang { background: #dc2626; }
.tg-call-ui__pip-exp svg,
.tg-call-ui__pip-hang svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .tg-call-ui--pip .tg-call-ui__pip {
    animation: tgCallPipIn .34s cubic-bezier(.22,1,.36,1) both;
  }
}
@keyframes tgCallPipIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ── Voice messages (animated waveform bubbles) ───────────────────────────── */
.tg-voice-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(220px, 68vw);
  max-width: 280px;
  padding: 4px 2px;
}
.tg-voice-msg__play {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--tg-cobalt);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.vd-msg.vd-me .tg-voice-msg__play,
.tg-msg.me .tg-voice-msg__play {
  background: rgba(255,255,255,.22);
}
.tg-voice-msg__play svg { width: 18px; height: 18px; }
.tg-voice-msg__wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  flex: 1;
  min-width: 0;
}
.tg-voice-msg__wave i {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: .55;
  height: 8px;
  display: block;
}
.tg-voice-msg.is-playing .tg-voice-msg__wave i {
  opacity: .95;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-voice-msg.is-playing .tg-voice-msg__wave i {
    animation: tgWave 1s ease-in-out infinite;
  }
  .tg-voice-msg.is-playing .tg-voice-msg__wave i:nth-child(2n) { animation-delay: .12s; }
  .tg-voice-msg.is-playing .tg-voice-msg__wave i:nth-child(3n) { animation-delay: .24s; }
  .tg-voice-msg.is-playing .tg-voice-msg__wave i:nth-child(4n) { animation-delay: .36s; }
}
@keyframes tgWave {
  0%, 100% { height: 7px; }
  50% { height: 24px; }
}
.tg-voice-msg__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 42px;
  flex: none;
  font: 600 11px/1.2 Onest, system-ui, sans-serif;
  opacity: .85;
}
.tg-voice-msg__dur { font-variant-numeric: tabular-nums; }

/* Composer mic always present for voice notes */
.tg-comp .tg-mic,
.composer .cbtns .tg-mic {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.tg-comp .tg-mic:hover,
.composer .cbtns .tg-mic:hover {
  background: #eff6ff;
  color: var(--tg-cobalt);
}
.tg-comp .tg-mic.vmv-on,
.composer .cbtns .tg-mic.vmv-on {
  color: #dc2626;
  background: #fef2f2;
}

/* Filter / thread / onboard empty — MSG_SWARM_12 visual×1e7 */
.tg-filter-empty,
.tg-thread-empty,
.tg-onboard.vy-messenger-start,
#vyMessengerStart.tg-onboard,
body[data-page="messenger"] .dm-empty,
body[data-page="messenger"] .vd-dm-empty {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.tg-filter-empty::before,
.tg-thread-empty::before,
.tg-onboard.vy-messenger-start::before,
#vyMessengerStart.tg-onboard::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 70% at 18% 20%, rgba(29, 78, 216, 0.16), transparent 70%),
    radial-gradient(38% 60% at 88% 8%, rgba(14, 165, 233, 0.14), transparent 68%),
    radial-gradient(50% 80% at 55% 90%, rgba(34, 189, 145, 0.08), transparent 72%);
}
.tg-filter-empty > *,
.tg-thread-empty > *,
.tg-onboard.vy-messenger-start > *,
#vyMessengerStart.tg-onboard > * {
  position: relative;
  z-index: 1;
}
.tg-empty-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #1d4ed8 0%, #0ea5e9 58%, #22bd91 100%);
  box-shadow:
    0 14px 28px rgba(29, 78, 216, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}
.tg-empty-mark svg {
  width: 26px;
  height: 26px;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-empty-mark {
    animation: tgEmptyMarkFloat 4.8s ease-in-out infinite;
  }
  .tg-filter-empty,
  .tg-thread-empty,
  .tg-onboard.vy-messenger-start {
    animation: tgEmptyRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .tg-filter-empty__cta,
  .tg-thread-empty__cta,
  .tg-onboard .tg-onboard__primary,
  body[data-page="messenger"] .dm-empty-act {
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
  }
  .tg-filter-empty__cta:hover,
  .tg-thread-empty__cta:hover,
  .tg-onboard .tg-onboard__primary:hover,
  body[data-page="messenger"] .dm-empty-act:hover {
    transform: translateY(-1px);
  }
}
@keyframes tgEmptyMarkFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes tgEmptyRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-empty-mark,
  .tg-filter-empty,
  .tg-thread-empty,
  .tg-onboard.vy-messenger-start {
    animation: none !important;
  }
}

.tg-filter-empty {
  margin: 20px 14px;
  padding: 26px 18px 22px;
  text-align: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), #f8fafc 70%);
  border: 1px solid color-mix(in srgb, var(--tg-cobalt) 18%, var(--tg-line));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  color: #475569;
}
.tg-filter-empty strong {
  display: block;
  color: #0f172a;
  font: 750 15px/1.3 Unbounded, Onest, system-ui, sans-serif;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.tg-filter-empty p {
  margin: 0 0 14px;
  font: 400 13px/1.5 Onest, system-ui, sans-serif;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}
.tg-filter-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.tg-filter-empty__cta,
.tg-thread-empty__cta,
.tg-onboard .tg-onboard__primary,
.tg-story-viewer__cta:not([hidden]),
.tg-call-ui__login:not([hidden]),
body[data-page="messenger"] .dm-empty-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 132px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #fff !important;
  font: 700 13.5px/1 Onest, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.22);
}
.tg-filter-empty__cta--ghost {
  background: #fff !important;
  color: #1e40af !important;
  border: 1px solid #bfdbfe !important;
  box-shadow: none;
}
.tg-story-viewer__cta[hidden],
.tg-call-ui__login[hidden] {
  display: none !important;
}
.tg-filter-empty__cta:hover,
.tg-thread-empty__cta:hover,
.tg-onboard .tg-onboard__primary:hover,
body[data-page="messenger"] .dm-empty-act:hover {
  filter: brightness(1.06);
}
.tg-filter-empty__cta:focus-visible,
.tg-thread-empty__cta:focus-visible,
.tg-onboard .tg-onboard__primary:focus-visible,
body[data-page="messenger"] .dm-empty-act:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.28);
  outline-offset: 2px;
}

/* ANYUSER onboarding card — always vivid for guests */
.tg-onboard.vy-messenger-start,
#vyMessengerStart.tg-onboard {
  margin: 10px 12px 10px;
  padding: 16px 16px 14px;
  border: 1px solid color-mix(in srgb, var(--tg-cobalt) 32%, var(--tg-line));
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.96) 0%, #fff 72%);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.08);
  flex: none;
}
body[data-tg-user="guest"] .tg-onboard.vy-messenger-start,
body[data-tg-user="guest"] #vyMessengerStart.tg-onboard {
  display: block !important;
}
.tg-onboard .vy-ms-kicker {
  display: block;
  color: var(--tg-cobalt);
  font: 800 11px/1.2 Onest, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tg-onboard strong {
  display: block;
  color: #0f172a;
  font: 750 15px/1.25 Unbounded, Onest, system-ui, sans-serif;
  letter-spacing: -0.02em;
}
.tg-onboard p {
  margin: 6px 0 12px;
  color: #64748b;
  font: 400 13px/1.5 Onest, system-ui, sans-serif;
}
.tg-onboard .vy-ms-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tg-onboard .vy-ms-actions a:not(.tg-onboard__primary),
.tg-onboard .vy-ms-actions button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--tg-line);
  background: #fff;
  color: #334155;
  font: 700 12.5px/1 Onest, system-ui, sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.tg-onboard .vy-ms-actions button {
  background: var(--tg-cobalt);
  border-color: var(--tg-cobalt);
  color: #fff;
}

/* Thread empty */
.tg-thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  margin: auto;
  padding: 52px 22px;
  color: #64748b;
  max-width: 38ch;
  min-height: 220px;
  border-radius: 22px;
}
.tg-thread-empty strong {
  font: 750 16px/1.25 Unbounded, Onest, system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.tg-thread-empty p {
  margin: 0;
  font: 400 13.5px/1.55 Onest, system-ui, sans-serif;
}
.tg-thread-empty__cta { margin-top: 10px; }

body[data-page="messenger"] .dm-empty,
body[data-page="messenger"] .vd-dm-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 32px 18px !important;
  text-align: center !important;
  border-radius: 18px;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(29, 78, 216, 0.08), transparent 70%),
    #f8fafc;
  border: 1px solid color-mix(in srgb, var(--tg-cobalt) 12%, var(--tg-line));
  margin: 12px !important;
}
body[data-page="messenger"] .dm-empty-t,
body[data-page="messenger"] .vd-dm-empty .dm-empty-t {
  font: 750 15px/1.3 Unbounded, Onest, system-ui, sans-serif !important;
  letter-spacing: -0.02em;
  color: #0f172a !important;
}
body[data-page="messenger"] .dm-empty-s,
body[data-page="messenger"] .vd-dm-empty .dm-empty-s {
  font: 400 13px/1.5 Onest, system-ui, sans-serif !important;
  color: #64748b !important;
  max-width: 34ch;
}

.tg-story-viewer__cta {
  margin-top: 16px;
}
.tg-call-ui__login {
  margin-top: 10px;
  background: #fff;
  color: #1d4ed8 !important;
}
body[data-page="messenger"] .vy-msg-account--guest {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.22);
}

/* Mobile density: stories + filters eat vertical space carefully */
@media (max-width: 768px) {
  body[data-page="messenger"] .cl-scroll {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* No junk tabbar — do not reserve phantom bottom chrome */
  body[data-page="messenger"] .cl-scroll {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body[data-page="messenger"] .composer,
  body[data-page="messenger"] .tg-comp {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .tg-call-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

@media (min-width: 1100px) {
  body[data-page="messenger"] .app > .chatlist {
    width: min(360px, 34vw) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tg-story-viewer__bar > i,
  .tg-call-ui__av::before,
  .tg-call-ui__av::after,
  .tg-call-ui__glow,
  .tg-call-ui__wave i,
  .tg-call-ui__hint--flash,
  .tg-call-ctrl--bump,
  .tg-call-btn--tap,
  .tg-call-ui:not([hidden]),
  .tg-call-ui--leaving,
  .tg-call-ui--pip .tg-call-ui__pip,
  .tg-voice-msg__wave i,
  .tg-filters--pulse,
  .tg-gc-panel--in,
  .tg-gc-row--out,
  .tg-gc-row--new {
    animation: none !important;
  }
  .tg-call-ctrl:hover,
  .tg-call-btn:hover {
    transform: none !important;
  }
}

/* ── MSG_SWARM_06 · Groups / Channels / Invites ───────────────────────────── */
.tg-filters--pulse .tg-filter[aria-selected="true"] {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tg-cobalt) 22%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .tg-filters--pulse .tg-filter[aria-selected="true"] {
    animation: tgFilterPulse .45s cubic-bezier(.22,1,.36,1);
  }
}
@keyframes tgFilterPulse {
  from { transform: scale(.96); }
  to { transform: none; }
}

.tg-filter {
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
  min-height: 36px;
}
.tg-filter:active { transform: scale(.97); }

.tg-filter-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.tg-filter-empty__cta--ghost {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid var(--tg-line) !important;
}

.conv.tg-gc-row {
  position: relative;
}
.conv.tg-gc-row.is-active {
  background: color-mix(in srgb, var(--tg-cobalt) 8%, #fff);
}
.conv.tg-gc-row .tg-gc-av {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tg-cobalt) 18%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .conv.tg-gc-row--new {
    animation: tgGcIn .42s cubic-bezier(.22,1,.36,1) both;
  }
  .conv.tg-gc-row--out {
    animation: tgGcOut .28s ease forwards;
  }
}
@keyframes tgGcIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes tgGcOut {
  to { opacity: 0; transform: translateX(12px); height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
}

.tg-invite-row-ctas {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  flex: none;
  vertical-align: middle;
}
.tg-invite-mini {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 0;
  background: var(--tg-cobalt);
  color: #fff;
  font: 700 11px/1 Onest, system-ui, sans-serif;
  cursor: pointer;
}
.tg-invite-mini--ghost {
  background: #fff;
  color: #475569;
  border: 1px solid var(--tg-line);
}
.tg-invite-mini:hover { filter: brightness(1.06); }

.tg-channel-bar {
  flex-wrap: wrap;
  gap: 6px 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.tg-channel-bar__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 140px;
}
.tg-channel-bar__dot { color: #94a3b8; }
.tg-channel-bar__access {
  color: #64748b;
  font: 600 12px/1.3 Onest, system-ui, sans-serif;
}
.tg-channel-bar__view {
  color: var(--tg-cobalt);
  font: 650 12px/1.3 Onest, system-ui, sans-serif;
}
.tg-channel-chip {
  min-height: 34px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.tg-channel-chip:active { transform: scale(.97); }

.tg-gc-panel {
  margin: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}
@media (prefers-reduced-motion: no-preference) {
  .tg-gc-panel--in {
    animation: tgGcIn .38s cubic-bezier(.22,1,.36,1) both;
  }
}

.tg-post-card {
  border: 1px solid var(--tg-line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.tg-post-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tg-post-card__av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1d4ed8, #38bdf8);
  color: #fff;
  font: 800 13px/1 Unbounded, system-ui, sans-serif;
  flex: none;
}
.tg-post-card header strong {
  display: block;
  font: 700 13.5px/1.25 Onest, system-ui, sans-serif;
  color: #0f172a;
}
.tg-post-card header small {
  color: #64748b;
  font: 500 11.5px/1.3 Onest, system-ui, sans-serif;
}
.tg-post-card > p {
  margin: 0 0 12px;
  color: #334155;
  font: 400 14px/1.5 Onest, system-ui, sans-serif;
}
.tg-post-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tg-post-act {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--tg-line);
  background: #f8fafc;
  color: #334155;
  font: 650 12px/1 Onest, system-ui, sans-serif;
  cursor: pointer;
}
.tg-post-act.is-on,
.tg-post-act:hover {
  border-color: color-mix(in srgb, var(--tg-cobalt) 40%, var(--tg-line));
  color: var(--tg-cobalt);
  background: #eff6ff;
}

.tg-comment-list {
  display: grid;
  gap: 8px;
}
.tg-comment {
  border: 1px solid var(--tg-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.tg-comment strong {
  display: block;
  font: 700 12.5px/1.3 Onest, system-ui, sans-serif;
  color: #0f172a;
  margin-bottom: 4px;
}
.tg-comment p {
  margin: 0;
  color: #475569;
  font: 400 13px/1.45 Onest, system-ui, sans-serif;
}

.tg-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.tg-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--tg-line);
  background: #fff;
}
.tg-member__av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--tg-cobalt);
  font: 800 12px/1 Onest, system-ui, sans-serif;
  flex: none;
}
.tg-member__name {
  flex: 1;
  min-width: 0;
  font: 650 13px/1.3 Onest, system-ui, sans-serif;
  color: #0f172a;
}
.tg-member__msg {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--tg-line);
  background: #f8fafc;
  color: #334155;
  font: 650 11.5px/1 Onest, system-ui, sans-serif;
  cursor: pointer;
  flex: none;
}
.tg-member__msg:hover {
  border-color: var(--tg-cobalt);
  color: var(--tg-cobalt);
}

.tg-gc-info {
  border: 1px solid var(--tg-line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}
.tg-gc-info strong {
  display: block;
  font: 750 16px/1.25 Unbounded, system-ui, sans-serif;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.tg-gc-info p {
  margin: 0 0 8px;
  color: #475569;
  font: 400 13.5px/1.45 Onest, system-ui, sans-serif;
}
.tg-gc-info__meta { color: #64748b !important; font-size: 12.5px !important; }
.tg-gc-info__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tg-invite-panel {
  border: 1px solid color-mix(in srgb, #c2410c 28%, var(--tg-line));
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 55%);
}
.tg-invite-panel strong {
  display: block;
  font: 750 15px/1.3 Unbounded, system-ui, sans-serif;
  color: #9a3412;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.tg-invite-panel > p {
  margin: 0 0 12px;
  color: #9a3412;
  font: 500 13px/1.4 Onest, system-ui, sans-serif;
}
.tg-invite-panel__link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed color-mix(in srgb, #c2410c 35%, var(--tg-line));
  color: #1d4ed8;
  font: 650 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-bottom: 12px;
  user-select: all;
}
.tg-invite-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tg-invite-panel__hint {
  margin: 12px 0 0 !important;
  color: #94a3b8 !important;
  font: 400 11.5px/1.4 Onest, system-ui, sans-serif !important;
}

.tg-sheet[hidden] { display: none !important; }
.tg-sheet {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: end center;
  padding: 0;
}
.tg-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}
.tg-sheet__card {
  position: relative;
  width: min(440px, 100%);
  max-height: min(86vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
}
@media (min-width: 720px) {
  .tg-sheet { place-items: center; }
  .tg-sheet__card {
    border-radius: 18px;
    padding-bottom: 16px;
  }
}
.tg-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tg-sheet__head strong {
  font: 750 16px/1.2 Unbounded, system-ui, sans-serif;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.tg-sheet__x {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 22px;
  cursor: pointer;
}
.tg-sheet__label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #64748b;
  font: 650 12px/1.3 Onest, system-ui, sans-serif;
}
.tg-sheet__label input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--tg-line);
  background: #f8fafc;
  color: #0f172a;
  font: 500 14px/1.3 Onest, system-ui, sans-serif;
}
.tg-sheet__access {
  border: 1px solid var(--tg-line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}
.tg-sheet__access legend {
  padding: 0 4px;
  color: #64748b;
  font: 650 11.5px/1 Onest, system-ui, sans-serif;
}
.tg-sheet__access label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: #334155;
  font: 600 13px/1.3 Onest, system-ui, sans-serif;
  cursor: pointer;
}
.tg-sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-page="messenger"][data-tg-gc="invite"] .tg-channel-bar {
  border-bottom-color: color-mix(in srgb, #c2410c 28%, var(--tg-line));
}
body[data-page="messenger"][data-tg-gc="group"] .tg-channel-bar__access {
  color: #047857;
}

@media (max-width: 768px) {
  .tg-channel-chip,
  .tg-invite-mini,
  .tg-post-act,
  .tg-member__msg,
  .tg-filter-empty__cta,
  .tg-thread-empty__cta {
    min-height: 44px;
  }
  .tg-invite-row-ctas {
    display: flex;
    width: 100%;
    margin: 6px 0 0;
  }
  .tg-invite-mini { flex: 1; justify-content: center; }
}
