.gr-assistant-chat {
    --grac-bg: #0b0b0b;
    --grac-bg-2: #0f0f0f;
    --grac-bg-3: #161616;
    --grac-panel: rgba(15, 15, 15, 0.96);
    --grac-header-bg: #111111;
    --grac-border: #393939;
    --grac-border-2: #2a2a2a;
    --grac-primary: #ff4d00;
    --grac-primary-hover: #ff6b35;
    --grac-primary-dim: rgba(255, 77, 0, 0.12);
    --grac-user-message-bg: #ff4d00;
    --grac-user-message-gradient-start: #ff4d00;
    --grac-user-message-gradient-end: #ff6b35;
    --grac-assistant-message-bg: #161616;
    --grac-success: #a3e635;
    --grac-success-dim: rgba(163, 230, 53, 0.11);
    --grac-error: #fb7185;
    --grac-error-dim: rgba(251, 113, 133, 0.1);
    --grac-text: #eee8df;
    --grac-text-2: #b9b1a8;
    --grac-text-3: #837a70;
    --grac-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
    --grac-shadow-soft: 0 12px 42px rgba(0, 0, 0, 0.35);
    --grac-radius: 26px;
    --gr-chat-primary: var(--grac-primary);
    --gr-chat-primary-hover: var(--grac-primary-hover);
    --gr-chat-primary-contrast: #ffffff;
    --gr-chat-bg: var(--grac-bg);
    --gr-chat-panel: var(--grac-panel);
    --gr-chat-panel-elevated: var(--grac-bg-3);
    --gr-chat-header-bg: var(--grac-header-bg);
    --gr-chat-border: var(--grac-border);
    --gr-chat-border-inner: var(--grac-border-2);
    --gr-chat-text: var(--grac-text);
    --gr-chat-muted: var(--grac-text-2);
    --gr-chat-tertiary: var(--grac-text-3);
    --gr-chat-user-message: linear-gradient(135deg, var(--grac-user-message-gradient-start), var(--grac-user-message-gradient-end));
    --gr-chat-assistant-message: var(--grac-assistant-message-bg);
    --gr-chat-success: var(--grac-success);
    --gr-chat-danger: var(--grac-error);
    --gr-chat-shadow: var(--grac-shadow);
    --gr-chat-radius: var(--grac-radius);
    --gr-chat-button-size: 60px;
    --gr-chat-mobile-height: 640px;
    --grac-desktop-bottom-offset: 96px;
    --grac-desktop-side-offset: 24px;
    --grac-mobile-bottom-offset: 96px;
    --grac-mobile-side-offset: 16px;
    --grac-viewport-height: 100vh;
    --grac-viewport-offset-top: 0px;
    --grac-z-welcome: 999997;
    --grac-z-launcher: 999998;
    --grac-z-panel: 999999;
    position: fixed;
    right: var(--grac-desktop-side-offset);
    bottom: calc(var(--grac-desktop-bottom-offset) + env(safe-area-inset-bottom, 0px));
    z-index: var(--grac-z-panel);
    box-sizing: border-box;
    color: var(--gr-chat-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.4;
}

.gr-assistant-chat.is-left {
    right: auto;
    left: var(--grac-desktop-side-offset);
}

@supports (height: 100dvh) {
    .gr-assistant-chat {
        --grac-viewport-height: 100dvh;
    }
}

html.grac-chat-open-mobile,
body.grac-chat-open-mobile {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.gr-assistant-chat *,
.gr-assistant-chat *::before,
.gr-assistant-chat *::after {
    box-sizing: inherit;
}

.gr-assistant-chat button,
.gr-assistant-chat textarea {
    font: inherit;
}

.gr-assistant-chat button {
    cursor: pointer;
}

.gr-assistant-chat svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.gr-assistant-chat__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.gr-assistant-chat__launcher {
    position: relative;
    display: flex;
    z-index: var(--grac-z-launcher);
    width: var(--gr-chat-button-size);
    height: var(--gr-chat-button-size);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--gr-chat-primary-hover), var(--gr-chat-primary));
    color: var(--gr-chat-primary-contrast);
    box-shadow: 0 18px 45px var(--grac-primary-dim), var(--grac-shadow-soft);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.gr-assistant-chat__launcher:hover,
.gr-assistant-chat__launcher:focus-visible {
    filter: brightness(1.06);
    outline: none;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 22px 55px var(--grac-primary-dim), var(--grac-shadow-soft);
}

.gr-assistant-chat__launcher:active {
    transform: translateY(0) scale(0.98);
}

.gr-assistant-chat__launcher-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    background-position: center;
    background-size: cover;
    transition: transform 180ms ease, opacity 180ms ease;
}

