/* --- Специфичные стили страницы чата --- */



/* Локальные переопределения переменных при необходимости */
:root {
    --composer-space: 94px;
    --keyboard-inset: 0px;
    --composer-bottom: calc(var(--keyboard-inset) + max(12px, env(safe-area-inset-bottom)));
}

html.is-keyboard-open {
    --composer-bottom: calc(var(--keyboard-inset) + 4px);
}

body {
    background: var(--bg);
    overflow: hidden; /* Чат не должен скроллить саму страницу */
    height: var(--app-height);
}

.chat-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--max-w);
    height: var(--app-height);
    min-height: 0;
    overflow: hidden;
    margin: 0 auto;
    background: var(--bg); /* Чистый серый (или темный) фон, без стекла и доп слоев */
    position: relative;
    z-index: 10;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}



.chat-highlights {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(15, 21, 65, 0.04);
    background: rgba(255, 255, 255, 0.4);
    scrollbar-width: none;
}

.chat-highlights::-webkit-scrollbar {
    display: none;
}

.chat-highlight {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    width: 58px;
    color: var(--text);
    text-align: center;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-highlight:hover {
    transform: translateY(-2px);
}

.chat-highlight-ring {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-highlight[data-chat-highlight="plan"] .chat-highlight-ring {
    background: linear-gradient(135deg, rgba(240, 74, 54, 0.12) 0%, rgba(255, 122, 107, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(240, 74, 54, 0.08), 0 0 0 1px rgba(240, 74, 54, 0.15);
}

.chat-highlight[data-chat-highlight="plan"]:hover .chat-highlight-ring {
    background: linear-gradient(135deg, var(--red) 0%, #ff7a6b 100%);
    box-shadow: 0 8px 24px rgba(240, 74, 54, 0.22), 0 0 10px rgba(240, 74, 54, 0.2);
}

.chat-highlight[data-chat-highlight="test"] .chat-highlight-ring {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(16, 185, 129, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.chat-highlight[data-chat-highlight="test"]:hover .chat-highlight-ring {
    background: linear-gradient(135deg, var(--blue) 0%, var(--mint) 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22), 0 0 10px rgba(37, 99, 235, 0.2);
}

.chat-highlight-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    color: var(--ink);
    transition: all 0.25s ease;
}

.chat-highlight:hover .chat-highlight-icon {
    background: transparent;
}

.chat-highlight[data-chat-highlight="plan"]:hover .chat-highlight-icon {
    color: #ffffff;
}

.chat-highlight[data-chat-highlight="test"]:hover .chat-highlight-icon {
    color: #ffffff;
}

.chat-highlight-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
}

.chat-highlight:hover .chat-highlight-icon svg {
    transform: scale(1.1);
}

.chat-highlight strong {
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.1px;
}

.chat-shell {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 14px 14px 104px;
}

.chat-thread {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 0 14px;
    /* НЕ scroll-behavior: smooth — scrollThread() в hub-chat.js ставит
       scrollTop трижды подряд (сразу + rAF + 140мс) и дёргается на каждом
       resize клавиатуры; smooth-анимация (~500мс) не успевает, и тред
       визуально «гонится» за низом. Прокрутка намеренно мгновенная. */
    -webkit-overflow-scrolling: touch;

    /* Elegant Custom Scrollbars */
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 21, 65, 0.1) transparent;
}

.chat-thread::-webkit-scrollbar {
    width: 6px;
}
.chat-thread::-webkit-scrollbar-track {
    background: transparent;
}
.chat-thread::-webkit-scrollbar-thumb {
    background: rgba(15, 21, 65, 0.1);
    border-radius: 99px;
}
.chat-thread::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 21, 65, 0.2);
}

@keyframes chatBubbleAppear {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(14px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    animation: chatBubbleAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-message--user {
    justify-content: flex-end;
}

.chat-message--system {
    justify-content: center;
}

.chat-action-row {
    display: flex;
    padding-left: 40px;
}

.chat-call-action {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(255, 59, 34, 0.22);
    border-radius: 999px;
    background: #fff;
    color: var(--red);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(16, 17, 22, 0.05);
}

.chat-call-action:active {
    border-color: rgba(255, 59, 34, 0.36);
    background: rgba(255, 59, 34, 0.06);
}

.chat-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center; /* Показываем лицо целиком, не обрезая макушку */
    box-shadow: none; /* Убираем тень полностью для идеальной чистоты Clean UI */
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    background: #f1f5f9;
}

.chat-message--stacked {
    margin-top: -6px; /* Уменьшаем вертикальный отступ между сгруппированными пузырями */
}

.chat-message--stacked.chat-message--expert {
    padding-left: 42px; /* 34px аватарка + 8px gap */
}

/* Красивые плавные углы для сгруппированных пузырей без аватарки */
.chat-message--stacked.chat-message--expert .chat-bubble,
.chat-message--stacked.chat-message--typing .chat-bubble {
    border-radius: 6px 18px 18px 18px;
}

.chat-bubble {
    max-width: min(86%, 380px);
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 18px 18px 18px 6px;
    background: var(--composer-bg, rgba(255, 255, 255, 0.75));
    box-shadow: 0 4px 20px rgba(15, 21, 65, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.chat-bubble p {
    color: inherit;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.1px;
}

.chat-message--user .chat-bubble {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    box-shadow: 0 10px 25px rgba(15, 21, 65, 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.chat-message--system .chat-bubble {
    max-width: 92%;
    border-radius: 12px;
    background: rgba(16, 17, 22, 0.05);
    color: var(--muted);
    box-shadow: none;
}

.chat-message--typing .chat-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 36px;
    padding: 0;
    border-radius: 18px 18px 18px 6px;
}

.chat-message--stacked.chat-message--typing .chat-bubble {
    border-radius: 6px 18px 18px 18px; /* Скругление stacked индикатора */
}

.chat-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-typing-dots span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    opacity: 0.4;
    animation: chatTypingDot 1.4s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTypingDot {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.chat-bubble p + p {
    margin-top: 8px;
}

.chat-bubble strong {
    color: var(--ink);
    font-weight: 700;
}

.chat-message--user .chat-bubble strong {
    color: var(--ink);
    font-weight: 700;
}

.chat-bubble a {
    color: inherit;
    font-weight: 850;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.chat-file-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.chat-file-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(15, 21, 65, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.chat-message--user .chat-file-chip {
    border-color: rgba(16, 17, 22, 0.1);
    background: rgba(255, 255, 255, 0.18);
    color: var(--ink);
}

.chat-file-chip svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.chat-file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-status {
    margin: 0 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    text-align: center;
}

.chat-composer {
    position: fixed;
    right: auto;
    bottom: var(--composer-bottom);
    left: 50%;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(calc(100% - 24px), calc(var(--max-w) - 24px));
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--composer-bg, rgba(255, 255, 255, 0.85));
    box-shadow: 0 10px 40px rgba(15, 21, 65, 0.08);
    transform: translateX(-50%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    transition: all 0.3s ease;
}



.chat-composer.is-hidden {
    display: none;
}

.chat-composer.is-contact-mode .chat-composer-row,
.chat-composer.is-contact-mode .chat-attachments {
    display: none;
}

.chat-composer input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.chat-composer-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: end;
    gap: 8px;
}

.chat-attach {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(15, 21, 65, 0.04);
    border-radius: 50%;
    background: rgba(241, 245, 249, 0.6);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.25s ease;
}

.chat-attach:hover {
    background: rgba(241, 245, 249, 0.95);
    color: var(--ink);
    transform: scale(1.05);
}

.chat-attach svg {
    width: 18px;
    height: 18px;
}

.chat-input {
    display: block;
    width: 100%;
    max-height: 132px;
    min-height: 40px;
    padding: 9px 14px;
    resize: none;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    outline: none;
    background: var(--card);
    color: var(--ink);
    font-size: 16px;
    font-weight: 550;
    line-height: 1.35;
    transition: all 0.25s ease;
}

.chat-input:focus {
    border-color: rgba(240, 74, 54, 0.35);
    box-shadow: 0 0 0 3px rgba(240, 74, 54, 0.08);
}

.chat-send,
.chat-contact-submit {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red) 0%, #ff6b57 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(240, 74, 54, 0.2);
    transition: all 0.25s ease;
}

.chat-send {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
}

.chat-send svg {
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
}

.chat-send:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(240, 74, 54, 0.3);
}

.chat-send:not(:disabled):hover svg {
    transform: translateX(2px);
}

.chat-send:disabled,
.chat-contact-submit:disabled {
    background: rgba(226, 232, 240, 0.8) !important;
    color: #94a3b8;
    box-shadow: none;
    transform: none;
}

.chat-send:not(:disabled):active,
.chat-contact-submit:not(:disabled):active {
    background: var(--red-hover);
    transform: scale(0.98);
}

.chat-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 7px 8px 7px 9px;
    border: 1px solid rgba(15, 21, 65, 0.08);
    border-radius: 999px;
    background: var(--soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.chat-attachment-thumb {
    display: block;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    object-fit: cover;
}

.chat-attachment-remove {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 17, 22, 0.08);
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.chat-attachment-remove:active {
    background: rgba(255, 59, 34, 0.12);
    color: var(--red);
}

.chat-attachment-pill[data-state="uploading"] {
    color: var(--muted);
}

.chat-attachment-pill[data-state="error"] {
    border-color: rgba(255, 59, 34, 0.24);
    background: rgba(255, 59, 34, 0.07);
    color: var(--red);
}

.chat-attachment-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-contact-card {
    display: flex;
    flex-direction: column;
    width: calc(100% - 42px);
    max-width: 400px;
    margin: 3px 0 16px 42px;
    padding: 18px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--red);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 16px 34px rgba(16, 17, 22, 0.08);
}

.chat-contact-card::before {
    content: "РЕКОМЕНДУЕМ";
    display: inline-block;
    align-self: start;
    width: fit-content;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-contact-panel {
    display: grid;
    gap: 10px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-contact-panel[hidden] {
    display: none;
}

.chat-contact-panel-title {
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}

.chat-contact-panel-fields,
.chat-contact-panel-actions {
    display: grid;
    gap: 8px;
}

.chat-contact-panel-fields {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.chat-contact-panel-actions {
    grid-template-columns: 1fr;
    align-items: end;
}

.chat-contact-panel label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.1;
}

.chat-contact-panel input,
.chat-contact-panel select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: var(--soft);
    color: var(--ink);
    font-size: 14px;
    font-weight: 720;
}

.chat-contact-panel input:focus,
.chat-contact-panel select:focus {
    border-color: rgba(255, 59, 34, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 59, 34, 0.12);
}

.chat-contact-panel .chat-contact-submit {
    min-height: 44px;
}

.chat-contact-panel .chat-contact-panel-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 0;
    font-size: 11px;
    line-height: 1.28;
}

.chat-contact-panel .chat-contact-panel-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin-top: 1px;
    padding: 0;
    border-radius: 4px;
}

.chat-contact-continue {
    justify-self: center;
    min-height: 30px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.chat-contact-continue:active {
    color: var(--red);
}

.chat-contact-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.chat-contact-card h2 {
    min-width: 0;
    color: var(--ink);
    font-size: 21px;
    font-weight: 950;
    line-height: 1.15;
}

.chat-contact-close {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--soft);
    color: var(--muted);
    font-size: 24px;
    font-weight: 520;
    line-height: 1;
}

.chat-contact-close:active {
    background: rgba(255, 59, 34, 0.08);
    color: var(--red);
}

.chat-contact-card p {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
}

.chat-contact-card form {
    display: grid;
    gap: 14px;
}

.chat-contact-grid {
    display: grid;
    gap: 14px;
}

.chat-contact-grid label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.15;
}

.chat-contact-grid input,
.chat-contact-grid select {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    outline: none;
    background: var(--soft);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
}

.chat-contact-grid input:focus,
.chat-contact-grid select:focus {
    border-color: rgba(255, 59, 34, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 59, 34, 0.12);
}

.chat-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.32;
}

.chat-consent input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.chat-consent a {
    color: var(--text);
    font-weight: 850;
}

.chat-contact-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 0;
    font-size: 15px;
}

.chat-contact-secondary {
    min-height: 42px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.chat-contact-secondary:active {
    color: var(--red);
}

.chat-error {
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
}

.chat-done {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(45, 191, 91, 0.1);
    color: #17723a;
    font-size: 13px;
    font-weight: 850;
}

@media (max-width: 360px) {
    .chat-header-brand img {
        width: 140px;
    }

    .chat-call-action {
        padding-inline: 12px;
        font-size: 13px;
    }

    .chat-shell {
        padding-inline: 10px;
    }

    .chat-contact-card {
        width: calc(100% - 38px);
        margin-left: 38px;
        padding: 17px;
    }

    .chat-contact-panel-fields,
    .chat-contact-panel-actions {
        grid-template-columns: 1fr;
    }
}



.chat-composer.is-contact-mode {
    border-top: 3px solid var(--red);
    box-shadow: 0 -8px 30px rgba(255, 59, 34, 0.12), 0 -10px 34px rgba(16, 17, 22, 0.1);
}

/* Suggestion Chips */
.chat-suggestions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 42px 12px;
    transition: opacity 0.3s ease;
}

.chat-suggestions-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chat-suggestion {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--composer-bg, rgba(255, 255, 255, 0.85));
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(16, 17, 22, 0.02);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
}

.chat-suggestion::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
}

