:root {
    color-scheme: dark;
    --chat-bg: #0d1018;
    --chat-thread-background: #07131F;
    --chat-panel: rgba(17, 22, 34, 0.92);
    --chat-panel-strong: rgba(19, 25, 39, 0.98);
    --chat-stroke: rgba(116, 125, 166, 0.18);
    --chat-text: #edf1fb;
    --chat-muted: #9ba8c7;
    --chat-accent: #7d8cff;
    --chat-accent-soft: rgba(112, 124, 255, 0.18);
    --chat-accent-soft-strong: rgba(112, 124, 255, 0.28);
    --chat-accent-border: rgba(166, 180, 255, 0.26);
    --chat-accent-ring: rgba(125, 140, 255, 0.34);
    --chat-header-gradient: linear-gradient(180deg, rgba(33, 41, 72, 0.98), rgba(10, 14, 25, 0.92));
    --chat-header-glow: 0 18px 42px rgba(125, 140, 255, 0.24);
    --chat-header-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --chat-header-border: rgba(166, 180, 255, 0.16);
    --chat-brand-surface:
        radial-gradient(circle at left top, rgba(121, 247, 255, 0.16), transparent 46%),
        linear-gradient(135deg, rgba(28, 22, 52, 0.92), rgba(11, 15, 28, 0.96));
    --chat-brand-border: rgba(166, 180, 255, 0.18);
    --chat-brand-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 14px 30px rgba(1, 4, 12, 0.22),
        0 0 24px rgba(139, 92, 246, 0.16);
    --chat-day-chip-background: rgba(30, 40, 61, 0.75);
    --chat-day-chip-text: #9ba8c7;
    --chat-day-chip-shadow: inset 0 0 0 1px rgba(139, 151, 192, 0.08);
    --chat-action-surface: rgba(24, 31, 47, 0.6);
    --chat-action-surface-border: rgba(139, 151, 192, 0.12);
    --chat-action-surface-shadow: inset 0 0 0 1px rgba(139, 151, 192, 0.12);
    --chat-action-surface-hover: rgba(30, 38, 58, 0.76);
    --chat-action-surface-hover-shadow: 0 8px 18px rgba(1, 4, 12, 0.16), inset 0 0 0 1px rgba(139, 151, 192, 0.14);
    --chat-cta-gradient: linear-gradient(135deg, rgba(125, 58, 237, 0.96), rgba(168, 85, 247, 0.92) 52%, rgba(219, 39, 119, 0.88));
    --chat-cta-gradient-hover: linear-gradient(135deg, rgba(139, 92, 246, 0.98), rgba(192, 132, 252, 0.94) 52%, rgba(236, 72, 153, 0.9));
    --chat-cta-border: rgba(196, 132, 252, 0.44);
    --chat-cta-shadow: rgba(139, 92, 246, 0.26);
    --chat-cta-text: #FFFFFF;
    --chat-outgoing: linear-gradient(180deg, rgba(115, 96, 196, 0.92), rgba(79, 74, 158, 0.96));
    --chat-incoming: linear-gradient(180deg, rgba(28, 35, 53, 0.96), rgba(21, 28, 43, 0.98));
    --chat-incoming-text: #edf1fb;
    --chat-incoming-meta: rgba(226, 233, 255, 0.72);
    --chat-shadow: 0 18px 40px rgba(1, 4, 12, 0.42);
    --chat-radius: 22px;
    --chat-font-size: 16px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --app-height: 100dvh;
    --viewport-height: 100dvh;
    --keyboard-offset: 0px;
    --composer-height: 114px;
    --composer-side-gap: 10px;
    --composer-bottom-gap: 10px;
    --chat-launcher-glow: rgba(125, 140, 255, 0.32);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-text-size-adjust: 100%;
    background:
        radial-gradient(circle at top, rgba(58, 69, 110, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(72, 44, 122, 0.16), transparent 26%),
        var(--chat-bg);
    color: var(--chat-text);
    font-family: "SF Pro Display", "Segoe UI", sans-serif;
    font-size: var(--chat-font-size);
    overscroll-behavior: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='%235f4aa0' stroke-opacity='.23' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M27 28c7 2 10 9 8 18-5 1-11-1-15-6-3-5-2-10 7-12Z'/%3E%3Cpath d='M98 26c6 0 10 4 10 10s-4 10-10 10-10-4-10-10 4-10 10-10Z'/%3E%3Cpath d='M132 20c9 3 16 10 18 20-9 1-18-2-23-8-5-6-3-11 5-12Z'/%3E%3Cpath d='M26 88h18m-9-9v18'/%3E%3Cpath d='M70 76c10 0 18 7 18 16 0 10-8 17-18 17-2 0-4 0-6-1l-8 5 2-9c-4-3-6-7-6-12 0-9 8-16 18-16Z'/%3E%3Cpath d='M126 78c8 4 14 10 16 19-10 1-19-2-25-8-5-6-3-10 9-11Z'/%3E%3Cpath d='M20 142c10-1 19 4 23 12-7 5-17 6-25 2-8-4-8-11 2-14Z'/%3E%3Cpath d='M84 142c6-7 15-9 24-6-2 9-8 16-17 18-9 2-13-3-7-12Z'/%3E%3Cpath d='M133 138c11 2 18 9 21 19-9 2-18 0-24-6-6-6-5-11 3-13Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 180px 180px;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
textarea,
input {
    font: inherit;
}

button {
    border: 0;
    background: none;
    color: inherit;
    padding: 0;
}

.public-chat-app {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100vw;
    min-height: var(--app-height);
    height: var(--app-height);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-y;
}

.public-chat-app[data-embed-mode="true"],
.public-chat-app[data-widget-mode="true"] {
    border-radius: 28px;
}

.public-chat-app[data-widget-mode="true"] {
    --chat-font-size-header-title: clamp(12px, calc(var(--chat-font-size) * 0.9375), 22px);
    --chat-font-size-header-meta: clamp(10px, calc(var(--chat-font-size) * 0.75), 18px);
    --chat-font-size-message: clamp(12px, calc(var(--chat-font-size) * 0.9375), 22px);
    --chat-font-size-chip: clamp(11px, calc(var(--chat-font-size) * 0.8125), 20px);
    --chat-font-size-chip-compact: clamp(10px, calc(var(--chat-font-size) * 0.75), 18px);
    overflow: hidden;
    background: var(--chat-header-gradient);
    isolation: isolate;
}

.public-chat-app[data-widget-mode="true"] .chat-shell {
    width: 100%;
    max-width: none;
    min-height: 100%;
    padding-top: 0;
    overflow: hidden;
    border-radius: inherit;
    background: transparent;
    box-shadow: none;
}

.public-chat-app[data-chat-link-mode="true"] .chat-shell {
    width: min(100%, 820px);
    max-width: 820px;
    margin: 0 auto;
}

.chat-shell {
    position: relative;
    z-index: 1;
    min-height: var(--app-height);
    height: var(--app-height);
    max-height: var(--app-height);
    display: flex;
    flex-direction: column;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    overscroll-behavior: none;
}

.chat-header {
    position: relative;
    z-index: 6;
    display: grid;
    gap: 12px;
    overflow: hidden;
    isolation: isolate;
    padding:
        calc(10px + var(--safe-top))
        calc(12px + var(--safe-right))
        12px
        calc(12px + var(--safe-left));
    background: var(--chat-header-gradient);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--chat-header-border);
    box-shadow: var(--chat-header-glow), var(--chat-header-inner-glow);
}

.public-chat-app[data-widget-mode="true"] .chat-header {
    margin: 0;
    border-radius: 28px 28px 0 0;
}

.public-chat-app[data-widget-mode="true"] .chat-header::before {
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
}

.chat-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.2), transparent 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%);
    pointer-events: none;
    z-index: -1;
}