.gr-assistant-chat__launcher-icon.has-image {
    width: calc(var(--gr-chat-button-size) - 12px);
    height: calc(var(--gr-chat-button-size) - 12px);
    border-radius: 999px;
}

.gr-assistant-chat__launcher-icon.has-image .gr-assistant-chat__launcher-chat {
    display: none;
}

.gr-assistant-chat.is-open .gr-assistant-chat__launcher-icon.has-image {
    background-image: none !important;
}

.gr-assistant-chat__launcher svg {
    position: absolute;
    width: 28px;
    height: 28px;
    transition: opacity 180ms ease, transform 180ms ease;
}

.gr-assistant-chat__launcher-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.65);
}

.gr-assistant-chat.is-open .gr-assistant-chat__launcher-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.65);
}

.gr-assistant-chat.is-open .gr-assistant-chat__launcher-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.gr-assistant-chat__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    padding: 0 6px;
    background: var(--gr-chat-danger);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.gr-assistant-chat__tooltip {
    position: absolute;
    right: calc(100% + 12px);
    bottom: 50%;
    max-width: 220px;
    transform: translateY(50%) translateX(8px);
    pointer-events: none;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 9px 12px;
    background: rgba(22, 23, 28, 0.96);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    font-size: 13px;
    white-space: nowrap;
    transition: opacity 160ms ease, transform 160ms ease;
}

.gr-assistant-chat.is-left .gr-assistant-chat__tooltip {
    right: auto;
    left: calc(100% + 12px);
    transform: translateY(50%) translateX(-8px);
}

.gr-assistant-chat__launcher:hover .gr-assistant-chat__tooltip,
.gr-assistant-chat__launcher:focus-visible .gr-assistant-chat__tooltip {
    opacity: 1;
    transform: translateY(50%) translateX(0);
}

.gr-assistant-chat__welcome {
    position: absolute;
    z-index: var(--grac-z-welcome);
    right: 0;
    bottom: calc(var(--gr-chat-button-size) + 16px);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    width: min(340px, calc(100vw - 32px));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 14px 42px 14px 14px;
    background: var(--grac-panel);
    color: var(--gr-chat-text);
    box-shadow: var(--gr-chat-shadow);
    backdrop-filter: blur(18px);
    transform: translateY(12px) scale(0.98);
    transform-origin: right bottom;
    opacity: 0;
    transition: opacity 240ms ease, transform 240ms ease;
}

.gr-assistant-chat.is-left .gr-assistant-chat__welcome {
    right: auto;
    left: 0;
    transform-origin: left bottom;
}

.gr-assistant-chat__welcome.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gr-assistant-chat__welcome-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--gr-chat-muted);
}

.gr-assistant-chat__welcome-close:hover,
.gr-assistant-chat__welcome-close:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: var(--gr-chat-text);
    outline: none;
}

.gr-assistant-chat__welcome-avatar,
.gr-assistant-chat__avatar,
.gr-assistant-chat__typing-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: var(--gr-chat-primary);
    color: var(--gr-chat-primary-contrast);
    background-position: center;
    background-size: cover;
    font-weight: 800;
}

.gr-assistant-chat__welcome-avatar {
    width: 42px;
    height: 42px;
    font-size: 13px;
}

