/* ─────────── Dark Telegram-supergroup phone-frame mock ─────────── */
.tgsg { font-family: var(--hf-font-body); }

/* tab switcher (light, sits outside the dark pane) */
.tgsg-tabs {
  display: flex; gap: 6px;
  background: var(--hf-surface-2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
  align-self: flex-start;
}
.tgsg-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-family: var(--hf-font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--hf-ink-3);
  cursor: pointer;
  white-space: nowrap;
}
.tgsg-sm .tgsg-tab { font-size: 12px; padding: 7px 10px; gap: 4px; }
.tgsg-tab:hover { color: var(--hf-ink-2); }
.tgsg-tab.active {
  background: white;
  color: var(--hf-ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15,20,25,0.08), 0 0 0 1px var(--hf-line);
}
.tgsg-tab-c {
  background: var(--hf-tg);
  color: white;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-family: var(--hf-font-mono);
  font-weight: 700;
}
.tgsg-tab-c.muted { background: var(--hf-ink-4); }

/* ─── phone-like frame ─── */
.tgsg-frame {
  background: #17212B;
  border-radius: 22px;
  border: 6px solid #0f1419;
  box-shadow: var(--hf-shadow-lg);
  overflow: hidden;
  height: 640px;
  display: flex; flex-direction: column;
  position: relative;
}
.tgsg-sm .tgsg-frame { height: 560px; border-width: 5px; border-radius: 20px; }

.tgsg-frame-status {
  background: #17212B;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px 4px;
  display: flex; justify-content: space-between;
}
.tgsg-frame-status-icons { letter-spacing: 1px; font-size: 8px; }