.chat-header-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.chat-header-actions {
    display: flex;
    justify-content: flex-end;
}

.chat-top-cta {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    max-height: 56px;
    padding: 8px calc(12px + var(--safe-right)) 0 calc(12px + var(--safe-left));
    background: transparent;
    overflow: hidden;
}

.chat-top-cta .platform-login {
    width: 100%;
    max-width: 560px;
    min-height: 40px;
    max-height: 48px;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-build-meta {
    display: flex;
    justify-content: flex-end;
}

.chat-build-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(122, 252, 255, 0.2);
    background: rgba(122, 252, 255, 0.08);
    color: #c9fbff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chat-back,
.chat-menu,
.composer-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d8e0f5;
    background: var(--chat-action-surface);
    border: 1px solid var(--chat-action-surface-border);
    box-shadow: var(--chat-action-surface-shadow);
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.chat-back svg,
.chat-menu svg,
.composer-icon svg,
.platform-login svg,
.attachment-chip-remove svg,
.message-file-badge svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.public-chat-app[data-widget-mode="true"] .chat-back:hover,
.public-chat-app[data-widget-mode="true"] .chat-menu:hover,
.public-chat-app[data-widget-mode="true"] .composer-icon:hover {
    background: var(--chat-action-surface-hover);
    box-shadow: var(--chat-action-surface-hover-shadow);
    transform: translateY(-1px);
}

.chat-identity {
    display: grid;
    justify-items: center;
    gap: 12px;
    min-width: 0;
    width: min(100%, 244px);
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid var(--chat-brand-border);
    background: var(--chat-brand-surface);
    box-shadow: var(--chat-brand-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    justify-self: center;
    text-align: center;
}

.chat-avatar {
    width: clamp(120px, 11vw, 132px);
    max-width: 100%;
    height: auto;
    max-height: 132px;
    object-fit: contain;
    display: block;
    filter:
        drop-shadow(0 18px 38px rgba(122, 252, 255, 0.12))
        drop-shadow(0 16px 34px rgba(124, 58, 237, 0.18));
}

.chat-identity-copy {
    display: grid;
    gap: 4px;
    justify-items: center;
    min-width: 0;
}

.chat-brand-name {
    display: block;
    font-size: clamp(1.95rem, 2.8vw, 2.4rem);
    font-weight: 800;
    line-height: 0.94;
    letter-spacing: -0.05em;
    white-space: nowrap;
    background: linear-gradient(90deg, #7afcff 0%, #7dd3fc 28%, #9f8bff 68%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.chat-brand-subtitle {
    display: block;
    color: rgba(232, 242, 255, 0.76);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.public-chat-app[data-widget-mode="true"] .chat-identity {
    display: flex;
    align-items: center;
    justify-self: start;
    width: auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    gap: 12px;
    text-align: left;
}

.public-chat-app[data-widget-mode="true"] .chat-avatar {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 24px rgba(7, 12, 24, 0.22);
    filter: none;
}

.public-chat-app[data-widget-mode="true"] .chat-brand-name {
    font-size: clamp(1.72rem, 6vw, 2rem);
    background: none;
    -webkit-background-clip: initial;
    background-clip: border-box;
    color: var(--chat-cta-text, #ffffff);
    line-height: 1.02;
    text-shadow: 0 1px 14px rgba(7, 12, 24, 0.22);
}

.public-chat-app[data-widget-mode="true"] .chat-identity-copy {
    justify-items: start;
    gap: 2px;
}

.public-chat-app[data-widget-mode="true"] .chat-identity-copy strong {
    font-size: var(--chat-font-size-header-title);
}

.public-chat-app[data-widget-mode="true"] .chat-brand-subtitle {
    color: rgba(247, 250, 255, 0.82);
    font-size: var(--chat-font-size-header-meta);
    letter-spacing: 0.14em;
}

.platform-login {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--chat-cta-gradient);
    border: 1px solid var(--chat-cta-border);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 24px var(--chat-cta-shadow);
    backdrop-filter: blur(16px);
    transition: 180ms ease;
}

.platform-login svg {
    color: currentColor;
    flex: 0 0 auto;
}

.platform-login:hover,
.platform-login:active {
    border-color: var(--chat-accent-ring);
    background: var(--chat-cta-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 32px var(--chat-launcher-glow);
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    max-height: 116px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0 4px;
}

.quick-reply-chip {
    min-width: 0;
    max-width: 100%;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--chat-accent-soft);
    color: var(--chat-text);
    border: 1px solid var(--chat-accent-border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    overflow-wrap: anywhere;
}

.public-chat-app[data-widget-mode="true"] .quick-reply-chip {
    font-size: var(--chat-font-size-chip);
}

.contact-request-banner {
    display: grid;
    gap: 10px;
    margin: 0 4px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(19, 25, 39, 0.76);
    border: 1px solid var(--chat-accent-border);
    box-shadow: 0 12px 28px rgba(1, 4, 12, 0.22), inset 0 0 0 1px rgba(255,255,255,0.02);
}

.contact-request-title {
    font-size: 13px;
    font-weight: 700;
    color: #d6def6;
}

.public-chat-app[data-widget-mode="true"] .contact-request-title {
    font-size: var(--chat-font-size-chip);
}

.contact-request-fields {
    display: grid;
    gap: 10px;
}

.contact-request-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.contact-request-field {
    display: grid;
    gap: 6px;
}

.contact-request-field-label {
    color: #d6def6;
    font-size: 12px;
    font-weight: 700;
}

.contact-request-input {
    min-height: 42px;
    width: 100%;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(139, 151, 192, 0.16);
    background: rgba(8, 12, 21, 0.34);
    color: #f4f8ff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.contact-request-input::placeholder {
    color: rgba(189, 199, 224, 0.62);
}

.contact-request-input[aria-invalid="true"],
.contact-request-consent input[aria-invalid="true"] {
    border-color: rgba(248, 113, 113, 0.56);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.38);
}

.public-chat-app[data-widget-mode="true"] .contact-request-field-label {
    font-size: var(--chat-font-size-chip-compact);
}

.contact-request-consent {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--chat-muted);
    font-size: 12px;
    line-height: 1.45;
}

.public-chat-app[data-widget-mode="true"] .contact-request-consent {
    font-size: var(--chat-font-size-chip-compact);
}

.contact-request-consent input {
    margin-top: 2px;
    accent-color: var(--chat-accent);
}

.contact-request-consent a {
    color: #d9e6ff;
    text-decoration: underline;
}

.contact-request-actions {
    display: flex;
    justify-content: flex-start;
}

.contact-request-submit {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--chat-cta-gradient);
    border: 1px solid var(--chat-cta-border);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 10px 20px var(--chat-cta-shadow);
}

.contact-request-error {
    color: #f8b4b4;
    font-size: 11px;
    line-height: 1.35;
}

.contact-request-success {
    color: #d6def6;
    font-size: 12px;
    line-height: 1.45;
}

.social-strip {
    position: relative;
    z-index: 5;
    display: grid;
    gap: 10px;
    padding: 10px calc(12px + var(--safe-right)) 12px calc(12px + var(--safe-left));
    background: linear-gradient(180deg, rgba(12, 16, 25, 0.88), rgba(12, 16, 25, 0.7));
    backdrop-filter: blur(16px);
}

.social-strip-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--chat-muted);
}