.gr-assistant-chat__welcome-avatar.has-image,
.gr-assistant-chat__avatar.has-image,
.gr-assistant-chat__typing-avatar.has-image {
    color: transparent;
}

.gr-assistant-chat__welcome-name {
    margin-bottom: 3px;
    color: var(--gr-chat-text);
    font-size: 14px;
    font-weight: 750;
}

.gr-assistant-chat__welcome-text {
    min-height: 38px;
    color: var(--gr-chat-muted);
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.gr-assistant-chat__panel {
    position: absolute;
    z-index: var(--grac-z-panel);
    right: 0;
    bottom: calc(var(--gr-chat-button-size) + 18px);
    display: grid;
    grid-template-columns: minmax(210px, 260px) minmax(0, 430px);
    width: min(720px, calc(100vw - 32px));
    height: min(720px, calc(100vh - var(--grac-desktop-bottom-offset) - var(--gr-chat-button-size) - 48px));
    height: min(720px, calc(100dvh - var(--grac-desktop-bottom-offset) - var(--gr-chat-button-size) - 48px));
    min-height: min(360px, calc(100vh - var(--grac-desktop-bottom-offset) - var(--gr-chat-button-size) - 48px));
    min-height: min(360px, calc(100dvh - var(--grac-desktop-bottom-offset) - var(--gr-chat-button-size) - 48px));
    max-height: min(720px, calc(100vh - var(--grac-desktop-bottom-offset) - var(--gr-chat-button-size) - 48px));
    max-height: min(720px, calc(100dvh - var(--grac-desktop-bottom-offset) - var(--gr-chat-button-size) - 48px));
    overflow: hidden;
    border: 1px solid var(--gr-chat-border);
    border-radius: var(--gr-chat-radius);
    background: var(--gr-chat-bg);
    box-shadow: var(--gr-chat-shadow);
    transform: translateY(18px) scale(0.96);
    transform-origin: right bottom;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
    visibility: hidden;
}

.gr-assistant-chat.is-left .gr-assistant-chat__panel {
    right: auto;
    left: 0;
    transform-origin: left bottom;
}

.gr-assistant-chat.is-open .gr-assistant-chat__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.gr-assistant-chat.is-history-hidden .gr-assistant-chat__panel,
.gr-assistant-chat.grac-history-disabled .gr-assistant-chat__panel {
    grid-template-columns: minmax(0, 430px);
    width: min(430px, calc(100vw - 32px));
}

.gr-assistant-chat.is-history-hidden .gr-assistant-chat__sidebar,
.gr-assistant-chat.is-history-hidden .gr-assistant-chat__history-toggle,
.gr-assistant-chat.grac-history-disabled .gr-assistant-chat__sidebar,
.gr-assistant-chat.grac-history-disabled .gr-assistant-chat__history-toggle {
    display: none;
}

.gr-assistant-chat__sidebar {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid var(--gr-chat-border);
    background: var(--grac-bg-2);
}

.gr-assistant-chat__sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 16px 12px;
}

.gr-assistant-chat__sidebar-top strong {
    display: block;
    color: var(--gr-chat-text);
    font-size: 15px;
}

.gr-assistant-chat__sidebar-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--gr-chat-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gr-assistant-chat__sidebar-close {
    display: none;
}

