/* Heligram — Dark Obsidian Cryptographic Luxury (Telegram Desktop x Linear x Signal x Helius) */
:root {
  --bg-void: #050505;
  --bg-s1: #0A0A0D;
  --bg-s2: #111115;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-hot: rgba(255, 79, 23, 0.48);
  --accent: #FF4F17;
  --accent-hover: #FF6633;
  --accent-soft: rgba(255, 79, 23, 0.13);
  --text: #FFFFFF;
  --muted: #8A8A8A;
  --dim: #57575C;
  --win: #22C55E;
  --loss: #EF4444;
  --rail-w: 292px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-void);
  color: var(--text);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }
.win { color: var(--win); }
.loss { color: var(--loss); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.full-w { width: 100%; }

button, input { font-family: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), background 0.16s, border-color 0.16s, color 0.16s;
}
button:not(:disabled):active { transform: scale(0.965); }

/* App Full-Viewport Split Shell */
.hg-app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* LEFT SIDEBAR RAIL */
.hg-sidebar {
  background: var(--bg-s1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  z-index: 50;
}

.rail-header {
  height: 60px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.brand-tag { font-size: 9px; letter-spacing: 0.12em; color: var(--accent); margin-top: 2px; }
.rail-header-actions { display: flex; gap: 6px; }

.rail-search-wrap { padding: 10px 12px 6px; flex-shrink: 0; }
.cmd-trigger {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.cmd-trigger:hover { border-color: var(--border-hot); color: var(--text); }
.cmd-trigger kbd {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-void);
}

.folder-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.folder-tab {
  height: 26px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 3px;
  border: 1px solid transparent;
}
.folder-tab:hover { color: var(--text); background: var(--bg-glass); }
.folder-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border-hot);
}

.room-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-item {
  width: 100%;
  padding: 10px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.room-item:hover { background: var(--bg-glass); border-color: var(--border); }
.room-item.active {
  background: var(--accent-soft);
  border-color: var(--border-hot);
}

.room-item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.room-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 2px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  color: var(--muted);
  flex-shrink: 0;
}
.room-item-prev { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.self-card {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.self-card:hover { border-color: var(--border-hot); }
.self-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--border-hot);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.self-meta { flex: 1; min-width: 0; }
.self-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.self-sub { font-size: 10px; }

.rail-foot-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  padding: 0 2px;
}
.foot-link { color: var(--muted); text-decoration: none; }
.foot-link:hover { color: var(--accent); }