.social-strip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 4px 4px;
    scrollbar-width: none;
}

.social-strip-row::-webkit-scrollbar {
    display: none;
}

.social-link {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid rgba(120, 130, 168, 0.14);
    background: rgba(22, 29, 45, 0.72);
    color: #e5ebff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.social-link-icon {
    width: 24px;
    height: 24px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.social-link-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.social-link-label {
    font-size: 12px;
    font-weight: 600;
}

.social-link--overflow {
    cursor: pointer;
}

.social-link-icon--overflow {
    font-size: 18px;
    font-weight: 700;
}

.social-link--youtube .social-link-icon {
    background: rgba(255, 37, 73, 0.2);
    color: #ff355d;
}

.social-link--youtube svg {
    fill: currentColor;
}

.social-link--rutube .social-link-icon {
    background: linear-gradient(135deg, rgba(0, 120, 255, 0.28), rgba(38, 174, 255, 0.18));
    color: #39a9ff;
}

.social-link--rutube svg {
    fill: currentColor;
}

.social-link--instagram .social-link-icon {
    background: linear-gradient(135deg, #f9ce34, #ee2a7b 52%, #6228d7);
    color: #ffffff;
}

.social-link--instagram svg {
    fill: currentColor;
}

.social-link--tiktok .social-link-icon {
    background: linear-gradient(135deg, rgba(22, 23, 28, 0.95), rgba(35, 37, 46, 0.95));
    color: #f7fbff;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        -1px 0 0 rgba(37, 244, 238, 0.65),
        1px 0 0 rgba(254, 44, 85, 0.55);
}

.social-link--tiktok svg {
    fill: currentColor;
}

.social-link--likee .social-link-icon {
    background: linear-gradient(135deg, #ff5ca8, #8d5cff 55%, #ffcf5a);
    color: #ffffff;
}

.social-link--likee svg {
    fill: currentColor;
}

.social-link--dzen .social-link-icon {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.28), rgba(255, 189, 63, 0.16));
    color: #ff9b21;
}

.social-link--dzen svg {
    fill: currentColor;
}

.social-link--vc .social-link-icon {
    background: linear-gradient(135deg, rgba(72, 118, 255, 0.28), rgba(66, 184, 255, 0.16));
    color: #7eb8ff;
}

.social-link--vc svg {
    fill: currentColor;
}

.social-link--vk .social-link-icon {
    background: linear-gradient(135deg, rgba(39, 135, 245, 0.24), rgba(93, 174, 255, 0.18));
    color: #53a3ff;
}

.social-link--vk svg {
    fill: currentColor;
}

.social-link--telegram .social-link-icon {
    background: linear-gradient(135deg, rgba(27, 164, 255, 0.24), rgba(98, 203, 255, 0.18));
    color: #47bbff;
}

.social-link--telegram svg {
    fill: currentColor;
}

.social-link--max .social-link-icon {
    background: linear-gradient(135deg, rgba(44, 205, 165, 0.24), rgba(121, 238, 211, 0.18));
    color: #3fd9b0;
}

.social-link--max svg {
    fill: currentColor;
}

.social-link--whatsapp .social-link-icon {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.24), rgba(103, 242, 148, 0.18));
    color: #4ce081;
}