.gr-assistant-chat__new {
    display: flex;
    min-width: 44px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 14px 12px;
    border: 1px solid var(--gr-chat-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gr-chat-text);
    font-size: 14px;
    font-weight: 650;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.gr-assistant-chat__new:hover,
.gr-assistant-chat__new:focus-visible {
    border-color: var(--gr-chat-primary-hover);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.gr-assistant-chat__conversation-list {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding: 0 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.gr-assistant-chat__conversation-list::-webkit-scrollbar,
.gr-assistant-chat__messages::-webkit-scrollbar,
.gr-assistant-chat__textarea::-webkit-scrollbar {
    width: 8px;
}

.gr-assistant-chat__conversation-list::-webkit-scrollbar-thumb,
.gr-assistant-chat__messages::-webkit-scrollbar-thumb,
.gr-assistant-chat__textarea::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.gr-assistant-chat__conversation-empty {
    border-radius: 14px;
    padding: 12px;
    color: var(--gr-chat-muted);
    font-size: 13px;
}

.gr-assistant-chat__conversation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 4px;
    min-height: 42px;
    border-radius: 14px;
    color: var(--gr-chat-text);
    transition: background 150ms ease;
}

.gr-assistant-chat__conversation:hover,
.gr-assistant-chat__conversation.is-active {
    background: rgba(255, 255, 255, 0.07);
}

.gr-assistant-chat__conversation-button,
.gr-assistant-chat__conversation-delete {
    min-height: 38px;
    border: 0;
    background: transparent;
    color: inherit;
}

.gr-assistant-chat__conversation-button {
    min-width: 0;
    overflow: hidden;
    padding: 0 10px;
    color: var(--gr-chat-text);
    font-size: 13px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gr-assistant-chat__conversation-delete {
    width: 32px;
    border-radius: 10px;
    color: var(--gr-chat-muted);
}

.gr-assistant-chat__conversation-delete:hover,
.gr-assistant-chat__conversation-delete:focus-visible {
    background: rgba(239, 68, 68, 0.18);
    color: #ffffff;
    outline: none;
}

.gr-assistant-chat__main {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    background: var(--gr-chat-panel);
}

.gr-assistant-chat__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    border-bottom: 1px solid var(--gr-chat-border);
    padding: 14px 16px;
    background: var(--gr-chat-header-bg);
}

.gr-assistant-chat__history-toggle,
.gr-assistant-chat__end,
.gr-assistant-chat__close,
.gr-assistant-chat__sidebar-close {
    display: flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gr-chat-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gr-chat-muted);
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.gr-assistant-chat__end {
    width: auto;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.gr-assistant-chat__history-toggle:hover,
.gr-assistant-chat__history-toggle:focus-visible,
.gr-assistant-chat__end:hover,
.gr-assistant-chat__end:focus-visible,
.gr-assistant-chat__close:hover,
.gr-assistant-chat__close:focus-visible,
.gr-assistant-chat__sidebar-close:hover,
.gr-assistant-chat__sidebar-close:focus-visible {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.09);
    color: var(--gr-chat-text);
    outline: none;
}

.gr-assistant-chat__brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.gr-assistant-chat__avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 13px;
}

.gr-assistant-chat__brand-copy {
    min-width: 0;
}

.gr-assistant-chat__name {
    overflow: hidden;
    color: var(--gr-chat-text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gr-assistant-chat__status-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--gr-chat-muted);
    font-size: 12px;
}

.gr-assistant-chat__online-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    background: var(--gr-chat-success);
    box-shadow: 0 0 0 4px var(--grac-success-dim);
}

.gr-assistant-chat__logo {
    max-width: 74px;
    max-height: 28px;
    object-fit: contain;
}

.gr-assistant-chat__messages {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding: 22px 18px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.gr-assistant-chat__empty {
    display: grid;
    width: min(300px, 100%);
    gap: 8px;
    margin: auto;
    justify-items: center;
    color: var(--gr-chat-muted);
    font-size: 14px;
    text-align: center;
}

.gr-assistant-chat__empty[hidden] {
    display: none;
}

.gr-assistant-chat__empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 16px;
    background: var(--grac-primary-dim);
    color: var(--gr-chat-primary);
}

.gr-assistant-chat__empty strong {
    color: var(--gr-chat-text);
    font-size: 17px;
}

.gr-assistant-chat__message {
    display: flex;
    width: 100%;
    gap: 9px;
    animation: gr-chat-message-in 220ms ease both;
}

.gr-assistant-chat__message.is-user {
    justify-content: flex-end;
}

