/* Community — the chat's screen: Telegram for iOS in its dark theme, as the films draw it (design/video/parts/ios/
   tg-ios.css), laid out at 390 × 693.33 pt (9:16) and scaled to its frame by js/community/chat.js (--z). The Calls topic:
   status bar, navigation bar, the thread over the wallpaper (assets/img/community/tg-wall.svg, the films' tile), the
   message bar. The thread is anchored to the bottom (column-reverse) and scrolls by hand. Classes tg-… */

.cm-tg-frame { background: #0b0b0c; }
.tg {
  --z: .918;
  --tg-bar: #161618; --tg-hair: rgba(255, 255, 255, .085); --tg-sub: #8d8d93; --tg-accent: #3e88f7; --tg-link: #67aef6; --tg-in: #232325;
  position: absolute; left: 0; top: 0; width: 390px; height: 693.33px; overflow: hidden; transform: scale(var(--z)); transform-origin: 0 0;
  color: #fff; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", var(--sans);
  font-size: 17px; line-height: 22px; letter-spacing: -.02em; text-align: left; -webkit-font-smoothing: antialiased;
}
@media (min-width: 900px) { .tg { --z: 1.1; } }
.tg p { margin: 0; }
.tg-wall { position: absolute; inset: 0; background: url("/assets/img/community/tg-wall.svg") 0 0 / 300px 300px, radial-gradient(120% 80% at 50% 10%, #141416, #0b0b0c 72%); }

/* status bar and the Dynamic Island */
.tg-sb { position: absolute; z-index: 4; left: 0; top: 0; width: 390px; height: 54px; pointer-events: none; }
.tg-clock { position: absolute; left: 63px; top: 29.5px; transform: translate(-50%, -50%); font-size: 17px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tg-island { position: absolute; left: 132.5px; top: 11px; width: 125px; height: 37px; border-radius: 18.5px; background: #000; }
.tg-icons { position: absolute; left: 327px; top: 29.5px; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; }
.tg-icons svg { display: block; fill: currentColor; }

/* navigation bar: back, the topic and its thread, the topic's icon */
.tg-nav { position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 98px; background: var(--tg-bar); box-shadow: 0 .5px 0 var(--tg-hair); }
.tg-back { position: absolute; left: 10px; top: 64px; color: var(--tg-accent); }
.tg-back svg { display: block; }
.tg-title { position: absolute; left: 70px; right: 70px; top: 56px; text-align: center; white-space: nowrap; }
.tg-title b { display: block; font-size: 17px; font-weight: 600; line-height: 21px; }
.tg-title span { display: block; font-size: 13px; line-height: 18px; letter-spacing: -.005em; color: var(--tg-sub); }
.tg-topic { position: absolute; right: 10px; top: 58px; width: 36px; height: 36px; }
.tg-topic svg { position: absolute; inset: 0; width: 36px; height: 36px; }
.tg-topic b { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 3px; font-size: 15px; font-weight: 700; }

/* the thread */
.tg-area { position: absolute; left: 0; right: 0; top: 98px; bottom: 82px; display: flex; flex-direction: column-reverse; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.tg-area::-webkit-scrollbar { display: none; }
.tg-col { padding: 2px 0 10px; }
.tg-date { display: flex; justify-content: center; padding: 10px 0 2px; }
.tg-date span { height: 24px; padding: 0 10px; border-radius: 12px; background: rgba(24, 24, 27, .78); font-size: 14px; font-weight: 600; line-height: 24px; letter-spacing: -.01em; }
.tg-m { display: flex; align-items: flex-end; gap: 6px; padding: 8px 52px 0 6px; }
.tg-av { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #2a2a2d; }
.tg-b { position: relative; min-width: 128px; max-width: 292px; padding: 6px 11px 7px; border-radius: 17px 17px 17px 6px; background: var(--tg-in); }
.tg-b::before { content: ""; position: absolute; left: -6px; bottom: 0; width: 11px; height: 17px; background: var(--tg-in); clip-path: path("M11 0v17H2.2C.6 17-.2 15.3.9 14.3 6 9.9 9.6 5.4 11 0z"); }
.tg-nm { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 600; line-height: 18px; letter-spacing: -.015em; color: var(--h, #fff); white-space: nowrap; }
.tg-nm i { margin-left: auto; font-style: normal; font-weight: 400; font-size: 13px; color: var(--tg-sub); letter-spacing: 0; }
.tg-tx { margin-top: 2px; overflow-wrap: break-word; }
.tg-tx strong { font-weight: 600; }
.tg-tx a { color: var(--tg-link); }
.tg-tx a:hover { text-decoration: underline; }
.tg-re { display: grid; margin: 5px 0 3px; padding: 3px 9px 4px 10px; border-radius: 5px; box-shadow: inset 3px 0 0 var(--h); background: color-mix(in srgb, var(--h) 13%, transparent);
  font-size: 14px; line-height: 18px; letter-spacing: -.01em; }
.tg-re b { font-weight: 600; color: var(--h); }
.tg-re span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tg-rx { display: flex; gap: 6px; margin-top: 7px; padding-right: 44px; transform-origin: 0 50%; }
.tg-rxp { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px 0 8px; border-radius: 15px; background: rgba(103, 174, 246, .17);
  color: var(--tg-link); font-size: 15px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tg-rxp img { width: 19px; height: 19px; border-radius: 5px; }
.tg-rxp b { font-weight: 600; }
.tg-t { position: absolute; right: 10px; bottom: 7px; font-size: 12px; line-height: 14px; letter-spacing: 0; color: rgba(255, 255, 255, .5); }

/* a photo post: the kit's Ledger card as the photo, edge to edge in the bubble */
.tg-b--ph { width: 292px; padding: 0 0 7px; }
.tg-b--ph .tg-nm { padding: 7px 11px 6px; }
.tg-b--ph .tg-tx, .tg-b--ph .tg-rx { padding-left: 11px; padding-right: 11px; }
.tg-b--ph .tg-tx { margin-top: 6px; }
.tg-b--ph .tg-rx { padding-right: 52px; }
.tg-ph { margin: 0 2px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: #000; }
.tg-ph > .tu-card, .tg-ph noscript img { display: block; width: 100%; height: auto; }
.tg-ph .tu-ledger, .tg-ph .tu-card__in { border-radius: 0; box-shadow: none; }

/* message bar and home indicator */
.tg-input { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 82px; background: var(--tg-bar); box-shadow: 0 -.5px 0 var(--tg-hair); color: var(--tg-sub); }
.tg-clip { position: absolute; left: 9px; top: 7px; }
.tg-mic { position: absolute; right: 10px; top: 7px; }
.tg-field { position: absolute; left: 46px; right: 46px; top: 4px; height: 35px; padding: 6px 13px; border-radius: 18px; background: #0c0c0d;
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .13); font-size: 17px; line-height: 23px; color: #6c6c71; }

/* playing: messages are out until they arrive; each lands as the thread moves up, its reactions a moment later */
.cm-chat.is-live .tg-m { display: none; }
.cm-chat.is-live .tg-m.is-in { display: flex; }
.cm-chat.is-live .tg-m.is-new { animation: tg-in .5s var(--ease) both; }
.cm-chat.is-live .tg-m.is-new .tg-rx { animation: tg-rx .45s var(--ease) .7s both; }
.cm-chat.is-live .tg-col { transition: opacity .35s linear; }
.cm-chat.is-live .tg-col.is-out { opacity: 0; }
@keyframes tg-in { from { opacity: 0; } }
@keyframes tg-rx { from { opacity: 0; transform: scale(.9); } }
.rm .cm-chat.is-live .tg-m.is-new, .rm .cm-chat.is-live .tg-m.is-new .tg-rx { animation: none; }