.social-link--whatsapp svg {
    fill: currentColor;
}

.social-link--site .social-link-icon {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.24), rgba(203, 213, 225, 0.18));
    color: #d9e2ef;
}

.social-link--site svg {
    fill: currentColor;
}

.social-link--phone .social-link-icon,
.social-link--email .social-link-icon,
.social-link--other .social-link-icon {
    background: linear-gradient(135deg, rgba(161, 173, 196, 0.24), rgba(222, 230, 243, 0.16));
    color: #eef3ff;
}

.social-link--phone svg,
.social-link--email svg,
.social-link--other svg {
    fill: currentColor;
}

.chat-thread,
.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding:
        12px
        calc(10px + var(--safe-right))
        calc(var(--composer-height) + var(--keyboard-offset) + 28px + var(--safe-bottom))
        calc(10px + var(--safe-left));
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    transition: padding-bottom 180ms ease;
}

.public-chat-app[data-widget-mode="true"] .chat-thread {
    background-color: var(--chat-thread-background);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        url("data:image/svg+xml,%3Csvg width='188' height='188' viewBox='0 0 188 188' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='white' stroke-opacity='.12' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M24 32c8 1 13 7 12 16-6 2-12 0-16-5-4-5-3-10 4-11Z'/%3E%3Cpath d='M93 24c8 0 14 5 14 12s-6 12-14 12-14-5-14-12 6-12 14-12Z'/%3E%3Cpath d='M141 24c10 3 17 10 20 20-10 2-19-1-25-7-5-6-4-11 5-13Z'/%3E%3Cpath d='M34 86h18m-9-9v18'/%3E%3Cpath d='M74 74c11 0 20 8 20 17 0 11-9 18-20 18-2 0-4 0-6-1l-9 5 2-9c-4-3-7-8-7-13 0-9 9-17 20-17Z'/%3E%3Cpath d='M136 80c8 4 15 11 18 20-11 1-20-2-26-8-5-6-4-11 8-12Z'/%3E%3Cpath d='M22 146c10-2 20 3 25 11-8 5-18 6-26 2-8-4-8-11 1-13Z'/%3E%3Cpath d='M84 142c7-7 16-9 25-6-1 10-8 17-18 19-9 2-13-4-7-13Z'/%3E%3Cpath d='M140 142c11 2 19 9 22 19-10 2-19 0-26-6-6-6-5-11 4-13Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: auto, 188px 188px;
    background-position: center, center;
    background-repeat: repeat, repeat;
}

.composer-emoji {
    flex: 0 0 auto;
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px 0;
}

.emoji-chip {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(24, 31, 47, 0.72);
    border: 1px solid rgba(139, 151, 192, 0.12);
    font-size: 20px;
}

.chat-day-chip {
    align-self: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--chat-day-chip-background);
    color: var(--chat-day-chip-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--chat-day-chip-shadow);
}