/* Spotlight Hover Aura */
.spotlight-card { position: relative; overflow: hidden; --mx: 50%; --my: 50%; }
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(200px circle at var(--mx) var(--my), rgba(255, 79, 23, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.spotlight-card:hover::before { opacity: 1; }

/* MAIN CHAT COLUMN */
.hg-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  background: var(--bg-void);
}

.hg-topbar {
  height: 60px;
  padding: 0 18px;
  background: rgba(10, 10, 13, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-head-info { min-width: 0; }
.room-title-row { display: flex; align-items: center; gap: 8px; }
.room-title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-sub-row { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 0.08em; margin-top: 2px; }

.holder-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--win);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: hgPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes hgPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Buttons & Pills */
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  flex-shrink: 0;
}
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--border-hot); color: var(--text); }
.icon-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.stealth-btn {
  height: 34px;
  padding: 0 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.stealth-btn:hover { border-color: var(--border-hot); color: var(--text); }
.hg-app.stealth-mode .stealth-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.vault-pill {
  height: 34px;
  padding: 0 11px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
}
.vault-pill:hover { border-color: var(--border-hot); }
.vp-sep { color: var(--dim); }

.btn-primary {
  height: 34px;
  padding: 0 14px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 20px rgba(255, 79, 23, 0.28); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.lg { height: 42px; font-size: 12px; }

.btn-secondary {
  height: 34px;
  padding: 0 12px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--border-hot); }

.chip-btn {
  height: 30px;
  padding: 0 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.chip-btn:hover { color: var(--text); border-color: var(--border-hot); }
.chip-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Pinned Banner */
.pinned-bar {
  padding: 8px 18px;
  background: rgba(17, 17, 21, 0.94);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pin-accent { width: 2px; height: 28px; background: var(--accent); }
.pin-content { flex: 1; min-width: 0; }
.pin-text { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* CHAT STAGE */
.chat-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.radar-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.radar-watermark svg { width: 420px; height: 420px; animation: slowSpin 90s linear infinite; }
@keyframes slowSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.handshake-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hs-box {
  padding: 12px 18px;
  background: var(--bg-s2);
  border: 1px solid var(--border-hot);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.messages-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

.messages-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-chat {
  margin: 12vh auto;
  max-width: 420px;
  text-align: center;
  padding: 26px;
  background: rgba(17, 17, 21, 0.85);
  border: 1px solid var(--border);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-chat h3 { margin: 0; font-size: 16px; }
.empty-chat p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* MESSAGE CARD & SCAN-BEAM DECRYPTION */
.msg-card {
  position: relative;
  background: rgba(17, 17, 21, 0.9);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.18s, background 0.18s, opacity 0.4s, filter 0.4s;
}
.msg-card:hover { border-color: var(--border-strong); }
.msg-card.is-mine { border-left: 2px solid var(--accent); }
.msg-card.highlight-jump { border-color: var(--accent); box-shadow: 0 0 22px rgba(255, 79, 23, 0.25); }

/* 1px Glowing Scan-Beam during decrypt */
.msg-card.is-decrypting::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: scanBeam 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}
@keyframes scanBeam { from { left: 0%; opacity: 1; } to { left: 100%; opacity: 0; } }

/* Burn-After-Reading Dissolution */
.msg-card.is-burning {
  opacity: 0;
  filter: blur(4px);
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* Keyword Trigger Animations */
.msg-card.trig-lfg { animation: lfgShockwave 0.7s ease; }
@keyframes lfgShockwave {
  0% { box-shadow: 0 0 0 0 rgba(255, 79, 23, 0.6); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 18px rgba(255, 79, 23, 0); }
}

.msg-card.trig-rip { animation: ripGlitch 0.42s linear; }
@keyframes ripGlitch {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px); border-color: var(--loss); }
  40% { transform: translate(3px, -1px); border-color: var(--accent); }
  60% { transform: translate(-2px, 0); }
  80% { transform: translate(2px, 1px); }
}

.wave-hand-pop {
  position: absolute;
  right: 14px;
  top: -12px;
  width: 36px;
  height: 36px;
  pointer-events: none;
  transform-origin: 65% 80%;
  animation: handWave 1.1s ease-in-out forwards;
}
@keyframes handWave {
  0% { opacity: 0; transform: scale(0.5) rotate(-18deg); }
  15% { opacity: 1; transform: scale(1) rotate(14deg); }
  35% { transform: scale(1) rotate(-14deg); }
  55% { transform: scale(1) rotate(14deg); }
  75% { transform: scale(1) rotate(-10deg); }
  100% { opacity: 0; transform: scale(0.8) translateY(-8px); }
}

.spark-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--accent);
  pointer-events: none;
  animation: sparkFly 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes sparkFly {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msg-sender-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}
.msg-sender-btn:hover { color: var(--accent); }

.msg-time { font-size: 10px; color: var(--dim); }
.burn-badge { font-size: 10px; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 2px; }

.msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.msg-card:hover .msg-actions { opacity: 1; }
.msg-act-btn {
  height: 22px;
  padding: 0 6px;
  font-size: 10px;
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
}
.msg-act-btn:hover { color: var(--text); border-color: var(--border-hot); }

.msg-reply-quote {
  padding: 5px 9px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 2px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.msg-reply-quote:hover { color: var(--text); }

.msg-body {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

/* Stealth Mode: Seal entire chat & reveal ONLY hovered element */
.hg-app.stealth-mode .msg-card .msg-body,
.hg-app.stealth-mode .msg-card .msg-sender-btn,
.hg-app.stealth-mode .vault-pill {
  position: relative;
}
.hg-app.stealth-mode .msg-card:not(:hover) .msg-body,
.hg-app.stealth-mode .msg-card:not(:hover) .msg-sender-btn,
.hg-app.stealth-mode .msg-card:not(:hover) .unfurl-slot,
.hg-app.stealth-mode .vault-pill:not(:hover) {
  filter: blur(6px);
  user-select: none;
}
.hg-app.stealth-mode .msg-card:not(:hover)::before {
  content: '[SEALED · 0x7A4F...E9B2]';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(10, 10, 13, 0.82);
  border-radius: 5px;
  z-index: 4;
  pointer-events: none;
}

/* Encrypted Blur-Until-Hover Image */
.enc-media-wrap {
  position: relative;
  max-width: 300px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 4px;
}
.enc-media-wrap img {
  display: block;
  width: 100%;
  filter: blur(18px);
  transition: filter 0.3s ease;
}
.enc-media-wrap:hover img { filter: blur(0); }
.enc-media-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(5, 5, 5, 0.84);
  border: 1px solid var(--border-hot);
  color: var(--accent);
  pointer-events: none;
}
.enc-media-wrap:hover .enc-media-tag { opacity: 0; }

/* Reactions Bar */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.react-pill {
  height: 24px;
  padding: 0 7px;
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}
.react-pill svg { width: 13px; height: 13px; }
.react-pill:hover, .react-pill.mine { border-color: var(--border-hot); color: var(--text); background: var(--accent-soft); }

/* SMART UNFURL MINI-CARDS */
.unfurl-card {
  margin-top: 6px;
  background: var(--bg-s1);
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.unfurl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.unfurl-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 11px; }
.unfurl-metrics div { display: flex; flex-direction: column; gap: 2px; }
.unfurl-metrics span { font-size: 9px; color: var(--muted); }
.unfurl-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ENCRYPTED RAIN & GIFT CARDS IN CHAT */
.special-card {
  margin-top: 4px;
  padding: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 79, 23, 0.12), rgba(10, 10, 13, 0.96));
  border: 1px solid var(--border-hot);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.special-left { display: flex; align-items: center; gap: 12px; }
.gift-icon-box { width: 52px; height: 52px; flex-shrink: 0; }
.gift-icon-box svg { width: 100%; height: 100%; }
.gift-sealed { filter: blur(6px) saturate(0.5); transition: filter 0.35s; }

/* COMPOSER */
.composer-wrap {
  padding: 8px 18px 14px;
  background: var(--bg-s1);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.typing-strip { min-height: 16px; font-size: 10px; letter-spacing: 0.08em; margin-bottom: 4px; }

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--bg-s2);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
}
.reply-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }

.composer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
}
.composer-box:focus-within { border-color: var(--border-hot); }

