/* Telegram invite card (telegram.js): bottom-right, like the feedback card; the two never show together. */
.tg-card {
  position: fixed; right: 18px; bottom: 72px; z-index: 70; /* above the bottom toolbar, like the toasts */
  width: 340px; max-width: calc(100vw - 24px); overflow: hidden;
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity .22s, transform .45s var(--spring);
}
.tg-card.show { opacity: 1; transform: none; }
.tg-card.hide { opacity: 0; transform: translateY(8px) scale(.97); transition-duration: .18s; }
.tg-close { position: absolute; top: 10px; right: 10px; z-index: 2; color: var(--text-3); }

/* the orbit scene: warm paper with the canvas dot grid, thin rings, note orbs, the ink sun */
.tg-scene {
  position: relative; height: 128px; border-bottom: 1px solid var(--border);
  background: radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 18px 18px, var(--bg);
}
.tg-scene svg { position: absolute; left: 50%; top: 0; width: 300px; height: 128px; margin-left: -150px; overflow: visible; }
.tg-ring { fill: none; stroke: var(--text-3); stroke-width: 1; opacity: .55; }
.tg-dot {
  position: absolute; left: calc(50% - 150px); top: 0; width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  border-radius: 50%; offset-rotate: 0deg; offset-anchor: center;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--c) 45%, #fff), var(--c) 62%);
  box-shadow: 0 3px 10px -2px color-mix(in srgb, var(--c) 60%, transparent);
  animation: tg-orbit var(--d) linear infinite; animation-delay: calc(var(--d) * var(--t));
}
.tg-o0 { offset-path: path('M30 64a120 40 0 1 0 240 0a120 40 0 1 0-240 0'); }
.tg-o1 { offset-path: path('M75 64a75 24 0 1 0 150 0a75 24 0 1 0-150 0'); animation-direction: reverse; }
@keyframes tg-orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.tg-sun {
  position: absolute; left: 50%; top: 64px; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-md);
  animation: tg-float 5s ease-in-out infinite;
}
.tg-sun svg.i { width: 22px; height: 22px; margin-left: -2px; }
@keyframes tg-float { 50% { transform: translateY(-3px); } }

.tg-body { padding: 14px 18px 16px; }
.tg-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .3px; color: var(--text-3); }
.tg-card h3 { margin: 2px 0 6px; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.tg-card p { margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.tg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tg-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; line-height: 1; }
.tg-go { text-decoration: none; }
.tg-go svg.i { width: 15px; height: 15px; flex: none; margin-left: -2px; }

@media (max-width: 640px) {
  .tg-card { left: 12px; right: 12px; width: auto; bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-card, .tg-card.hide { transition: opacity .15s; transform: none; }
  .tg-dot, .tg-sun { animation-duration: 60s; }
}