.public-chat-app[data-widget-mode="true"] .chat-day-chip {
    font-size: var(--chat-font-size-chip-compact);
}

.chat-loading {
    align-self: center;
    display: inline-flex;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 999px;
    background: rgba(24, 31, 47, 0.74);
}

.chat-thread-error {
    margin: auto 0;
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(22, 28, 42, 0.96), rgba(16, 21, 34, 0.98));
    border: 1px solid rgba(130, 139, 176, 0.12);
    box-shadow: var(--chat-shadow);
    color: var(--chat-text);
}

.chat-thread-error strong {
    font-size: 15px;
    font-weight: 700;
}

.chat-thread-error p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--chat-muted);
}

.chat-thread-retry {
    min-height: 42px;
    justify-self: start;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(66, 92, 255, 0.18);
    color: #f7fbff;
    box-shadow: inset 0 0 0 1px rgba(130, 165, 255, 0.18);
    font-weight: 700;
}

.chat-thread-retry:disabled {
    opacity: 0.6;
}

.typing-dot,
.typing-indicator .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ba8c7;
    opacity: 0.5;
    animation: typingPulse 1.1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

.message-row {
    display: flex;
}

.message-row.ai {
    justify-content: flex-start;
}

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

.message-bubble {
    max-width: min(100%, 460px);
    padding: 10px 12px 8px;
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    border: 1px solid rgba(130, 139, 176, 0.08);
}

.message-row.ai .message-bubble {
    background: var(--chat-incoming);
    color: var(--chat-incoming-text);
    border-top-left-radius: 10px;
}

.message-row.user .message-bubble {
    background: var(--chat-outgoing);
    border-top-right-radius: 10px;
}

.message-text {
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.public-chat-app[data-widget-mode="true"] .message-text {
    font-size: var(--chat-font-size-message);
}

.message-row.ai .message-text {
    color: inherit;
}

.message-media-stack {
    display: grid;
    gap: 8px;
    justify-items: start;
    margin-bottom: 8px;
}

.message-row.user .message-media-stack {
    justify-items: end;
}

.message-image {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(38vh, 280px);
    object-fit: contain;
    border-radius: inherit;
}

.message-image-link {
    display: inline-block;
    width: fit-content;
    max-width: min(52vw, 260px);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(12, 18, 28, 0.38);
    box-shadow:
        0 12px 24px rgba(1, 4, 12, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.message-voice-card {
    --voice-progress: 0%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: min(250px, 100%);
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(8, 12, 21, 0.24);
}

.message-voice-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-cta-gradient);
    box-shadow: 0 10px 20px var(--chat-cta-shadow);
    color: #ffffff;
}

.message-voice-play svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.message-voice-main,
.message-file-card-copy {
    display: grid;
    gap: 5px;
}

.message-file-card-copy strong {
    font-size: 13px;
    font-weight: 700;
}

.message-file-card-copy span {
    font-size: 11px;
    color: rgba(226, 233, 255, 0.72);
}

.message-voice-waveform {
    position: relative;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
    height: 22px;
}

.message-voice-waveform::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--voice-progress);
    background: linear-gradient(90deg, rgba(130, 190, 255, 0.3), rgba(168, 124, 255, 0.34));
    border-radius: 999px;
    pointer-events: none;
    transition: width 120ms linear;
}

.message-voice-bar {
    position: relative;
    z-index: 1;
    width: 100%;
    border-radius: 999px;
    background: rgba(198, 210, 255, 0.28);
    height: var(--bar-height, 10px);
}

.message-voice-card.is-playing .message-voice-bar {
    animation: voiceWave 1.2s ease-in-out infinite;
    animation-delay: calc(var(--bar-index, 0) * 70ms);
}

.message-voice-duration {
    font-size: 11px;
    color: rgba(226, 233, 255, 0.72);
}

.message-audio {
    display: none;
    width: 0;
    height: 0;
}

.message-file-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(8, 12, 21, 0.28);
    color: #f0f4ff;
}

.message-row.ai .message-voice-card,
.message-row.ai .message-file-card {
    color: var(--chat-incoming-text);
}

.message-row.ai .message-file-card-copy span,
.message-row.ai .message-voice-duration {
    color: var(--chat-incoming-meta);
}

.message-file-card-icon,
.attachment-chip-preview--voice,
.attachment-chip-preview--file {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 108, 166, 0.18);
    color: #dce7ff;
}

.message-file-card-icon svg,
.attachment-chip-preview--voice svg,
.attachment-chip-preview--file svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.message-meta {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: rgba(226, 233, 255, 0.72);
}