.gr-assistant-chat__message.is-assistant,
.gr-assistant-chat__message.is-error {
    justify-content: flex-start;
}

.gr-assistant-chat__message-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    margin-top: 2px;
    border-radius: 10px;
    background: var(--gr-chat-primary);
    color: var(--gr-chat-primary-contrast);
    background-position: center;
    background-size: cover;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gr-assistant-chat__message-avatar.has-image {
    color: transparent;
}

.gr-assistant-chat__bubble {
    max-width: min(82%, 620px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 12px 14px;
    background: var(--gr-chat-assistant-message);
    color: var(--gr-chat-text);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.gr-assistant-chat__message.is-user .gr-assistant-chat__bubble {
    border-color: var(--gr-chat-primary-hover);
    border-bottom-right-radius: 6px;
    background: var(--gr-chat-user-message);
}

.gr-assistant-chat__message.is-assistant .gr-assistant-chat__bubble {
    border-bottom-left-radius: 6px;
}

.gr-assistant-chat__message.is-error .gr-assistant-chat__bubble {
    border-color: var(--gr-chat-danger);
    background: var(--grac-error-dim);
}

.gr-assistant-chat .grac-markdown {
    line-height: 1.55;
    white-space: normal;
}

.gr-assistant-chat .grac-markdown,
.gr-assistant-chat .grac-markdown * {
    overflow-wrap: anywhere;
    word-break: normal;
}

.gr-assistant-chat .grac-markdown p {
    margin: 0 0 10px;
}

.gr-assistant-chat .grac-markdown p:last-child {
    margin-bottom: 0;
}

.gr-assistant-chat .grac-markdown ul,
.gr-assistant-chat .grac-markdown ol {
    margin: 8px 0 10px 20px;
    padding: 0;
}

.gr-assistant-chat .grac-markdown ul:last-child,
.gr-assistant-chat .grac-markdown ol:last-child {
    margin-bottom: 0;
}

.gr-assistant-chat .grac-markdown li {
    margin: 4px 0;
}

.gr-assistant-chat .grac-markdown strong {
    color: inherit;
    font-weight: 700;
}

.gr-assistant-chat .grac-markdown em {
    font-style: italic;
}

.gr-assistant-chat .grac-markdown code {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

.gr-assistant-chat__typing {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px 12px;
}

.gr-assistant-chat__typing[hidden] {
    display: none;
}

.gr-assistant-chat__typing-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 10px;
    font-size: 10px;
}

.gr-assistant-chat__typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    padding: 12px 14px;
    background: var(--gr-chat-assistant-message);
}

.gr-assistant-chat__typing-bubble span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--gr-chat-muted);
    animation: gr-chat-typing 1.5s ease-in-out infinite;
}

.gr-assistant-chat__typing-bubble span:nth-child(2) {
    animation-delay: 180ms;
}

.gr-assistant-chat__typing-bubble span:nth-child(3) {
    animation-delay: 360ms;
}

.gr-assistant-chat__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: end;
    gap: 10px;
    border-top: 1px solid var(--gr-chat-border);
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--gr-chat-header-bg);
}

.gr-assistant-chat__textarea {
    width: 100%;
    max-height: 150px;
    min-height: 46px;
    resize: none;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--gr-chat-text);
    font-size: 15px;
    line-height: 1.45;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.gr-assistant-chat__textarea::placeholder {
    color: var(--gr-chat-tertiary);
}

.gr-assistant-chat__textarea:focus {
    border-color: var(--gr-chat-primary-hover);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    box-shadow: 0 0 0 4px var(--grac-primary-dim);
}