.burn-toggle {
  height: 32px;
  padding: 0 8px;
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}
.burn-toggle.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.composer-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
}
.composer-input::placeholder { color: var(--dim); }
.send-btn { height: 34px; padding: 0 16px; }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-s1);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-card.wide { max-width: 660px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.modal-desc { margin: 0; font-size: 12px; line-height: 1.5; }
.modal-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.vtab-pane { display: flex; flex-direction: column; gap: 10px; }
.field-label { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); display: block; margin-bottom: 4px; }

.hg-input {
  width: 100%;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
}
.hg-input:focus { border-color: var(--accent); }
.hg-input.lg { height: 44px; font-size: 16px; font-weight: 600; padding-right: 46px; }
.hg-input.sm { height: 36px; font-size: 12px; }

.input-unit-wrap { position: relative; display: flex; align-items: center; }
.unit-lbl { position: absolute; right: 12px; font-size: 11px; pointer-events: none; }
.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.modal-status { min-height: 16px; font-size: 11px; }

.vault-summary-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.vault-summary-bar div { display: flex; flex-direction: column; gap: 3px; font-size: 10px; }
.vault-summary-bar strong { font-size: 16px; }

.stars-pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.star-pack-btn, .star-pack-card {
  padding: 12px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.star-pack-btn:hover, .star-pack-card:hover { border-color: var(--accent); background: var(--accent-soft); }

.gift-recip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.gifts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gift-tile, .gift-store-card {
  padding: 14px 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.gift-tile:hover, .gift-store-card:hover { border-color: var(--accent); }
.gift-tile svg, .gift-store-card svg, .gs-art svg { width: 46px; height: 46px; }
.gs-name { font-size: 12px; font-weight: 600; }

.wallet-list, .history-list, .leader-list, .cmd-results { display: flex; flex-direction: column; gap: 7px; }
.wallet-option, .wallet-opt, .hist-row, .leader-row, .cmd-row, .cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  width: 100%;
}
.wallet-option:hover, .wallet-opt:hover, .cmd-row:hover, .cmd-item:hover, .leader-row:hover { border-color: var(--accent); }

.profile-gifts-grid, .prof-gifts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.prof-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; background: var(--bg-s2); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 12px; }
.prof-summary div { display: flex; flex-direction: column; gap: 3px; font-size: 10px; }
.prof-summary strong { font-size: 13px; }
.prof-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prof-edit-box { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.prof-gift-item { padding: 10px; background: var(--bg-s2); border: 1px solid var(--border); border-radius: 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.pg-art svg { width: 38px; height: 38px; }

.special-card {
  margin-top: 6px;
  padding: 12px 14px;
  background: var(--bg-s2);
  border: 1px solid var(--border-hot);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gift-card { flex-direction: row; align-items: center; gap: 14px; }
.gift-art svg { width: 52px; height: 52px; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; flex-wrap: wrap; }
.sc-body { font-size: 13px; color: var(--text); }
.empty-stream { padding: 48px 20px; text-align: center; max-width: 440px; margin: 40px auto; background: rgba(17,17,21,0.75); border: 1px solid var(--border); border-radius: 8px; }
.media-cipher-wrap { position: relative; display: inline-block; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); margin-top: 4px; }
.media-blur-img { display: block; max-width: 280px; max-height: 240px; filter: blur(18px); transition: filter 0.25s ease; }
.media-cipher-wrap:hover .media-blur-img { filter: blur(0); }
.media-seal-tag { position: absolute; inset: auto 8px 8px 8px; padding: 3px 6px; background: rgba(5,5,5,0.82); border: 1px solid var(--border-hot); font-size: 9px; text-align: center; color: var(--accent); pointer-events: none; transition: opacity 0.2s; }
.media-cipher-wrap:hover .media-seal-tag { opacity: 0; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.cmd-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-sub-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-pill { white-space: nowrap; }
.unfurl-spark { width: 88px; height: 26px; flex-shrink: 0; }
a.chip-btn { text-decoration: none; display: inline-flex; align-items: center; }
.msg-text, .msg-bubble { overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.messages-scroll { overflow-x: hidden; }

/* Toasts */
.toast-stack { position: fixed; right: 18px; bottom: 72px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 14px;
  background: var(--bg-s2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 11px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
}
.toast.err { border-left-color: var(--loss); }

/* Responsive (390px Mobile Ready) */
.mobile-only { display: none; }
@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  .hg-app { grid-template-columns: 1fr; }
  .hg-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 286px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .hg-app.sidebar-open .hg-sidebar, .hg-sidebar.open { transform: translateX(0); }
  .hg-topbar { padding: 0 10px; gap: 6px; }
  .tb-left, .tb-right { gap: 5px; }
  .vault-pill .vp-sep, .vault-pill .vp-stars, #stealthBtnLabel, #openLeaderboardBtn { display: none; }
  .messages-scroll { padding: 12px; }
  .unfurl-metrics { grid-template-columns: repeat(2, 1fr); }
  .gifts-grid, .stars-pack-grid, .profile-gifts-grid, .prof-gifts-grid { grid-template-columns: repeat(2, 1fr); }
  .composer-wrap { padding: 6px 10px 10px; }
  .send-btn { padding: 0 10px; }
}
@media (max-width: 540px) {
  #openGiftsBtn, #soundToggleBtn, #stealthToggleBtn { display: none; }
  .hg-topbar { padding: 0 8px; gap: 6px; }
  .tb-left { flex: 1; min-width: 0; overflow: hidden; }
  .tb-right { flex-shrink: 0; gap: 5px; }
  .vault-pill { padding: 0 6px; font-size: 10px; height: 30px; }
  .btn-primary { padding: 0 8px; font-size: 10px; height: 30px; letter-spacing: 0.03em; }
  .room-title { font-size: 13px; }
  .room-sub-row { display: none; }
  .icon-btn { width: 30px; height: 30px; }
}


/* ============================================================================
   HELIGRAM UX OVERHAUL — ONBOARDING, AVATARS, TELEGRAM SIDEBAR, PROFILE & WALLPAPERS
   ============================================================================ */

/* Circular Avatar System */
.hg-av {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #121218;
  flex-shrink: 0;
}
.hg-av svg { width: 100%; height: 100%; display: block; }
.hg-av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hg-av-logo { width: 78%; height: 78%; object-fit: contain; display: block; }

/* 1. CINEMATIC 2-STEP ONBOARDING OVERLAY */
.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: radial-gradient(circle at 50% 25%, rgba(255, 79, 23, 0.11), rgba(5, 5, 5, 0.97) 58%);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.onboard-bg-rings {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.9;
}
.onboard-bg-rings svg {
  width: min(860px, 120vw);
  height: min(860px, 120vw);
  animation: obSlowSpin 48s linear infinite;
}
@keyframes obSlowSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.onboard-card {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: rgba(11, 11, 15, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 28px 30px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 79, 23, 0.08);
  z-index: 2;
}
.ob-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.ob-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ob-sub { font-size: 10px; letter-spacing: 0.12em; margin-top: 2px; }
.ob-step-head h2 { margin: 6px 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.ob-step-head p { margin: 0 0 18px; font-size: 13px; }
.ob-step-tag { font-size: 10px; letter-spacing: 0.12em; }

.ob-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ob-mode-card {
  text-align: left;
  padding: 18px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s;
}
.ob-mode-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.22); }
.ob-mode-card.recommended {
  border-color: rgba(255, 79, 23, 0.55);
  background: linear-gradient(180deg, rgba(255, 79, 23, 0.07) 0%, #111115 48%);
}
.ob-mode-card.recommended:hover { border-color: var(--accent); box-shadow: 0 0 32px rgba(255, 79, 23, 0.16); }
.ob-mode-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ob-pill { font-size: 9px; letter-spacing: 0.09em; font-weight: 700; }
.ob-mode-card h3 { margin: 0; font-size: 17px; }
.ob-mode-card > p { margin: 0; font-size: 12px; line-height: 1.45; }
.ob-feat-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #D4D4D8;
}
.ob-feat-list li { display: flex; align-items: center; gap: 7px; }
.ob-feat-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.ob-warn-box {
  padding: 10px 12px;
  background: rgba(255, 79, 23, 0.07);
  border: 1px solid rgba(255, 79, 23, 0.28);
  border-radius: 6px;
  margin: 4px 0 8px;
}
.ob-warn-box p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; color: #C4C4CC; }

.ob-prof-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  align-items: start;
}
.ob-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ob-av-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ob-av-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  padding: 3px;
  background: #08080B;
}
.ob-upload-btn {
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-s2);
  color: var(--text);
  cursor: pointer;
}
.ob-upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.ob-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  width: 100%;
}
.ob-preset-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 2px;
  border: 1.5px solid var(--border);
  background: #0E0E13;
  transition: border-color 0.15s, transform 0.15s;
}
.ob-preset-btn:hover { transform: scale(1.06); border-color: rgba(255, 255, 255, 0.4); }
.ob-preset-btn.selected { border-color: var(--accent); box-shadow: 0 0 12px rgba(255, 79, 23, 0.38); }
.ob-fields-col { display: flex; flex-direction: column; gap: 12px; }
.handle-input-wrap { position: relative; display: flex; align-items: center; }
.handle-at { position: absolute; left: 11px; font-weight: 700; pointer-events: none; }
.handle-input-wrap .hg-input { padding-left: 26px; }