.message-row.ai .message-meta {
    color: var(--chat-incoming-meta);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.typing-indicator-label {
    font-size: 14px;
    color: #c8d2ed;
}

.chat-composer {
    position: fixed;
    left: 50%;
    bottom: var(--keyboard-offset);
    transform: translateX(-50%);
    width: min(720px, calc(100vw - (var(--composer-side-gap) * 2)));
    z-index: 10;
    max-width: calc(100vw - (var(--composer-side-gap) * 2));
    display: grid;
    gap: 8px;
    padding:
        10px
        0
        calc(var(--composer-bottom-gap) + var(--safe-bottom))
        0;
    transition: bottom 180ms ease, padding-bottom 180ms ease, transform 180ms ease;
    will-change: bottom, padding-bottom;
}

.public-chat-app.is-keyboard-open .chat-composer {
    transition-duration: 160ms;
    padding-bottom: 0;
}

.public-chat-app.is-keyboard-open .chat-thread {
    padding-bottom: calc(var(--composer-height) + var(--keyboard-offset) + 16px);
}

.public-chat-app.is-keyboard-open .status-banner {
    bottom: calc(var(--composer-height) + 18px + var(--keyboard-offset));
}

.composer-attachments,
.composer-recording {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 4px;
    scrollbar-width: none;
}

.composer-attachments::-webkit-scrollbar,
.composer-recording::-webkit-scrollbar {
    display: none;
}

.composer-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    min-height: 60px;
    padding: 8px;
    border-radius: 26px;
    background: var(--chat-panel);
    box-shadow: 0 16px 34px rgba(1, 4, 12, 0.4), inset 0 0 0 1px var(--chat-stroke), 0 0 0 1px rgba(255,255,255,0.02);
    backdrop-filter: blur(16px);
}

.chat-legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px;
    min-height: 14px;
    color: rgba(178, 191, 220, 0.72);
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.chat-legal-links[hidden] {
    display: none;
}

.chat-legal-links a {
    color: inherit;
    text-decoration: none;
}

.chat-legal-links a:hover {
    color: rgba(232, 242, 255, 0.92);
    text-decoration: underline;
}

.chat-legal-separator {
    opacity: 0.72;
}

.composer-plus.is-active {
    background: var(--chat-cta-gradient);
    box-shadow: 0 12px 24px var(--chat-cta-shadow);
}

.composer-plus-menu {
    display: grid;
    gap: 12px;
    margin: 0 4px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(15, 20, 31, 0.96);
    box-shadow: 0 18px 38px rgba(1, 4, 12, 0.45), inset 0 0 0 1px rgba(129, 140, 177, 0.14);
    backdrop-filter: blur(18px);
}

.composer-plus-group {
    display: grid;
    gap: 8px;
}

.composer-plus-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--chat-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.composer-plus-link {
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(24, 31, 47, 0.72);
    border: 1px solid rgba(139, 151, 192, 0.12);
    text-align: left;
}

.composer-plus-link--social {
    min-height: 60px;
}

.composer-plus-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #eff4ff;
    background: rgba(88, 101, 145, 0.24);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.composer-plus-link-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.composer-plus-link-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.composer-plus-link-copy strong {
    font-size: 14px;
    font-weight: 700;
    color: #eef3ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.composer-plus-link-copy small {
    font-size: 12px;
    color: var(--chat-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.social-link-icon--menu {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}

.composer-plus-empty {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(24, 31, 47, 0.48);
    color: var(--chat-muted);
    font-size: 13px;
}

.composer-input-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
}

#messageInput {
    width: 100%;
    min-height: 24px;
    max-height: 120px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--chat-text);
    padding: 8px 2px;
    line-height: 1.45;
}

.public-chat-app[data-widget-mode="true"] #messageInput {
    font-size: var(--chat-font-size-message);
}

#messageInput::placeholder {
    color: #7988ab;
}

.public-chat-app[data-widget-mode="true"] #messageInput::placeholder {
    font-size: inherit;
}

.chat-back:focus-visible,
.chat-menu:focus-visible,
.platform-login:focus-visible,
.quick-reply-chip:focus-visible,
.composer-icon:focus-visible,
.composer-plus-link:focus-visible,
.social-link:focus-visible,
#messageInput:focus-visible {
    outline: 2px solid var(--chat-accent-ring);
    outline-offset: 2px;
}

#messageInput:focus-visible {
    border-radius: 14px;
    box-shadow: 0 0 0 4px var(--chat-accent-soft);
}

.composer-action-slot {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    overflow: visible;
    isolation: isolate;
}

.composer-action-slot .composer-icon {
    position: absolute;
    inset: 0;
}

.composer-send {
    background: var(--chat-cta-gradient);
    border: 1px solid var(--chat-cta-border);
    box-shadow: 0 12px 24px var(--chat-cta-shadow), 0 0 24px var(--chat-launcher-glow);
}

.public-chat-app[data-widget-mode="true"] .composer-send:hover {
    background: var(--chat-cta-gradient-hover);
    box-shadow: 0 16px 28px var(--chat-cta-shadow), 0 0 30px var(--chat-launcher-glow);
}

.composer-send svg {
    fill: #ffffff;
    stroke: none;
    transform: translateX(1px);
}

.composer-mic.is-recording {
    z-index: 2;
    background: var(--chat-cta-gradient);
    border-color: rgba(255, 255, 255, 0.42);
    transform: scale(1.28) translateY(-4px);
    box-shadow:
        0 0 0 10px var(--chat-accent-soft),
        0 0 0 18px rgba(139, 92, 246, 0.08),
        0 0 36px var(--chat-launcher-glow),
        0 16px 32px var(--chat-cta-shadow);
    animation: micPulse 1.1s ease-in-out infinite;
}

.composer-mic.is-recording::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--chat-accent-ring);
    animation: micRing 1.5s ease-out infinite;
}

