.msgmenu {
    position: fixed;
    z-index: 9999;
}
#composer-previews.hidden, 
#edit-preview.hidden, 
#reply-preview.hidden {
    display: none !important;
}
#edit-preview:not(.hidden) ~ #reply-preview:not(.hidden),
#reply-preview:not(.hidden) ~ #edit-preview:not(.hidden) {
    display: none !important;
}
:root {
  --composer-previews-bg: color-mix(in srgb, var(--bg) 88%, #ffffff 12%);
  --composer-previews-border: color-mix(in srgb, var(--line) 62%, transparent);
  --composer-preview-surface: var(--composer-previews-bg);
  --composer-preview-text: color-mix(in srgb, var(--fg) 90%, #111 10%);
  --composer-preview-muted: color-mix(in srgb, var(--fg) 56%, var(--muted) 44%);
  --composer-preview-accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
}
.dark, [data-theme="dark"] {
  --composer-previews-bg: color-mix(in srgb, var(--bg) 86%, #111722 14%);
  --composer-previews-border: color-mix(in srgb, #7f93ab 22%, transparent);
  --composer-preview-surface: var(--composer-previews-bg);
  --composer-preview-text: color-mix(in srgb, #ecf4ff 92%, #b6c7db 8%);
  --composer-preview-muted: color-mix(in srgb, #bfd0e3 70%, #8ea5bd 30%);
}
#composer-previews.composer-previews-active {
    display: flex !important;
    flex-direction: column;
    position: relative;
    width: 100%;
    z-index: 20;
    margin: 0 !important; 
    padding: 0 !important;
    background: var(--composer-previews-bg);
    backdrop-filter: blur(20px);
    border: none !important;
    border-radius: 14px 14px 0 0 !important;
    overflow: hidden;
    transform-origin: bottom;
    animation: previewExpand 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#edit-preview, #reply-preview {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    min-height: 52px;
}
#attachment-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0 !important;
    padding: 10px 12px !important;
    min-height: 52px;
    background: var(--composer-preview-surface);
    border-top: none;
}
#attachment-preview .attachment-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#attachment-preview .attachment-info strong,
#attachment-preview .attachment-info small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#attachment-preview .attachment-info strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--composer-preview-text);
}
#attachment-preview .attachment-info small {
    font-size: 12px;
    color: var(--composer-preview-muted);
}
#attachment-preview #btn-cancel-attachment {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--composer-preview-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}
#attachment-preview .btn-cancel-reply::before {
    width: 16px;
    height: 16px;
}
@keyframes previewExpand {
    from { max-height: 0; opacity: 0; transform: scaleY(0.95); }
    to { max-height: 200px; opacity: 1; transform: scaleY(1); }
}
.composer-preview {
    display: flex !important;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    background: var(--composer-preview-surface);
    border-bottom: none;
    position: relative;
}
.composer-preview::after {
    display: none;
}
.composer-preview-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    flex: 0 0 28px;
    opacity: 0.96;
    border-radius: 50%;
    background: var(--composer-preview-accent-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 1;
}
.composer-preview-icon[data-mode="reply"]::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l-5-5 5-5'/%3E%3Cpath d='M5 12h9a5 5 0 0 1 5 5'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l-5-5 5-5'/%3E%3Cpath d='M5 12h9a5 5 0 0 1 5 5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.composer-preview-icon[data-mode="edit"]::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 1 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 1 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
@keyframes previewSlideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.reply-preview-container {
    display: flex;
    flex: 1;
    min-width: 0;
    position: relative;
    flex-direction: row;
    order: 3;
}
.composer-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    text-align: right;
    line-height: 1.3;
    order: 3;
}
.composer-preview-title {
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 2px;
}
.composer-preview-text {
    color: var(--composer-preview-text);
    font-size: 13px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    max-height: 1.4em;
    word-break: break-all;
    opacity: 1;
}
.reply-preview-right {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    flex-shrink: 0;
    order: 4;
    margin-inline-start: auto;
}
.composer-preview-close {
    background: none !important;
    border: none !important;
    color: var(--composer-preview-muted) !important;
    opacity: 0.65;
    cursor: pointer;
    padding: 0 !important;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    order: 4;
    margin-inline-start: auto;
}
.composer-preview-close::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat;
}
.composer-preview-close:hover {
    background-color: color-mix(in srgb, var(--line) 35%, transparent) !important;
    opacity: 1;
    color: var(--accent) !important;
}
#composer-previews.composer-previews-active + .composer-pill,
.composer-pill.composer-pill-previews-open {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top: none !important;
    margin-top: -1px !important; 
    box-shadow: none !important;
    background: var(--composer-previews-bg) !important; 
    backdrop-filter: blur(20px) !important;
}
.composer-pill {
    background: var(--composer-previews-bg);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 22px !important;
    transition: border-radius 0.2s ease;
}
.composer-pill:not(.composer-pill-previews-open) {
    border-radius: 22px !important;
    margin-top: 0 !important;
    border-top: none !important;
    background: var(--composer-previews-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}
@keyframes tgIconIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes tgIconOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.7); opacity: 0; }
}
.composer-icon-enter {
  animation: tgIconIn 0.14s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
.composer-icon-exit {
  animation: tgIconOut 0.12s ease-out forwards;
}
@keyframes tgComposerIconSettle {
  0% { transform: scale(0.72) rotate(-12deg); opacity: 0; }
  70% { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.composer-icon-swap-in .ic,
.composer-icon-swap-in svg:not(.spinner) {
  animation: tgComposerIconSettle 0.18s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  transform-origin: center center;
}
.reply-thread-header {
    display: flex;
    flex-direction: column;
    border-right: 4px solid var(--accent);
    padding-right: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2) !important; 
    border-radius: 6px;
    padding: 6px 10px;
    transition: background var(--t-snap);
    color: inherit;
}
.bubble.me .reply-thread-header {
    border-right-color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}
.bubble.me .reply-thread-sender,
.bubble.me .reply-thread-text {
    color: #ffffff !important;
}
.dark .bubble:not(.me) .reply-thread-header,
[data-theme="dark"] .bubble:not(.me) .reply-thread-header {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}
.reply-thread-sender {
    font-weight: bold;
    color: inherit;
    font-size: 0.8rem;
    margin-bottom: 2px;
}
.reply-thread-text {
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}
[data-theme="light"] .bubble:not(.me) .reply-thread-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-right-color: #000 !important;
    color: #000 !important;
}
[data-theme="light"] .bubble:not(.me) .reply-thread-sender,
[data-theme="light"] .bubble:not(.me) .reply-thread-text {
    color: #000 !important;
}
.daysep {
    transition: opacity 0.2s ease;
    opacity: 1;
}
.daysep-hidden {
    opacity: 0 !important;
}
.ticks-base {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    flex: 0 0 auto;
    color: inherit;
}
.ticks-read {
    color: #4caf50 !important;
}
.msg-link-me { color: #ffffff !important; text-decoration: underline !important; }
.msg-link-other { color: #007aff !important; text-decoration: underline !important; }
.dark .msg-link-other,
[data-theme="dark"] .msg-link-other {
    color: #ffffff !important;
}
.service-pill-clickable { cursor: pointer; }
.bubble-avatar { position: absolute; left: -44px; bottom: 0; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--out1)); box-shadow: 0 2px 8px rgba(0,0,0, 0.2); z-index: 2; }
.bubble-avatar img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.bubble.avatar-hidden .bubble-avatar { opacity: 0; visibility: hidden; }
.sender { width: 100%; box-sizing: border-box; text-align: left; direction: ltr; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.body { display: inline-block; position: relative; }
.msg-text.mt-4 { margin-top: 4px; }
.ticks-read-color { color: #81d4fa !important; }
.ticks-unread-color { color: rgba(255,255,255,0.7) !important; }
.d-block { display: block !important; }
.search-result-btn { width: 100%; text-align: right; margin-top: 8px; }
.modal-row-flex { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; transition: background 0.2s; }
.modal-row-grid { display: grid; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; margin-top: 4px; transition: all 0.2s ease; border: 1px solid transparent; }
.modal-row-grid:hover { background: var(--bg-hover); border-color: var(--line); transform: translateY(-1px); }
.media-grid-item-style {
    width: calc(33.33% - 8px);
    padding-bottom: calc(33.33% - 8px);
    margin: 4px;
    display: inline-block;
    background-color: #2c2c2c;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    vertical-align: top;
}
.media-grid-item-ext {
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 14px;
    font-weight: bold;
}
.picker-item-fallback {
    padding: 10px;
    text-align: center;
    word-break: break-all;
    font-size: 12px;
    color: var(--color-text-main);
}
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bubble { border-radius: 16px !important; }
.message-row.me .bubble, .bubble.me { border-bottom-right-radius: 0 !important; border-bottom-left-radius: 16px !important; }
.message-row:not(.me) .bubble, .bubble:not(.me) { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 16px !important; }
.meta-rtl-fix {
    float: right !important;
    clear: both !important;
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 4px !important;
    padding-bottom: 4px !important;
}
.sv-wrap {
    position: relative;
    display: flex;
    flex-shrink: 0;
}
.sv-btn-fill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.pointer-events-none { pointer-events: none !important; }
.pointer-events-auto { pointer-events: auto !important; }
.z-index-1 { z-index: 1 !important; }
.z-index-2 { z-index: 2 !important; }
.mic-halo-hidden { opacity: 0 !important; transition: none !important; }
.icon-transition { transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease !important; }
.icon-voice-inactive { transform: scale(0) rotate(-45deg) !important; opacity: 0 !important; }
.icon-voice-active { transform: scale(1) rotate(0deg) !important; opacity: 1 !important; }
.icon-send-inactive { transform: scale(0) rotate(45deg) !important; opacity: 0 !important; }
.icon-send-active { transform: scale(1) rotate(0deg) !important; opacity: 1 !important; }
.attach-icon-transition { transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease !important; }
.attach-icon-hidden { transform: scale(0) !important; opacity: 0 !important; }
.attach-icon-visible { transform: scale(1) !important; opacity: 1 !important; }
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes popOut {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
.icon-pop-in { 
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important; 
  transform-origin: center center !important;
}
.icon-pop-out { 
  animation: popOutFast 0.12s ease-in forwards !important; 
  transform-origin: center center !important;
  display: inline-flex !important;
}
@keyframes popOutFast {
  0% { transform: scale(1) translateX(0); opacity: 1; }
  100% { transform: scale(0.3) translateX(15px); opacity: 0; }
}
#btn-attach {
  transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1), margin 0.15s ease, padding 0.15s ease, opacity 0.1s ease;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  z-index: 2;
}
#btn-attach.hide-attach {
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}
.composer-pill.is-recording #btn-attach {
  display: none !important;
}
#btn-emoji, #btn-attach, #btn-send, #btn-voice {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

