/* Двухслойный экран поддержки (Фото 3), сетка быстрых тем 2x2 и горизонтальная строка диалога в стиле Telegram iOS */
.tma-support-list-layer { width: 100%; display: flex; flex-direction: column; }
.tma-support-room-layer { position: fixed; inset: 0; z-index: 120; pointer-events: auto; overflow: hidden; }
.tma-support-topics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tma-topic-tile {
  height: 44px; padding: 0 12px; border: 0; border-radius: 14px;
  background: var(--tma-card-bg); color: var(--tma-text);
  font-size: 13px; font-weight: 600; font-family: inherit;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  transition: background-color 120ms ease, transform 100ms ease;
}
.tma-topic-tile:active { transform: scale(0.98); background: var(--tma-hover); }
.tma-topic-tile .material-symbols-outlined { font-size: 18px; color: var(--tma-text); }

.tma-support-dialogs-card { background: var(--tma-surface); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tma-tg-dialog-list { display: flex; flex-direction: column; width: 100%; padding: 0 !important; background: transparent !important; }
.tma-tg-dialog-row {
  width: 100%; padding: 10px 6px; border-radius: 14px;
  background: transparent !important; box-shadow: none !important;
  display: flex !important; flex-direction: row !important; align-items: center !important; gap: 12px;
  cursor: pointer; border-bottom: 0.5px solid rgba(60, 60, 67, 0.1);
  transition: background 120ms ease;
}
.tma-tg-dialog-row:last-child { border-bottom: 0; }
.tma-tg-dialog-row:active, .tma-tg-dialog-row:hover { background: rgba(0, 0, 0, 0.04) !important; }
.tma-dialog-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--tma-field); flex-shrink: 0; display: block; }
.tma-tg-dialog-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.tma-tg-dialog-top, .tma-tg-dialog-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
.tma-tg-dialog-title { font-size: 15.5px; line-height: 19px; font-weight: 600; color: #000000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-tg-dialog-time { font-size: 12px; line-height: 16px; color: #8e8e93; flex-shrink: 0; }
.tma-tg-dialog-preview { font-size: 14px; line-height: 18px; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.tma-tg-dialog-right { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tma-unread-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #007aff; color: #ffffff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }

.tma-avatar-wrap { position: relative; flex-shrink: 0; width: 48px; height: 48px; }
.tma-ai-dot { position: absolute; bottom: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; border: 2px solid #fff; }
.tma-ai-dot.is-glowing { background: #34c759; }

.tma-chat-room {
  position: relative; display: flex; flex-direction: column;
  height: var(--tma-vvh, 100dvh); width: 100%; max-width: 100vw; overflow: hidden !important;
  background-color: #9ec28e;
  background-image: radial-gradient(circle at 18% 22%, rgba(216, 236, 192, 0.8) 0%, transparent 52%), radial-gradient(circle at 82% 76%, rgba(122, 165, 118, 0.85) 0%, transparent 55%), linear-gradient(160deg, #b8d8a0 0%, #8cb580 50%, #a5ca95 100%);
  transform: translate3d(0, 0, 0); opacity: 1;
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.16);
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), opacity 150ms ease;
}
.tma-chat-room.is-slide-entering { transform: translate3d(300px, 0, 0); opacity: 0; }
.tma-chat-room.is-swiping-back { transition: none !important; }
.tma-chat-room.is-back-hidden:not(.is-multiselect):not(.is-fullscreen-editor) #btn-header-left { visibility: hidden; pointer-events: none; }

.tma-tg-float-header { position: absolute; top: 9px; left: 10px; right: 10px; z-index: 48; pointer-events: none; display: flex; justify-content: center; }
.tma-tg-header-inner { width: 100%; max-width: 780px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tma-glass-circle { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; outline: 0; background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); color: #1c1c1e; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; pointer-events: auto; }
.tma-ico-layer { position: absolute; display: inline-flex; transition: opacity 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.tma-ico-layer.is-close { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.tma-chat-room.is-multiselect .tma-ico-layer.is-back { opacity: 0; transform: rotate(90deg) scale(0.5); }
.tma-chat-room.is-multiselect .tma-ico-layer.is-close { opacity: 1; transform: rotate(0deg) scale(1); }

.tma-glass-title-pill { position: relative; min-width: 176px; height: 46px; background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(20px) saturate(180%); padding: 4px 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center; pointer-events: auto; overflow: hidden; }
.tma-title-normal, .tma-title-selected { transition: opacity 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1); text-align: center; }
.tma-title-selected { position: absolute; font-size: 16.5px; font-weight: 700; color: #000; opacity: 0; transform: translateY(12px); }
.tma-chat-room.is-multiselect .tma-title-normal { opacity: 0; transform: translateY(-12px); }
.tma-chat-room.is-multiselect .tma-title-selected { opacity: 1; transform: translateY(0); }
.tma-glass-title { font-size: 16.5px; font-weight: 700; color: #000000; line-height: 19px; }
.tma-glass-sub { font-size: 12.5px; color: rgba(0, 0, 0, 0.55); line-height: 14px; }

.tma-header-right-wrap { position: relative; display: flex; align-items: center; gap: 6px; pointer-events: auto; }
.tma-glass-avatar-btn { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.9); padding: 0; overflow: hidden; cursor: pointer; }
.tma-header-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tma-multi-actions-pill, .tma-undo-redo-pill { position: absolute; right: 0; height: 46px; padding: 0 8px; border-radius: 999px; background: rgba(242, 243, 247, 0.92); backdrop-filter: blur(20px); display: flex; align-items: center; gap: 4px; opacity: 0; pointer-events: none; transform: scale(0.85); }

.tma-bubbles-stream { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden !important; padding: 68px 0 var(--tma-dock-h, 74px); display: flex; flex-direction: column; align-items: center; user-select: none; }
.tma-stream-inner { width: 100%; max-width: 780px; display: flex; flex-direction: column; }
.tma-service-pill { align-self: center; background: rgba(65, 102, 58, 0.42); backdrop-filter: blur(10px); color: #ffffff; font-size: 13px; font-weight: 600; padding: 4px 14px; border-radius: 999px; margin: 4px 0 10px; }
.tma-msg-strip { position: relative; width: 100%; padding: 5px 10px; display: flex; align-items: center; }

.tma-sel-col { width: 0; opacity: 0; overflow: hidden; display: flex; align-items: center; flex-shrink: 0; }
.tma-chat-room.is-multiselect .tma-sel-col { width: 36px; opacity: 1; }
.tma-sel-circle { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid rgba(255, 255, 255, 0.88); background: rgba(0, 0, 0, 0.15); color: transparent; display: inline-flex; align-items: center; justify-content: center; }
.tma-sel-circle.is-checked { background: #007aff; border-color: #007aff; color: #ffffff; }

.tma-bubble-row { min-width: 0; display: flex; align-items: flex-end; gap: 8px; max-width: 85%; position: relative; z-index: 2; }
.tma-bubble-row.is-in { margin-right: auto; } .tma-bubble-row.is-out { margin-left: auto; }
.tma-bubble-stack { display: flex; flex-direction: column; gap: 3px; max-width: 100%; }
.tma-msg-avatar, .tma-msg-avatar-spacer { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: none; }

.tma-bubble { position: relative; min-width: 68px; max-width: 100%; padding: 8px 13px 7px; font-size: 16px; line-height: 21px; color: #000000; display: flex; flex-direction: column; gap: 3px; word-break: break-word; border-radius: 20px 20px 20px 3px; background: #ffffff; }
.tma-bubble-row.is-out .tma-bubble { background: #e3fecd; border-radius: 20px 20px 3px 20px; }
.tma-bubble-row.has-inline-kb .tma-bubble { border-bottom-left-radius: 6px !important; border-bottom-right-radius: 6px !important; }
.tma-bubble-row.has-inline-kb .tma-bubble-tail { display: none !important; }

.tma-inline-kb-grid { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.tma-inline-kb-row { display: flex; gap: 3px; width: 100%; }
.tma-inline-kb-btn { flex: 1; height: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: rgba(58, 92, 52, 0.56); backdrop-filter: blur(14px); color: #ffffff; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-inline-kb-btn.is-bot-left { border-bottom-left-radius: 18px !important; }
.tma-inline-kb-btn.is-bot-right { border-bottom-right-radius: 18px !important; }
.tma-inline-kb-btn.is-style-primary { background: #007aff; color: #ffffff; }
.tma-inline-kb-btn.is-style-success { background: #34c759; color: #ffffff; }
.tma-inline-kb-btn.is-style-danger { background: #ff3b30; color: #ffffff; }
.tma-bubble-tail { position: absolute; bottom: 0; width: 11px; height: 18px; pointer-events: none; }
.tma-tail-in-wrap .tma-bubble-tail { left: -6px; color: #ffffff; } .tma-tail-out-wrap .tma-bubble-tail { right: -6px; color: #e3fecd; }
.tma-bubble-row.is-in .tma-tail-out-wrap, .tma-bubble-row.is-out .tma-tail-in-wrap { display: none; }
.tma-bubble-author { font-size: 14px; font-weight: 600; color: #2b8a3e; line-height: 18px; }
.tma-bubble-text { min-width: 0; text-align: left; }
.tma-time-spacer { display: inline-block; width: 68px; height: 15px; vertical-align: bottom; pointer-events: none; }
.tma-bubble-meta { position: absolute; right: 11px; bottom: 5px; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: #8e8e93; pointer-events: none; }
.tma-media-frame { position: relative; width: 240px; max-width: 100%; border-radius: 14px; overflow: hidden; background: #18181b; aspect-ratio: 4 / 3; cursor: pointer; }
.tma-media-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tma-deleted-svg { width: 100%; height: 100%; display: block; }