.attachment-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 16px;
    background: var(--chat-panel-strong);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 177, 0.14);
}

.attachment-chip-preview {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.attachment-chip-preview svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.attachment-chip-copy {
    display: grid;
    gap: 2px;
}

.attachment-chip-copy strong {
    font-size: 12px;
    font-weight: 700;
}

.attachment-chip-copy span {
    font-size: 11px;
    color: var(--chat-muted);
}

.attachment-chip-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d8deef;
}

.attachment-chip-remove svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.composer-recording {
    align-items: center;
    gap: 10px;
    color: #dfe7ff;
    padding-left: 8px;
    min-height: 28px;
}

.recording-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--chat-accent);
    box-shadow: 0 0 0 0 var(--chat-accent-soft-strong);
    animation: recordingPulse 1.4s ease-out infinite;
}

.composer-recording-waveform {
    display: inline-grid;
    grid-template-columns: repeat(6, 3px);
    gap: 3px;
    align-items: center;
    height: 18px;
}

.composer-recording-waveform span {
    display: block;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--chat-accent));
    animation: recordingWave 1s ease-in-out infinite;
}

.composer-recording-waveform span:nth-child(1) { height: 9px; animation-delay: 0ms; }
.composer-recording-waveform span:nth-child(2) { height: 15px; animation-delay: 120ms; }
.composer-recording-waveform span:nth-child(3) { height: 11px; animation-delay: 240ms; }
.composer-recording-waveform span:nth-child(4) { height: 17px; animation-delay: 360ms; }
.composer-recording-waveform span:nth-child(5) { height: 10px; animation-delay: 480ms; }
.composer-recording-waveform span:nth-child(6) { height: 14px; animation-delay: 600ms; }

#recordingLabel {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.status-banner {
    position: fixed;
    left: 50%;
    bottom: calc(var(--composer-height) + 24px + var(--safe-bottom) + var(--keyboard-offset));
    transform: translateX(-50%);
    z-index: 20;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(31, 17, 28, 0.94);
    color: #ffe8ee;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32);
}

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@keyframes recordingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(143, 169, 255, 0.42);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(143, 169, 255, 0);
    }
}

@keyframes recordingWave {
    0%, 100% {
        transform: scaleY(0.72);
        opacity: 0.68;
    }
    50% {
        transform: scaleY(1.15);
        opacity: 1;
    }
}

@keyframes voiceWave {
    0%, 100% {
        transform: scaleY(0.85);
        opacity: 0.8;
    }
    50% {
        transform: scaleY(1.16);
        opacity: 1;
    }
}

@keyframes micPulse {
    0%, 100% {
        transform: scale(1.28) translateY(-4px);
    }
    50% {
        transform: scale(1.38) translateY(-6px);
    }
}