.ob-handshake {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.96);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}
.ob-hs-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 79, 23, 0.2);
  border-top-color: var(--accent);
  animation: obSlowSpin 0.8s linear infinite;
}

/* 2. SIDEBAR LIVE SEARCH, ACTIVE RING STRIP & TELEGRAM-GRADE CHAT ROWS */
.hg-sidebar { width: 312px; }
.hg-app { grid-template-columns: 312px 1fr; }

.live-search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 8px 0 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.live-search-box:focus-within { border-color: var(--border-hot); }
.live-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 11px;
}
.live-search-input::placeholder { color: var(--muted); }
.kbd-btn {
  padding: 2px 6px;
  font-size: 10px;
  color: var(--muted);
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
}
.kbd-btn:hover { color: var(--accent); border-color: var(--border-hot); }

.active-ring-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  scrollbar-width: none;
}
.active-ring-strip::-webkit-scrollbar { display: none; }
.ring-bubble-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 54px;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.ring-av-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  transition: transform 0.15s, border-color 0.15s;
}
.ring-av-wrap.glow { border-color: var(--accent); box-shadow: 0 0 12px rgba(255, 79, 23, 0.3); }
.ring-bubble-btn:hover .ring-av-wrap { transform: scale(1.06); }
.ring-bubble-lbl {
  width: 100%;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.ring-bubble-btn:hover .ring-bubble-lbl { color: var(--text); }

/* Rich Telegram-Grade Chat Row */
.chat-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.chat-row:hover { background: var(--bg-glass); border-color: rgba(255, 255, 255, 0.06); }
.chat-row.active {
  background: rgba(255, 79, 23, 0.1);
  border-color: rgba(255, 79, 23, 0.35);
}
.chat-av-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}
.online-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid #0A0A0D;
}
.online-dot.orange { background: var(--accent); }