.tgsg-frame-titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #232E3C;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}
.tgsg-frame-back {
  color: #3390EC;
  font-size: 24px;
  line-height: 0.6;
  font-weight: 300;
  flex-shrink: 0;
}
.tgsg-frame-title-ava {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3390EC, #1E78D2);
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tgsg-frame-titletxt { flex: 1; }
.tgsg-frame-title {
  font-size: 14px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}
.tgsg-frame-sub {
  font-size: 11px;
  color: #6F7E8C;
  margin-top: 2px;
}

/* ─── content area ─── */
.tgsg-frame-content {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  background: #17212B;
}
.tgsg-frame.with-chat .tgsg-frame-content {
  grid-template-columns: 320px 1fr;
}
.tgsg-sm.tgsg-frame .tgsg-frame-content {
  grid-template-columns: 1fr;
}

/* on mobile when chat shown, hide list */
.tgsg-sm .tgsg-frame.with-chat .tgsg-list { display: none; }

.tgsg-list {
  overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.tgsg-list.no-scroll { overflow-y: hidden; }
.tgsg-list::-webkit-scrollbar { width: 6px; }
.tgsg-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* row */
.tgsg-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  column-gap: 12px;
  padding: 10px 14px;
  align-items: flex-start;
  cursor: default;
}
.tgsg-row + .tgsg-row { border-top: 1px solid rgba(255,255,255,0.04); }
.tgsg-sm .tgsg-row { grid-template-columns: 32px 1fr auto; column-gap: 10px; padding: 9px 12px; }
.tgsg-row.active { background: rgba(51,144,236,0.12); cursor: pointer; }

/* avatar */
.tgsg-ava {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.tgsg-ava.sm { width: 28px; height: 28px; font-size: 13px; }
.tgsg-sm .tgsg-ava { width: 32px; height: 32px; font-size: 13.5px; }
.tgsg-ava.hash {
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 22px;
  font-weight: 400;
}

/* body */
.tgsg-body { min-width: 0; }
.tgsg-line1 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.tgsg-title {
  font-size: 14px;
  font-weight: 600;
  color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.tgsg-sm .tgsg-title { font-size: 13px; }
.tgsg-username { color: rgba(255,255,255,0.5); font-weight: 400; }
.tgsg-inline   { color: rgba(255,255,255,0.55); font-weight: 400; }
.tgsg-date { color: rgba(255,255,255,0.45); font-size: 12px; flex-shrink: 0; }
.tgsg-sm .tgsg-date { font-size: 11px; }

.tgsg-line2 {
  margin-top: 3px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tgsg-sm .tgsg-line2 { font-size: 11.5px; }
.tgsg-author { color: rgba(255,255,255,0.8); font-weight: 500; }
.tgsg-author-sep { color: rgba(255,255,255,0.5); }

/* right side */
.tgsg-right { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; flex-shrink: 0; }
.tgsg-sm .tgsg-right { margin-top: 19px; }
.tgsg-badge {
  background: var(--hf-tg);
  color: white;
  border-radius: 999px;
  min-width: 22px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--hf-font-mono);
  text-align: center;
}
.tgsg-pin { font-size: 11px; opacity: 0.5; }
.tgsg-mention {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--hf-tg);
  color: var(--hf-tg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.tgsg-row.general { background: rgba(42,171,238,0.05); }

/* ─── channel badge over avatar (TG/VK/Max) ─── */
.tgsg-ava { position: relative; }
.tgsg-ch {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #17212B;
  flex-shrink: 0;
}
.tgsg-sm .tgsg-ch { width: 16px; height: 16px; }
.tgsg-ch.tg  { background: #2aabee; }
.tgsg-ch.vk  { background: #0077FF; }
.tgsg-ch.max { background: #1ED660; color: white; font-family: var(--hf-font-display); font-size: 10px; font-weight: 800; }
.tgsg-sm .tgsg-ch.max { font-size: 9px; }

/* ─── chat panel ─── */
.tgsg-chat {
  display: flex; flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(51,144,236,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(216,51,132,0.04) 0%, transparent 50%),
    #0E1621;
}
.tgsg-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #17212B;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}
.tgsg-chat-back {
  background: transparent;
  border: none;
  color: #3390EC;
  font-size: 22px;
  cursor: pointer;
  font-weight: 300;
  padding: 0 4px;
  line-height: 0.6;
}
.tgsg-chat-head-name {
  color: white;
  font-size: 14px;
  font-weight: 600;
}
.tgsg-chat-head-meta {
  color: #6F7E8C;
  font-size: 11px;
  margin-top: 2px;
}
.tgsg-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.tgsg-msg {
  max-width: 80%;
  padding: 7px 11px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.35;
  position: relative;
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
}
.tgsg-msg.client { align-self: flex-end; background: #3390EC; color: white; border-bottom-right-radius: 4px; }
.tgsg-msg.ai     { align-self: flex-start; background: #182533; color: white; border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }
.tgsg-msg-time {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  font-family: var(--hf-font-mono);
}
.tgsg-msg.client .tgsg-msg-time { color: rgba(255,255,255,0.75); }

/* product card message */
.tgsg-card-msg {
  align-self: flex-start;
  display: flex; gap: 10px;
  background: #182533;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px;
  max-width: 80%;
}
.tgsg-card-img {
  width: 54px; height: 54px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d63384, #6c5ce7);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.tgsg-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tgsg-card-name { color: white; font-size: 13px; font-weight: 600; }
.tgsg-card-desc { color: rgba(255,255,255,0.5); font-size: 11.5px; }
.tgsg-card-price { color: #4ade80; font-size: 13px; font-weight: 700; font-family: var(--hf-font-mono); margin: 4px 0 6px; }
.tgsg-card-buy {
  background: #3390EC;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--hf-font-body);
  align-self: flex-start;
}

.tgsg-chat-input {
  padding: 8px 14px;
  background: #17212B;
  border-top: 1px solid rgba(0,0,0,0.25);
}
.tgsg-chat-input-hint {
  font-size: 11px;
  color: #6F7E8C;
  font-family: var(--hf-font-mono);
}

/* foot */
.tgsg-foot {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--hf-surface-2);
  border: 1px solid var(--hf-line);
  border-radius: 10px;
  font-family: var(--hf-font-mono);
  font-size: 11.5px;
  color: var(--hf-ink-3);
  display: flex; gap: 8px; align-items: center;
}
.tgsg-sm .tgsg-foot { font-size: 11px; padding: 9px 12px; }
.tgsg-foot-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: #1F8F3D;
  animation: tgsg-pulse 1.6s ease-in-out infinite;
}
@keyframes tgsg-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,143,61,0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(31,143,61,0); }
}