@keyframes micRing {
    0% {
        opacity: 0.6;
        transform: scale(0.92);
    }
    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

@media (max-width: 767px) {
    .chat-identity {
        width: min(100%, 224px);
        padding: 16px 20px;
        border-radius: 20px;
    }

    .chat-avatar {
        width: clamp(92px, 28vw, 104px);
    }

    .public-chat-app[data-widget-mode="true"] .chat-identity {
        width: 100%;
        gap: 10px;
    }

    .public-chat-app[data-widget-mode="true"] .chat-avatar {
        width: 50px;
        height: 50px;
    }

    .chat-brand-name {
        font-size: clamp(1.72rem, 9vw, 2rem);
    }

    .social-strip {
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 10px;
    }

    .contact-request-grid {
        grid-template-columns: 1fr;
    }

    .social-strip-title {
        font-size: 12px;
    }

    .social-strip-row {
        gap: 6px;
        padding: 2px 6px 4px;
    }

    .social-link {
        min-width: 44px;
        min-height: 44px;
        padding: 6px;
        justify-content: center;
    }

    .social-link-label {
        display: none;
    }
}

@media (max-width: 768px) {
    .public-chat-app[data-chat-link-mode="true"] {
        min-height: 100dvh;
        height: 100dvh;
        overflow: hidden;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-shell {
        width: 100%;
        max-width: none;
        margin: 0;
        min-height: var(--app-height);
        height: var(--app-height);
        max-height: var(--app-height);
        padding-top: 0;
        overflow: hidden;
        border-radius: 0;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-header,
    .public-chat-app[data-chat-link-mode="true"] .social-strip {
        margin: 0;
        border-radius: 0;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-header {
        gap: 8px;
        min-height: 80px;
        padding:
            calc(8px + var(--safe-top))
            calc(12px + var(--safe-right))
            8px
            calc(12px + var(--safe-left));
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-header-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        min-height: 52px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-back,
    .public-chat-app[data-chat-link-mode="true"] .chat-menu {
        width: 40px;
        height: 40px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-identity {
        flex: 1 1 auto;
        justify-self: stretch;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 10px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-avatar {
        width: 46px;
        height: 46px;
        max-height: 46px;
        flex: 0 0 46px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-identity-copy {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        align-self: stretch;
        overflow: hidden;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-brand-name {
        width: 100%;
        max-width: 100%;
        font-size: clamp(1.05rem, 4.8vw, 1.2rem);
        line-height: 1.08;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-brand-subtitle {
        width: 100%;
        max-width: 100%;
        font-size: 11px;
        letter-spacing: 0.08em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .public-chat-app[data-chat-link-mode="true"] .social-strip {
        flex: 0 0 auto;
        gap: 6px;
        padding:
            6px
            calc(12px + var(--safe-right))
            8px
            calc(12px + var(--safe-left));
    }

    .public-chat-app[data-chat-link-mode="true"] .social-strip-title {
        font-size: 11px;
        line-height: 1.2;
    }

    .public-chat-app[data-chat-link-mode="true"] .social-strip-row {
        min-height: 40px;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0 2px;
        -webkit-overflow-scrolling: touch;
    }

    .public-chat-app[data-chat-link-mode="true"] .social-link {
        min-height: 40px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-top-cta {
        min-height: 0;
        max-height: none;
        margin: 10px 0 0;
        padding:
            0
            calc(12px + var(--safe-right))
            0
            calc(12px + var(--safe-left));
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-top-cta .platform-login {
        width: 100%;
        min-height: 44px;
        height: 46px;
        max-height: 48px;
        padding: 0 16px;
        border-radius: 20px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-thread,
    .public-chat-app[data-chat-link-mode="true"] .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        padding:
            10px
            calc(12px + var(--safe-right))
            12px
            calc(12px + var(--safe-left));
        overflow-y: auto;
        overflow-x: hidden;
        scroll-behavior: smooth;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scroll-padding-bottom: 16px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-composer {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        width: 100%;
        max-width: none;
        margin-top: auto;
        padding:
            8px
            calc(12px + var(--safe-right))
            max(10px, var(--safe-bottom))
            calc(12px + var(--safe-left));
        transition: padding-bottom 180ms ease;
        will-change: auto;
        flex: 0 0 auto;
    }

    .public-chat-app[data-chat-link-mode="true"].is-keyboard-open .chat-composer {
        padding-bottom: max(10px, var(--safe-bottom));
    }

    .public-chat-app[data-chat-link-mode="true"].is-keyboard-open .chat-thread {
        padding-bottom: 12px;
    }

    .public-chat-app[data-chat-link-mode="true"] .composer-row {
        min-height: 56px;
        padding: 7px;
        border-radius: 22px;
    }

    .public-chat-app[data-chat-link-mode="true"] .composer-plus-menu {
        margin: 0;
    }

    .public-chat-app[data-chat-link-mode="true"] .status-banner {
        bottom: calc(var(--composer-height) + 14px + var(--safe-bottom) + var(--keyboard-offset));
    }
}

@media (min-width: 768px) {
    :root {
        --composer-side-gap: 16px;
        --composer-bottom-gap: 10px;
    }

    .chat-shell {
        padding-top: 18px;
        max-width: 760px;
    }

    .public-chat-app[data-widget-mode="true"] .chat-shell {
        padding-top: 0;
        max-width: none;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-shell {
        width: min(100%, 820px);
        max-width: 820px;
        margin: 0 auto;
    }

    body::after {
        opacity: 1;
        background:
            linear-gradient(
                90deg,
                rgba(26, 34, 50, 0.88) 0%,
                rgba(26, 34, 50, 0.54) calc(50% - 420px),
                rgba(10, 13, 21, 0) calc(50% - 420px),
                rgba(10, 13, 21, 0) calc(50% + 420px),
                rgba(26, 34, 50, 0.54) calc(50% + 420px),
                rgba(26, 34, 50, 0.88) 100%
            );
    }

    .chat-header,
    .social-strip {
        margin: 0 10px;
        border-radius: 28px;
    }

    .public-chat-app[data-widget-mode="true"] .chat-header,
    .public-chat-app[data-widget-mode="true"] .social-strip {
        margin: 0;
    }

    .public-chat-app[data-widget-mode="true"] .chat-header {
        border-radius: 28px 28px 0 0;
    }

    .public-chat-app[data-widget-mode="true"] .social-strip {
        border-radius: 0;
    }

    .chat-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .chat-top-cta {
        margin: 0 10px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .public-chat-app[data-widget-mode="true"] .chat-top-cta {
        margin: 0;
    }

    .chat-header-actions {
        position: absolute;
        top: 18px;
        right: 18px;
    }

    .social-strip-row {
        justify-content: center;
        flex-wrap: wrap;
        overflow: visible;
        gap: 7px;
        padding-inline: 0;
    }

    .social-link {
        padding: 7px 10px;
    }

    .chat-thread {
        padding-left: 18px;
        padding-right: 18px;
    }

    .chat-composer {
        width: min(720px, calc(100vw - 40px));
        gap: 6px;
    }

    .message-image-link {
        max-width: min(340px, 32vw);
    }

    .message-image {
        max-height: min(48vh, 360px);
    }
}


@media (max-width: 390px) {
    .public-chat-app[data-chat-link-mode="true"] .chat-header {
        min-height: 72px;
        padding-top: calc(6px + var(--safe-top));
        padding-bottom: 6px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-avatar {
        width: 42px;
        height: 42px;
        max-height: 42px;
        flex-basis: 42px;
    }

    .public-chat-app[data-chat-link-mode="true"] .chat-top-cta .platform-login {
        min-height: 40px;
        height: 42px;
        font-size: 14px;
    }

    .composer-mic.is-recording {
        transform: scale(1.22) translateY(-3px);
    }
}