.chat-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-row-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.chat-row-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-row-time { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.chat-row-bot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.chat-row-prev {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.unread-pill {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* People / Holders Directory Tab */
.dir-banner {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255, 79, 23, 0.08);
  border: 1px solid rgba(255, 79, 23, 0.25);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #D4D4D8;
}
.dir-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dir-row:hover { border-color: var(--border-hot); }
.dir-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dir-name-line { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.dir-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.dir-badge.holder { background: rgba(255, 79, 23, 0.18); color: var(--accent); border: 1px solid rgba(255, 79, 23, 0.45); }
.dir-badge.wallet { background: rgba(34, 197, 94, 0.14); color: #22C55E; border: 1px solid rgba(34, 197, 94, 0.35); }
.dir-badge.ghost { background: rgba(255, 255, 255, 0.08); color: var(--muted); border: 1px solid var(--border); }
.dir-bio { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bottom-Left User Dock (Zero Clipping) */
.rail-footer {
  padding: 10px 10px 12px;
  border-top: 1px solid var(--border);
  background: #08080B;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.self-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}
.self-av-slot { width: 38px; height: 38px; flex-shrink: 0; }
.self-meta { flex: 1; min-width: 0; }
.self-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.self-sub { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.rail-foot-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  font-size: 10px;
}
.foot-link { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.foot-link:hover { color: var(--accent); }

/* Topbar Room Avatar & Ghost Upgrade Pill */
.tb-room-av { width: 36px; height: 36px; flex-shrink: 0; }
.ghost-upgrade-pill {
  height: 30px;
  padding: 0 10px;
  border-radius: 99px;
  background: rgba(255, 79, 23, 0.14);
  border: 1px solid rgba(255, 79, 23, 0.5);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ghost-upgrade-pill:hover { background: var(--accent); color: #FFFFFF; }

/* 3. ALIVE CRYPTOGRAPHIC CHAT WALLPAPERS */
.chat-stage {
  position: relative;
  background: #050505;
  overflow: hidden;
}
.chat-wallpaper-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}
.chat-ambient-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 35%, rgba(255, 79, 23, 0.065), transparent 70%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(5, 5, 5, 0.84) 100%);
  animation: hgAmbientBreathe 10s ease-in-out infinite alternate;
}
@keyframes hgAmbientBreathe {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

/* Wallpaper 1: Cipher Rings (Default — Rings, Stealth Planes, Locks, Nodes) */
.chat-stage[data-wallpaper="rings"] .chat-wallpaper-layer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none'%3E%3Ccircle cx='34' cy='34' r='16' stroke='rgba(255,79,23,0.065)' stroke-width='1.2' stroke-dasharray='18 5'/%3E%3Cpath d='M110 38l22-9-7 17-6-4 9-9-11 7z' stroke='rgba(255,255,255,0.045)' stroke-width='1'/%3E%3Crect x='26' y='114' width='14' height='11' rx='2' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3Cpath d='M29 114v-3a4 4 0 0 1 8 0v3' stroke='rgba(255,79,23,0.055)' stroke-width='1'/%3E%3Ccircle cx='122' cy='120' r='20' stroke='rgba(255,255,255,0.035)' stroke-width='1'/%3E%3Ccircle cx='122' cy='120' r='4' fill='rgba(255,79,23,0.06)'/%3E%3Cpath d='M78 76h8M82 72v8' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
/* Wallpaper 2: Obsidian Grid */
.chat-stage[data-wallpaper="grid"] .chat-wallpaper-layer {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
}
/* Wallpaper 3: Stealth Planes */
.chat-stage[data-wallpaper="planes"] .chat-wallpaper-layer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none'%3E%3Cpath d='M20 42l26-11-8 20-7-5 10-10-12 8z' stroke='rgba(255,79,23,0.06)' stroke-width='1'/%3E%3Cpath d='M76 92l24-10-7 18-6-4 9-9-11 7z' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}
/* Wallpaper 4: Pure Pitch Black */
.chat-stage[data-wallpaper="pitch"] .chat-wallpaper-layer,
.chat-stage[data-wallpaper="pitch"] .chat-ambient-glow {
  opacity: 0;
}

.messages-scroll { position: relative; z-index: 2; }

/* Wallpaper Switcher Grid */
.wp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wp-option {
  padding: 8px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-size: 11px;
}
.wp-option.active { border-color: var(--accent); color: var(--accent); }
.wp-thumb { height: 64px; border-radius: 5px; border: 1px solid var(--border); background-color: #050505; }
.wp-t-rings { background-image: radial-gradient(circle at 50% 50%, rgba(255,79,23,0.22), transparent 65%); }
.wp-t-grid { background-image: linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px); background-size: 14px 14px; }
.wp-t-planes { background-image: linear-gradient(135deg, rgba(255,79,23,0.14) 0%, #050505 60%); }
.wp-t-pitch { background: #050505; }

/* 4. POLISHED MESSAGE BUBBLES WITH CIRCULAR AVATARS & OFFICIAL GUIDE CHIPS */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 780px;
}
.msg-row.self {
  margin-left: auto;
  flex-direction: row-reverse;
}
.msg-av-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.msg-av-btn:hover { border-color: var(--accent); }
.msg-bubble {
  position: relative;
  background: #111115;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  min-width: 140px;
  max-width: min(640px, 82vw);
}
.msg-row.self .msg-bubble {
  background: #1D100C;
  border: 1px solid rgba(255, 79, 23, 0.28);
  border-radius: 12px 12px 4px 12px;
}
.msg-sender-wrap { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.msg-handle-sub { font-size: 10px; color: var(--muted); }
.msg-holder-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 79, 23, 0.16);
  color: var(--accent);
  border: 1px solid rgba(255, 79, 23, 0.4);
}
.msg-foot-ticks { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }

.guide-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.guide-chip {
  padding: 7px 11px;
  border-radius: 6px;
  background: rgba(255, 79, 23, 0.1);
  border: 1px solid rgba(255, 79, 23, 0.4);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.guide-chip:hover { background: var(--accent); border-color: var(--accent); }

/* 5. TELEGRAM-INSPIRED LUXURY PROFILE MODAL */
.tg-profile-card {
  max-width: 440px;
  padding: 20px;
}
.tgp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tgp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding-bottom: 16px;
}
.tgp-av-ring {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 3px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #0A0A0D;
}
.tgp-av-ring.verified-ring { border-color: var(--accent); box-shadow: 0 0 22px rgba(255, 79, 23, 0.28); }
.tgp-av-ring.editable { cursor: pointer; }
.tgp-av-edit-tag {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(5, 5, 5, 0.8);
  font-size: 9px;
  color: var(--accent);
  padding: 2px 0;
  border-radius: 0 0 44px 44px;
}
.tgp-name { font-size: 19px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.tgp-status { font-size: 11px; }
.tgp-status.online { color: var(--accent); }

.tgp-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.tgp-act-btn {
  padding: 10px 6px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text);
}
.tgp-act-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tgp-act-btn:disabled { opacity: 0.42; cursor: not-allowed; }

.tgp-group {
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}
.tgp-row {
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.tgp-row:last-child { border-bottom: 0; }
.tgp-row-lbl { font-size: 10px; color: var(--muted); display: block; margin-bottom: 2px; }
.tgp-row-val { font-size: 13px; color: var(--text); word-break: break-word; }

.tgp-showcase {
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.tgp-empty-gifts {
  text-align: center;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@media (max-width: 860px) {
  .hg-app { grid-template-columns: 1fr !important; }
  .hg-sidebar { width: 296px; }
}
@media (max-width: 720px) {
  .ob-mode-grid, .ob-prof-layout { grid-template-columns: 1fr; }
  .onboard-card { padding: 20px 16px; }
  .ghost-upgrade-pill { display: none; }
}
@media (max-width: 540px) {
  .tb-room-av { width: 30px; height: 30px; }
  .msg-av-btn { width: 28px; height: 28px; }
}

/* Modal & Toast Layering (always above onboarding & nested modals) */
.modal-backdrop { z-index: 350; }
#walletModal, #qrModal { z-index: 450; }
.toast-stack { z-index: 500; }

/* Static 3D WebGL2 Heligram Ring Wallpaper (does not move on chat scroll) */
.ring-wp-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}
.chat-stage[data-wallpaper="rings"] .chat-wallpaper-layer {
  background-image: none;
}

/* Compact zero-waste reactions, unified floating hover dock & smooth polish */
.messages-list {
  padding-top: 18px;
  padding-bottom: 14px;
  gap: 10px;
}
.msg-row {
  animation: hgMsgIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hgMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.msg-reactions:not(:has(.react-pill)) {
  margin-top: 0;
  height: 0;
  overflow: hidden;
}

/* Single unified floating dock on top-right of bubble (never overlaps even on 2-letter messages) */
.msg-action-dock {
  position: absolute;
  top: -15px;
  right: 8px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: rgba(11, 11, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.msg-bubble:hover .msg-action-dock,
.msg-action-dock:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dock-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
}
.msg-action-dock .mini-act {
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
}
.msg-action-dock .mini-act:hover {
  color: var(--accent);
}

/* Smart Unfurl instant loading skeleton */
.unfurl-loading {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(10, 10, 14, 0.9);
  border: 1px solid rgba(255, 79, 23, 0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Sleek dark obsidian scrollbars */
.messages-scroll::-webkit-scrollbar,
.room-list::-webkit-scrollbar { width: 5px; }
.messages-scroll::-webkit-scrollbar-track,
.room-list::-webkit-scrollbar-track { background: transparent; }
.messages-scroll::-webkit-scrollbar-thumb,
.room-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }
.messages-scroll::-webkit-scrollbar-thumb:hover,
.room-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 79, 23, 0.45); }

/* Prominent Topbar & Onboarding CA + Official X Pill */
.tb-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.token-x-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  background: rgba(17, 17, 21, 0.92);
  border: 1px solid rgba(255, 79, 23, 0.34);
  border-radius: 99px;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(255, 79, 23, 0.08);
}
.ca-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.ca-copy-btn:hover strong { color: #FFFFFF; }
.txp-sep { color: rgba(255, 255, 255, 0.16); }
.x-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.x-pill-link:hover { color: var(--accent); }

@media (max-width: 1180px) {
  .tb-center { display: none; }
}
