/* Двухслойные анимационные баблы (#tma-flight-bg под островком z-index:43, #tma-flight-fg над островком z-index:49) */
.tma-composer-dock {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center; z-index: 46; pointer-events: none;
}
.tma-composer-inner {
  width: 100%; max-width: 780px; display: flex; flex-direction: column; gap: 6px;
}
.tma-aux-banner {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 7px 13px; background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px); border-radius: 16px; font-size: 13px;
}
.tma-staged-img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; }

.tma-flight-layer {
  position: absolute !important; margin: 0 !important; max-width: none !important;
  pointer-events: none !important; opacity: 1 !important; will-change: transform;
}
.tma-flight-layer > .tma-bubble { width: 100%; height: 100%; }
.tma-flight-layer.is-bg-layer { z-index: 43 !important; }
.tma-flight-layer.is-bg-layer .tma-bubble-text,
.tma-flight-layer.is-bg-layer .tma-bubble-author,
.tma-flight-layer.is-bg-layer .tma-bubble-meta { opacity: 0 !important; }
.tma-flight-layer.is-fg-layer { z-index: 49 !important; }
.tma-flight-layer.is-fg-layer > .tma-bubble { background: transparent !important; box-shadow: none !important; }
.tma-flight-layer.is-fg-layer .tma-bubble-tail { display: none !important; }

@keyframes tmaTypingDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.tma-typing-inline { color: #007aff; font-weight: 600; display: inline-flex; align-items: baseline; }
.tma-typing-blue { color: #007aff; font-weight: 500; display: inline-flex; align-items: baseline; }
.tma-typing-wave { display: inline-flex; margin-left: 1px; font-weight: 800; }
.tma-typing-wave span { display: inline-block; animation: tmaTypingDotBounce 1.2s infinite ease-in-out; }
.tma-typing-wave span:nth-child(2) { animation-delay: 0.2s; }
.tma-typing-wave span:nth-child(3) { animation-delay: 0.4s; }

.tma-unified-pill {
  pointer-events: auto; width: 100%;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px) saturate(185%); -webkit-backdrop-filter: blur(24px) saturate(185%);
  border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, border-radius 240ms ease;
}
.tma-chat-room.is-multiselect .tma-unified-pill,
.tma-chat-room.is-fullscreen-editor .tma-unified-pill {
  transform: translateY(120%); opacity: 0; pointer-events: none; position: absolute;
}

.tma-reply-drawer { max-height: 0; overflow: hidden; transition: max-height 280ms cubic-bezier(0.22, 1, 0.36, 1); }
.tma-unified-pill.has-reply .tma-reply-drawer { max-height: 56px; }
.tma-reply-drawer-inner {
  height: 54px; padding: 10px 10px 10px 14px;
  display: flex; align-items: center; gap: 11px;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
  transform: translateY(100%); opacity: 0;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}
.tma-unified-pill.has-reply .tma-reply-drawer-inner { transform: translateY(0); opacity: 1; }
.tma-reply-mat-ico { color: #007aff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tma-reply-texts { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 17px; }
.tma-reply-author { font-size: 14px; font-weight: 600; color: #007aff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-reply-snippet { font-size: 14px; color: #3c3c43; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tma-reply-close-btn { width: 34px; height: 34px; border: 0; background: transparent; color: rgba(60, 60, 67, 0.55); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; }

.tma-unified-input-row {
  position: relative; min-height: 46px; display: flex; align-items: flex-end; padding: 0 0 0 8px; gap: 4px;
}
.tma-clear-draft-btn {
  position: absolute; top: 5px; left: 8px; z-index: 5;
  width: 38px; height: 34px; border: 0; background: transparent;
  color: #ff3b30; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 180ms ease, transform 180ms ease;
}
.tma-comp-emoji-btn {
  position: relative; width: 38px; height: 42px; margin-bottom: 2px; border: 0; background: transparent;
  color: rgba(60, 60, 67, 0.62); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.tma-em-ico { position: absolute; display: inline-flex; transition: opacity 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.tma-em-ico.is-kb { opacity: 0; transform: scale(0.5) rotate(-45deg); }
.tma-comp-emoji-btn.is-kb-mode .tma-em-ico.is-smile { opacity: 0; transform: scale(0.5) rotate(45deg); }
.tma-comp-emoji-btn.is-kb-mode .tma-em-ico.is-kb { opacity: 1; transform: scale(1) rotate(0deg); color: #007aff; }

.tma-inp-scroll-box {
  position: relative; flex: 1; min-width: 0; height: 44px; margin: 0 !important;
  transition: height 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tma-inp-mirror {
  position: absolute; top: 0; left: 0; right: 0; visibility: hidden; pointer-events: none;
  font-family: inherit; font-size: 17px; line-height: 22px; white-space: pre-wrap; word-break: break-word;
  padding: 11px 4px;
}
.tma-composer-input, .tma-mini-md-preview {
  width: 100%; height: 100%; margin: 0; padding: 11px 4px;
  border: 0; outline: 0; background: transparent; resize: none;
  font-family: inherit; font-size: 17px; line-height: 22px; color: #000000;
  overflow-y: auto; scrollbar-width: none; display: block;
}
.tma-composer-input::-webkit-scrollbar, .tma-mini-md-preview::-webkit-scrollbar { display: none; }
.tma-composer-input::placeholder { color: rgba(60, 60, 67, 0.42); }
.tma-mini-md-preview { cursor: pointer; }

.tma-comp-attach-btn {
  width: 38px; height: 42px; margin-bottom: 2px; border: 0; background: transparent;
  color: rgba(60, 60, 67, 0.62); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.tma-expand-editor-btn {
  position: absolute; top: 5px; right: 5px; z-index: 5;
  width: 38px; height: 34px; border: 0; background: transparent;
  color: rgba(60, 60, 67, 0.72); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 180ms ease, transform 180ms ease;
}
.tma-blue-action-btn {
  width: 42px; height: 42px; margin: 2px; border-radius: 50%; border: 0;
  background: #007aff; color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: transform 140ms ease, background 140ms ease;
}
.tma-blue-action-btn:active { transform: scale(0.92); }

.tma-multi-reply-btn {
  pointer-events: none; opacity: 0; transform: translateY(-18px);
  height: 0; overflow: hidden; width: 100%; border: 0; border-radius: 24px;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(22px);
  color: #007aff; font-size: 16.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, height 240ms ease;
}
.tma-chat-room.is-multiselect .tma-multi-reply-btn { pointer-events: auto; opacity: 1; transform: translateY(0); height: 48px; }

.tma-emoji-panel { pointer-events: auto; width: 100%; height: 0; overflow: hidden; background: rgba(248, 248, 250, 0.96); backdrop-filter: blur(24px); border-radius: 20px; transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1); }
.tma-chat-room.is-emoji-open .tma-emoji-panel { height: var(--tma-kb-h, 268px); }
.tma-emoji-scroll { height: 100%; overflow-y: auto; padding: 10px 12px 18px; -webkit-overflow-scrolling: touch; }
.tma-emoji-cat-title { font-size: 12px; font-weight: 600; color: rgba(60, 60, 67, 0.55); text-transform: uppercase; margin: 6px 4px; }
.tma-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.tma-emoji-cell { height: 40px; border: 0; border-radius: 8px; background: transparent; font-size: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