.chat-suggestion:hover::before {
    left: 180%;
    transition: left 0.95s ease-in-out;
}

.chat-suggestion:hover,
.chat-suggestion:active {
    border-color: rgba(255, 59, 34, 0.36);
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(255, 59, 34, 0.08), 0 0 10px rgba(255, 59, 34, 0.06) inset;
    transform: translateY(-2px) scale(1.02);
}

/* Специфика шапки для ИИ-чата (убираем подложку и границу) */
.hub-header {
    --header-bg: transparent;
    border-bottom: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}



/* Trust strip под шапкой: та же статистика, что на гейт-страницах */
.chat-trust {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 8px 20px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.45);
}

.chat-trust div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.chat-trust strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.chat-trust span {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.25;
    white-space: nowrap;
}

/* Мост чат→тест: карточка в треде после первого ответа Алины */
.chat-test-bridge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 2px 42px 6px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 59, 34, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 18px rgba(16, 17, 22, 0.04);
    animation: chatBubbleAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-test-bridge span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.chat-test-bridge strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.35;
}

.chat-test-bridge a {
    margin-top: 6px;
    align-self: flex-start;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.chat-test-bridge a:hover {
    background: var(--red-hover);
}

/* Ссылка Алины на страницу хаба: кнопка вместо сырого URL в пузыре */
.chat-bubble .chat-link-cta {
    display: block;
    width: fit-content;
    margin-top: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.chat-bubble .chat-link-cta:hover {
    background: var(--red-hover);
}