.lock-capsule-transform {
    opacity: 0.4 !important;
    transform: translateY(0) scale(1) !important;
}
.visibility-hidden { visibility: hidden !important; }
.visibility-visible { visibility: visible !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.position-relative { position: relative !important; }
.opacity-1 { opacity: 1 !important; }
.touch-action-none { touch-action: none !important; }
.ml-3px { margin-left: 3px !important; }
.voice-ui-hard-reset {
    justify-content: space-between !important;
    align-items: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.chevron-reset {
    display: none !important;
    position: static !important;
    margin: 0 !important;
}
.slide-wrap-static {
    opacity: 1 !important;
    display: flex !important;
    position: static !important;
    transform: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    pointer-events: none !important;
    flex: 1 !important;
    width: auto !important;
    margin: 0 auto !important;
}
.slide-text-reset {
    display: block !important;
    white-space: nowrap !important;
}
.slide-wrap-absolute {
    display: flex !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    justify-content: center !important;
    transform: none !important;
    margin: 0 auto !important;
    opacity: 1 !important;
    pointer-events: none !important;
}
.main-dot-reset {
    background-color: #ff3b30 !important;
    border-radius: 50% !important;
    display: none !important;
}
.btn-voice-reset {
    transform: none !important;
    background: var(--accent) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    color: white !important;
    --halo-scale: 1 !important;
    --ripple-scale: 1 !important;
    --ripple-opacity: 0 !important;
    border: none !important;
}
.mic-recording {
    background: var(--accent) !important;
    border-radius: 50% !important;
}
.tg-locked-overlay-style {
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 8px 0 16px !important;
    box-sizing: border-box !important;
    z-index: 5 !important;
    pointer-events: all !important;
}
.tg-overlay-inner {
    display: flex !important;
    align-items: center !important;
    position: absolute !important;
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}
.tg-mic-rec-dot {
    background-color: #ff3b30 !important;
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    display: block !important;
    animation: blink-record 1s infinite !important;
}
.tg-voice-timer-style {
    color: var(--fg) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-variant-numeric: tabular-nums !important;
}
.tg-voice-cancel-style {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    width: fit-content !important;
    color: var(--accent) !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
    letter-spacing: 0.2px !important;
    padding: 12px !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    z-index: 10 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.tg-voice-send-style {
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    background: var(--accent) !important;
    border-radius: 50% !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
    z-index: 20 !important;
    pointer-events: all !important;
    flex-shrink: 0 !important;
}
@keyframes blink-record {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}
.voice-lock-capsule-drag {
    transform: translateY(var(--lc-ty, 0)) scale(var(--lc-scale, 1)) !important;
    opacity: var(--lc-opacity, 1) !important;
}
.btn-voice-dragging {
    transform: scale(1.6) translateY(-4px) translateX(var(--bv-tx, 0)) !important;
}
.slide-wrap-dragging {
    opacity: var(--sw-opacity, 1) !important;
}
.btn-voice-locked {
    transform: scale(1) translateY(0) !important;
    background: var(--accent) !important;
    box-shadow: none !important;
}
.mic-send-icon-svg {
    transform: rotate(45deg) !important;
    width: 22px !important;
    height: 22px !important;
    margin-right: 2px !important;
}
.slide-text-active {
    display: block !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    pointer-events: none !important;
    position: static !important;
    transform: none !important;
    white-space: nowrap !important;
    text-align: center !important;
    margin: 0 auto !important;
}
.slide-wrap-active {
    display: flex !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    justify-content: center !important;
    pointer-events: none !important;
}
.chatlist li.active h4, 
.chatlist li.active .name {
    color: inherit !important;
}
.chat-avatar-tap {
    cursor: pointer;
}
.chat-avatar-preview {
    position: fixed;
    inset: 0;
    z-index: 12000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s linear, visibility 0.15s linear;
    pointer-events: none;
    backface-visibility: hidden;
}
.chat-avatar-preview.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.chat-avatar-preview__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.chat-avatar-preview__dialog {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    transform: scale(0.92);
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}
.chat-avatar-preview.active .chat-avatar-preview__dialog {
    transform: scale(1);
}
.chat-avatar-preview__avatar-wrapper {
    width: min(75vw, 380px);
    height: min(75vw, 380px);
    border-radius: 50%;
    perspective: 1000px;
    touch-action: none;
}
.chat-avatar-preview__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(48px, 12vw, 96px);
    font-weight: 700;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #222;
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
    pointer-events: none;
}
.chat-avatar-preview__avatar.is-interacting {
    transition: none !important;
}
.chat-avatar-preview__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chat-avatar-preview__name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.chat-avatar-preview__close {
    position: absolute;
    top: max(20px, env(safe-area-inset-top, 20px));
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.2s, transform 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.chat-avatar-preview__close:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.9);
}

#tg-locked-overlay {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.tg-overlay-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

#tg-voice-timer {
    color: var(--fg);
    font-size: 16px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

#tg-voice-cancel {
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}

.tg-voice-send {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 20;
}

.tg-voice-send svg {
    fill: white;
}.mic-recording {
    background: #e53935 !important;
}
.mic-recording .mic-halo,
.mic-recording .mic-ripple {
    background: radial-gradient(circle, rgba(229, 57, 53, 0.58) 0%, rgba(229, 57, 53, 0.22) 48%, transparent 82%) !important;
    box-shadow: 0 0 20px rgba(229, 57, 53, 0.36), 0 0 42px rgba(229, 57, 53, 0.18) !important;
}