/* Изолированные стили оверлеев Telegram-чата: фокус-меню, панель реакций, контекстное меню, лайтбокс и загрузка */
.tma-upload-overlay {
  position: absolute; inset: 0; z-index: 15;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.tma-ring-svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.tma-ring-bg { fill: none; stroke: rgba(0, 0, 0, 0.12); stroke-width: 3.5; }
.tma-ring-fg { fill: none; stroke: #007aff; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset 140ms linear; }

.lh-inline-prem-emoji { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin: 0 2px; }
.lh-inline-prem-emoji canvas { width: 20px; height: 20px; display: block; }

.tma-focus-backdrop { position: fixed; inset: 0; z-index: 440; pointer-events: auto; }
.tma-focus-blur {
  position: fixed; inset: 0; z-index: 441; background: rgba(88, 114, 80, 0.34); opacity: 0;
  transition: opacity 250ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1)), backdrop-filter 250ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.tma-focus-backdrop.is-active .tma-focus-blur { opacity: 1; backdrop-filter: blur(22px) saturate(145%); -webkit-backdrop-filter: blur(22px) saturate(145%); }
.tma-focus-stage { position: fixed; inset: 0; pointer-events: none; z-index: 448; }
.tma-bubble-row.is-focus-clone {
  position: fixed !important; margin: 0 !important; max-width: none !important; z-index: 450; pointer-events: none;
  transition: transform 260ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1)) !important;
}
.tma-bubble-row.is-focus-hidden { opacity: 0 !important; }

.tma-reaction-bar {
  position: fixed; z-index: 462; height: 50px; max-width: calc(100vw - 24px); padding: 0 8px 0 12px;
  border-radius: 25px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(24px);
  display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: scale(0.84) translateY(8px);
  transition: opacity 230ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1)), transform 240ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1)), height 260ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.tma-focus-backdrop.is-active .tma-reaction-bar { opacity: 1; transform: scale(1) translateY(0); }
.tma-reaction-bar.is-expanded-grid { height: 236px; border-radius: 22px; transform: scale(1) translateY(14px); }
.tma-react-quick-row { height: 50px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tma-react-expand-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(60, 60, 67, 0.1); color: #3c3c43; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tma-react-all-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 4px 12px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tma-react-emoji-btn { border: 0; background: transparent; font-size: 27px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

.tma-ctx-menu {
  position: fixed; z-index: 460; width: 242px; background: rgba(248, 248, 248, 0.88); backdrop-filter: blur(28px);
  border-radius: 15px; overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: scale(0.84) translateY(-10px);
  transition: opacity 230ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1)), transform 240ms var(--tma-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.tma-focus-backdrop.is-active .tma-ctx-menu:not(.is-menu-hidden) { opacity: 1; transform: scale(1) translateY(0); }
.tma-ctx-menu.is-menu-hidden { opacity: 0 !important; pointer-events: none; }
.tma-ctx-btn { border: 0; border-bottom: 0.5px solid rgba(60, 60, 67, 0.18); background: transparent; height: 45px; padding: 0 16px; font-size: 16.5px; color: #000; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tma-ctx-btn.is-last { border-bottom: 0; }
.tma-ctx-thick-sep { height: 7px; background: rgba(60, 60, 67, 0.11); width: 100%; }
.tma-ctx-btn.is-danger { color: #ff3b30; }

.tma-lightbox { position: fixed; inset: 0; background: rgba(10, 12, 18, 0.95); backdrop-filter: blur(12px); z-index: 480; display: flex; flex-direction: column; justify-content: space-between; }
.tma-lightbox-top { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.tma-lightbox-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 12px; }
.tma-lightbox-img { max-width: 100%; max-height: 82dvh; border-radius: 12px; object-fit: contain; }