.gr-assistant-chat__send {
    display: flex;
    width: 46px;
    height: 46px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    background: var(--gr-chat-primary);
    color: var(--gr-chat-primary-contrast);
    box-shadow: 0 10px 24px var(--grac-primary-dim);
    transition: filter 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.gr-assistant-chat__send svg {
    width: 22px;
    height: 22px;
}

.gr-assistant-chat__send:hover,
.gr-assistant-chat__send:focus-visible {
    filter: brightness(1.08);
    outline: none;
    transform: translateY(-1px);
}

.gr-assistant-chat__send:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

@keyframes gr-chat-message-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gr-chat-typing {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@media (max-width: 760px) {
    .gr-assistant-chat {
        right: var(--grac-mobile-side-offset);
        bottom: calc(var(--grac-mobile-bottom-offset) + env(safe-area-inset-bottom, 0px));
    }

    .gr-assistant-chat.is-left {
        right: auto;
        left: var(--grac-mobile-side-offset);
    }

    .gr-assistant-chat__tooltip {
        display: none;
    }

    .gr-assistant-chat__welcome {
        width: min(340px, calc(100vw - 32px));
    }

    .gr-assistant-chat__panel {
        position: fixed;
        inset: var(--grac-viewport-offset-top, 0px) 0 auto 0;
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        width: 100vw;
        width: 100dvw;
        max-width: none;
        height: var(--grac-viewport-height, 100dvh);
        min-height: 0;
        max-height: var(--grac-viewport-height, 100dvh);
        border-radius: 0;
        transform: none;
        transform-origin: center bottom;
        overflow: hidden;
    }

    .gr-assistant-chat.is-open .gr-assistant-chat__launcher {
        display: none;
    }

    .gr-assistant-chat.is-open .gr-assistant-chat__panel,
    .gr-assistant-chat.is-mobile-fullscreen .gr-assistant-chat__panel {
        inset: var(--grac-viewport-offset-top, 0px) 0 auto 0;
        width: 100vw;
        width: 100dvw;
        height: var(--grac-viewport-height, 100dvh);
        max-height: var(--grac-viewport-height, 100dvh);
        border-radius: 0;
        transform: none;
    }

    .gr-assistant-chat__sidebar {
        position: absolute;
        z-index: 4;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-102%);
        transition: transform 210ms ease;
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.32);
    }

    .gr-assistant-chat.is-left .gr-assistant-chat__sidebar {
        inset: 0 0 0 auto;
        transform: translateX(102%);
    }

    .gr-assistant-chat.is-sidebar-open .gr-assistant-chat__sidebar {
        transform: translateX(0);
    }

    .gr-assistant-chat__sidebar-close {
        display: flex;
    }

    .gr-assistant-chat__header {
        display: flex;
        flex: 0 0 auto;
        min-height: 72px;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    }

    .gr-assistant-chat__main {
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .gr-assistant-chat__brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .gr-assistant-chat__end {
        flex: 0 0 auto;
        min-width: 72px;
        height: 48px;
        min-height: 48px;
        padding: 0 10px;
    }

    .gr-assistant-chat__close {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .gr-assistant-chat__history-toggle,
    .gr-assistant-chat__end,
    .gr-assistant-chat__close,
    .gr-assistant-chat__sidebar-close,
    .gr-assistant-chat__new,
    .gr-assistant-chat__send {
        min-width: 44px;
        min-height: 44px;
    }

    .gr-assistant-chat__close svg,
    .gr-assistant-chat__send svg,
    .gr-assistant-chat__history-toggle svg,
    .gr-assistant-chat__sidebar-close svg {
        width: 22px;
        height: 22px;
    }

    .gr-assistant-chat__logo {
        display: none;
    }

    .gr-assistant-chat__messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 18px 12px;
    }

    .gr-assistant-chat__bubble {
        max-width: 86%;
    }

    .gr-assistant-chat__composer {
        display: flex;
        flex: 0 0 auto;
        align-items: flex-end;
        gap: 10px;
        padding: 10px 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .gr-assistant-chat__textarea {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 48px;
    }

    .gr-assistant-chat__send {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gr-assistant-chat *,
    .gr-assistant-chat *::before,
    .gr-assistant-chat *::after {
        animation-duration: 1ms !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}
