/* Chat surfaces, composer, and assistant UI migrated from CSS isolation. */

.chat-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.chat-action-buttons__btn {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    padding: 0.7rem 0.95rem;
    border-radius: 999px;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.2;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.chat-action-buttons__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
    border-color: rgba(var(--brand-primary-rgb), 0.3);
}

.chat-action-buttons__btn--primary {
    background: linear-gradient(135deg, var(--brand-primary), #7c83ff);
    color: #fff;
    border-color: transparent;
}

.chat-action-buttons__btn--secondary {
    background: rgba(var(--brand-primary-rgb), 0.12);
    color: #1d4ed8;
}

.chat-action-buttons__btn--ghost {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: none;
    color: #475569;
}

.chat-action-buttons__btn--danger {
    background: rgba(254, 242, 242, 0.98);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.18);
}

.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.chatbot-quick-actions__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.45rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.chatbot-quick-actions__chip:hover,
.chatbot-quick-actions__chip:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    outline: none;
}

.chatbot-quick-actions__chip--outline {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(var(--brand-primary-rgb), 0.18);
    color: var(--brand-primary);
}

.chatbot-quick-actions__chip--primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
}

.chatbot-quick-actions__chip--secondary {
    background: rgba(var(--brand-secondary-rgb), 0.12);
    color: var(--brand-secondary);
    border-color: rgba(var(--brand-secondary-rgb), 0.22);
}

.chatbot-quick-actions__chip--success {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
    border-color: rgba(25, 135, 84, 0.2);
}

.chatbot-quick-actions__chip--warning {
    background: rgba(255, 193, 7, 0.14);
    color: #8a6500;
    border-color: rgba(255, 193, 7, 0.22);
}

.chatbot-quick-actions__chip--danger {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
    border-color: rgba(220, 53, 69, 0.2);
}

.chatbot-quick-actions__chip--ghost {
    background: rgba(15, 23, 42, 0.05);
    color: rgba(15, 23, 42, 0.82);
    border-color: rgba(15, 23, 42, 0.08);
}

.chatbot-quick-actions__icon {
    font-size: 0.95em;
}

@media (max-width: 575.98px) {
    .chat-action-buttons,
    .chatbot-quick-actions {
        gap: 0.45rem;
    }

    .chat-action-buttons__btn,
    .chatbot-quick-actions__chip {
        width: 100%;
        justify-content: center;
    }
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    margin-bottom: 1rem;
}

.section-heading h2 {
    margin: .2rem 0 0;
    font-size: 1.15rem;
    color: var(--brand-secondary);
}

.section-heading p {
    margin: .35rem 0 0;
    color: rgba(15, 23, 42, .72);
}

.section-kicker {
    display: inline-flex;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 800;
    color: var(--brand-primary);
}

.home-welcome-panel {
    display: grid;
    gap: .85rem;
    justify-items: center;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem 1.1rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.home-welcome-panel__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
}

.home-welcome-panel__copy {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.home-welcome-panel__kicker {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #4f46e5;
}

.home-welcome-panel h1 {
    margin: 0;
    font-size: clamp(1.3rem, 2.2vw, 1.85rem);
    line-height: 1.15;
    color: #0f172a;
}

.home-welcome-panel p {
    margin: 0;
    max-width: 58ch;
    margin-inline: auto;
    color: #475569;
    line-height: 1.55;
}

.recommended-actions {
    display: grid;
    gap: 1rem;
}

.recommended-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.recommended-action-card {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(var(--brand-primary-rgb), .12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
    text-align: left;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.recommended-action-card:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--brand-primary-rgb), .24);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .09);
}

.recommended-action-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: .8rem;
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), .14), rgba(var(--brand-accent-rgb), .18));
    font-size: 1.05rem;
}

.recommended-action-copy {
    display: grid;
    gap: .15rem;
}

.recommended-action-copy strong {
    color: var(--brand-secondary);
}

.recommended-action-copy span {
    color: rgba(15, 23, 42, .72);
    font-size: .92rem;
}

@media (max-width: 991.98px) {
    .recommended-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .home-welcome-panel {
        justify-items: stretch;
        text-align: left;
        padding: 1rem;
    }

    .home-welcome-panel__hero {
        align-items: flex-start;
        text-align: left;
    }

    .recommended-actions-grid {
        grid-template-columns: 1fr;
    }
}

.chat-composer {
    display: grid;
    gap: .65rem;
    padding: .95rem 1rem 1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(148, 163, 184, .12);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
    backdrop-filter: blur(18px);
}

.chat-composer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.chat-composer__title {
    font-size: .95rem;
    font-weight: 800;
    color: #0f172a;
}

.chat-composer__subtitle {
    margin-top: .15rem;
    font-size: .86rem;
    color: #64748b;
}

.chat-composer__state {
    display: flex;
    justify-content: flex-end;
}

.chat-composer__badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .72rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, .98);
    border: 1px solid rgba(148, 163, 184, .18);
    color: #334155;
    font-size: .8rem;
    font-weight: 700;
}

.chat-composer__badge--listening {
    background: rgba(var(--brand-primary-rgb), .1);
    border-color: rgba(var(--brand-primary-rgb), .2);
    color: var(--brand-primary);
}

.chat-composer__surface {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: .65rem;
    padding: .72rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, .12);
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95);
}

.chat-composer__surface--listening {
    border-color: rgba(var(--brand-primary-rgb), .3);
    box-shadow: 0 0 0 .14rem rgba(var(--brand-primary-rgb), .08), inset 0 1px 0 rgba(255, 255, 255, .95);
}

.chat-composer__input {
    grid-column: 1 / 2;
    grid-row: 1;
    width: 100%;
    min-height: 1.55em;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: .98rem;
    line-height: 1.45;
    padding: .12rem .05rem .12rem 0;
}

.chat-composer__input::placeholder {
    color: #94a3b8;
}

.chat-composer__action {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 0;
    border-radius: 999px;
    min-height: 2.7rem;
    padding: .55rem 1rem;
    align-self: end;
    font-size: .92rem;
    font-weight: 800;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
    flex: 0 0 auto;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--brand-primary), #7c83ff);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), .2);
}

.chat-composer__action:hover:not(:disabled) {
    transform: translateY(-1px);
}

.chat-composer__action:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.chat-composer__action:focus-visible,
.chat-composer__input:focus-visible {
    outline: 3px solid rgba(var(--brand-primary-rgb), .28);
    outline-offset: 2px;
}

.chat-composer__footer {
    display: grid;
    gap: 0;
}

.chat-composer__status,
.chat-composer__error {
    font-size: .82rem;
    line-height: 1.35;
}

.chat-composer__status {
    color: #64748b;
}

.chat-composer__error {
    color: #b42318;
}

.chat-message-list {
    display: grid;
    gap: 1rem;
}

.chat-stream {
    display: grid;
    gap: .85rem;
    padding: 1.1rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(var(--brand-primary-rgb), .12);
    background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .98));
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    gap: .75rem;
    align-items: flex-end;
    animation: chatMessageIn 180ms ease-out both;
    animation-delay: calc(var(--chat-message-index, 0) * 45ms);
    will-change: transform, opacity;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    border-color: transparent;
}

.chat-message.user .chat-meta,
.chat-message.user p,
.chat-message__text {
    color: rgba(255, 255, 255, .92);
}

.chat-bubble {
    max-width: min(48rem, 85%);
    padding: .95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
}

.chat-message--typing .chat-bubble {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
}

.chat-bubble--typing {
    color: rgba(15, 23, 42, .72);
}

.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.chat-typing span {
    width: .48rem;
    height: .48rem;
    border-radius: 999px;
    background: var(--brand-primary);
    animation: typingPulse 1.15s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: .14s; }
.chat-typing span:nth-child(3) { animation-delay: .28s; }

.chat-meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .35rem;
    font-size: .82rem;
    color: rgba(15, 23, 42, .64);
}

.chat-bubble p {
    margin: 0;
    color: rgba(15, 23, 42, .82);
    white-space: pre-wrap;
}

.chat-message__text {
    margin: 0;
    white-space: pre-wrap;
}

.chat-empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    gap: .75rem;
    padding: 1.5rem 1rem;
}

.chat-empty-state h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-empty-state p {
    margin: 0;
    color: rgba(15, 23, 42, .72);
}

.home-conversation {
    display: grid;
    gap: 1rem;
}

.home-conversation__stream {
    display: grid;
    gap: .9rem;
    padding: 1rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(var(--brand-primary-rgb), .12);
    background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 250, 252, .98));
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.home-message {
    display: flex;
    gap: .75rem;
    align-items: flex-end;
    animation: chatMessageIn 180ms ease-out both;
    animation-delay: calc(var(--chat-message-index, 0) * 45ms);
    will-change: transform, opacity;
}

.home-message--user {
    justify-content: flex-end;
}

.home-message__body {
    display: grid;
    gap: .45rem;
    max-width: min(48rem, 86%);
}

.home-message__meta {
    font-size: .82rem;
    color: rgba(15, 23, 42, .62);
}

.home-message__bubble {
    padding: .95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
    color: rgba(15, 23, 42, .84);
    white-space: pre-wrap;
}

.home-message--bot .home-message__bubble { white-space: normal; }
.home-message__bubble--bot { box-shadow: 0 10px 24px rgba(15, 23, 42, .04); }

.home-message__bubble--typing {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: #475569;
}

.home-message__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}

.home-message__typing-dots span {
    width: .48rem;
    height: .48rem;
    border-radius: 999px;
    background: var(--brand-primary);
    animation: typingPulse 1.15s infinite ease-in-out;
}

.home-message__typing-dots span:nth-child(2) { animation-delay: .14s; }
.home-message__typing-dots span:nth-child(3) { animation-delay: .28s; }

.home-message__actions {
    margin-top: .35rem;
    max-width: min(48rem, 86%);
}

.home-message--user .home-message__bubble {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    border-color: transparent;
}

.home-message--user .home-message__meta,
.home-message--user .home-message__bubble {
    color: rgba(255, 255, 255, .94);
}

.home-message__highlights { color: inherit; }
.home-message__text { white-space: pre-wrap; }

.home-conversation__empty {
    display: grid;
    place-items: center;
    text-align: center;
    gap: .75rem;
    padding: 1.4rem 1rem;
}

.home-conversation__empty-title {
    font-size: 1.06rem;
    font-weight: 700;
}

.home-conversation__empty-text { color: rgba(15, 23, 42, .72); }

@media (max-width: 575.98px) {
    .chat-composer {
        padding: .55rem;
        border-radius: 1rem;
    }

    .chat-composer__header { flex-direction: column; }
    .chat-composer__state { justify-content: flex-start; }
    .chat-composer__surface { padding: .58rem; column-gap: .5rem; }
    .chat-composer__action { min-height: 2.5rem; padding: .5rem .85rem; }
    .chat-composer__input { min-height: 1.45em; }
    .chat-composer__action-label { display: none; }

    .chat-bubble { max-width: 100%; }
    .home-message__body,
    .home-message__actions { max-width: 100%; }
}

@media (max-width: 575.98px) and (orientation: landscape) {
    .chat-composer__action-label { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
    .chat-composer__action,
    .chat-stream,
    .chat-message,
    .home-message,
    .chat-home-shell__messages,
    .chat-home-shell__message,
    .chat-home-shell__conversation-item,
    .chat-home-shell__action-button {
        transition: none;
        scroll-behavior: auto;
        animation: none;
    }
}

@keyframes chatMessageIn {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes typingPulse {
    0%, 80%, 100% { transform: scale(.75); opacity: .45; }
    40% { transform: scale(1); opacity: 1; }
}

/* ChatSidebar migrated from CSS isolation. */
.chat-sidebar-shell {
    position: relative;
    z-index: 1105;
    flex: 0 0 300px;
    width: 300px;
    min-width: 300px;
    height: 100%;
    pointer-events: auto;
}

.chat-sidebar-shell__backdrop {
    display: none;
    appearance: none;
    border: 0;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(2px);
    z-index: 59;
}

.chat-sidebar {
    position: relative;
    z-index: 60;
    pointer-events: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background:
        radial-gradient(circle at top left, rgba(var(--brand-primary-rgb), 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.98));
    border-right: 1px solid var(--line);
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.04);
}

.chat-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.chat-sidebar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    text-decoration: none;
    color: var(--text-0);
}

.chat-sidebar__logo {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.chat-sidebar__mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), #7c83ff);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.14);
    box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), 0.18);
    font-weight: 900;
}

.chat-sidebar__brand-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.chat-sidebar__brand-name {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.chat-sidebar__brand-subtitle {
    font-size: 0.84rem;
    color: var(--text-2);
}

.chat-sidebar__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    color: var(--text-1);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.chat-sidebar__body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-sidebar__new-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--brand-primary), #6f77f7);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), 0.2);
    border: 0;
    pointer-events: auto;
}

.chat-sidebar__new-chat:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.chat-sidebar__new-chat-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1rem;
    line-height: 1;
}

.chat-sidebar__section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.chat-sidebar__section--history {
    flex: 1;
    min-height: 0;
}

.chat-sidebar__section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: var(--text-2);
}

.chat-sidebar__empty-state {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px dashed var(--line);
    background: rgba(255, 255, 255, 0.88);
}

.chat-sidebar__empty-state-title {
    font-weight: 800;
    color: var(--text-0);
    margin-bottom: 0.25rem;
}

.chat-sidebar__empty-state-text {
    color: var(--text-2);
    font-size: 0.92rem;
}

.chat-sidebar__conversation-groups {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 0.85rem;
    padding-right: 0.2rem;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.chat-sidebar__conversation-group {
    display: grid;
    gap: 0.55rem;
}

.chat-sidebar__conversation-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 900;
    color: var(--text-2);
    padding: 0 0.2rem;
}

.chat-sidebar__conversation-list {
    display: grid;
    gap: 0.55rem;
}

.chat-sidebar__conversation-item {
    display: grid;
    gap: 0.3rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-0);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
    pointer-events: auto;
}

.chat-sidebar__conversation-item:hover {
    background: rgba(var(--brand-primary-rgb), 0.06);
    border-color: rgba(var(--brand-primary-rgb), 0.18);
}

.chat-sidebar__conversation-item.is-active {
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.12), rgba(255, 255, 255, 0.96));
    border-color: rgba(var(--brand-primary-rgb), 0.2);
    box-shadow: 0 10px 22px rgba(var(--brand-primary-rgb), 0.12);
}

.chat-sidebar__conversation-item.is-active .chat-sidebar__conversation-item-title {
    color: var(--brand-primary);
}

.chat-sidebar__conversation-item.is-active .chat-sidebar__conversation-item-date {
    color: var(--brand-primary);
}

.chat-sidebar__conversation-item-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
}

.chat-sidebar__conversation-item-title {
    font-weight: 800;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-sidebar__conversation-item-date {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-2);
    white-space: nowrap;
}

.chat-sidebar__conversation-item-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    color: var(--text-2);
    font-size: 0.78rem;
}

.chat-sidebar__conversation-item-preview {
    color: var(--text-1);
    font-size: 0.88rem;
}

.chat-sidebar__nav {
    display: grid;
    gap: 0.45rem;
}

.chat-sidebar__nav-link {
    display: flex;
    align-items: center;
    min-height: 2.7rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.9rem;
    color: var(--text-1);
    text-decoration: none;
    border: 1px solid transparent;
    font-weight: 700;
    pointer-events: auto;
}

.chat-sidebar__nav-link:hover {
    background: rgba(var(--brand-primary-rgb), 0.06);
    color: var(--text-0);
}

.chat-sidebar__nav-link.active {
    background: rgba(var(--brand-primary-rgb), 0.12);
    color: var(--brand-primary);
    border-color: rgba(var(--brand-primary-rgb), 0.15);
}

.chat-sidebar__nav-link--accent {
    background: rgba(var(--brand-primary-rgb), 0.08);
    border-color: rgba(var(--brand-primary-rgb), 0.12);
}

.chat-sidebar__footer {
    display: grid;
    gap: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.chat-sidebar__user-card {
    display: grid;
    gap: 0.15rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
}

.chat-sidebar__user-status {
    color: var(--brand-primary);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chat-sidebar__user-name {
    font-weight: 800;
    color: var(--text-0);
}

.chat-sidebar__user-subtitle {
    font-size: 0.85rem;
    color: var(--text-2);
}

.chat-sidebar__auth-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.chat-sidebar__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.9rem;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid transparent;
}

.chat-sidebar__button--primary {
    background: linear-gradient(135deg, var(--brand-primary), #6f77f7);
    color: #fff;
}

.chat-sidebar__button--ghost {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-1);
    border-color: var(--line);
}

@media (max-width: 991.98px) {
    .chat-sidebar-shell {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 320px);
        min-width: 0;
        z-index: 60;
        transform: translateX(-102%);
        transition: transform 180ms ease;
        pointer-events: none;
    }

    .chat-sidebar-shell--open {
        transform: translateX(0);
        pointer-events: auto;
    }

    .chat-sidebar-shell--open .chat-sidebar-shell__backdrop {
        display: block;
    }

    .chat-sidebar {
        box-shadow: 22px 0 48px rgba(15, 23, 42, 0.18);
    }

    .chat-sidebar__close {
        display: inline-flex;
    }
}

@media (min-width: 992px) {
    .chat-sidebar-shell {
        position: sticky;
        top: 0;
    }
}

/* ChatHomeShell migrated from CSS isolation. */
.chat-home-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    gap: 0;
    width: min(100%, 1320px);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    margin-inline: auto;
    padding: 0.75rem;
    box-sizing: border-box;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(var(--brand-primary-rgb), 0.08), transparent 26%),
        radial-gradient(circle at top right, rgba(var(--brand-secondary-rgb), 0.05), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 48%, #eef2ff 100%);
}

.chat-home-shell__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.chat-home-shell__sidebar,
.chat-home-shell__main {
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
}

.chat-home-shell__sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.9rem;
}

.chat-home-shell__sidebar-header,
.chat-home-shell__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.chat-home-shell__sidebar-header {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-home-shell__sidebar-header .text-uppercase {
    letter-spacing: 0.11em;
    font-size: 0.68rem !important;
    font-weight: 700;
}

.chat-home-shell__sidebar-header h2 {
    font-size: 1rem;
    color: #0f172a;
}

.chat-home-shell__action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.45rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.chat-home-shell__action-button--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), #7c83ff);
    box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), 0.16);
}

.chat-home-shell__action-button--ghost {
    color: #0f172a;
    background: rgba(248, 250, 252, 0.96);
    border-color: rgba(148, 163, 184, 0.22);
}

.chat-home-shell__action-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.chat-home-shell__action-button:focus-visible {
    outline: 3px solid rgba(var(--brand-primary-rgb), 0.2);
    outline-offset: 2px;
}

.chat-home-shell__action-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.chat-home-shell__sidebar-empty,
.chat-home-shell__empty-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
}

.chat-home-shell__sidebar-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.chat-home-shell__sidebar .alert {
    border-radius: 1rem;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.14);
    background: rgba(var(--brand-primary-rgb), 0.06);
    color: #1e293b;
    box-shadow: none;
}

.chat-home-shell__main .alert {
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.96);
    color: #334155;
    box-shadow: none;
}

.chat-home-shell__main .alert-danger {
    border-color: rgba(239, 68, 68, 0.18);
    background: rgba(254, 242, 242, 0.96);
    color: #991b1b;
}

.chat-home-shell__conversation-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 0;
    overflow: hidden;
    padding-right: 0.15rem;
    scrollbar-gutter: stable;
}

.chat-home-shell__conversation-item {
    text-align: left;
    border-radius: 0.95rem;
    margin-bottom: 0;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    padding: 0.72rem 0.8rem;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.chat-home-shell__conversation-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    border-color: rgba(var(--brand-primary-rgb), 0.26);
    background: rgba(255, 255, 255, 1);
}

.chat-home-shell__conversation-item.active {
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.12), rgba(var(--brand-secondary-rgb), 0.06));
    border-color: rgba(var(--brand-primary-rgb), 0.3);
    box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), 0.1);
}

.chat-home-shell__conversation-item .d-flex {
    align-items: baseline;
}

.chat-home-shell__conversation-item small {
    color: #94a3b8;
}

.chat-home-shell__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    width: auto;
    margin-inline: 0;
    padding: 1rem 1.1rem 0.9rem;
    gap: 0.85rem;
}

.chat-home-shell__topbar {
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-home-shell__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.chat-home-shell__eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #64748b;
}

.chat-home-shell__title {
    font-size: 1.04rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.chat-home-shell__subtitle {
    font-size: 0.88rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(58ch, 100%);
}

.chat-home-shell__topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-home-shell__sidebar-toggle {
    display: none;
}

.chat-home-shell__messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.8rem 0.25rem 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 1.1rem;
}

.chat-home-shell__messages > * {
    width: min(100%, 860px);
    margin-inline: auto;
}

.chat-home-shell__empty-hint {
    margin-top: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(var(--brand-primary-rgb), 0.06);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.12);
}

.chat-home-shell__empty-hint-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #0f172a;
}

.chat-home-shell__message {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    animation: chatMessageIn 180ms ease-out both;
    animation-delay: calc(var(--chat-message-index, 0) * 45ms);
    will-change: transform, opacity;
}

.chat-home-shell__message--user {
    justify-content: flex-end;
}

.chat-home-shell__message-body {
    display: grid;
    gap: 0.4rem;
    max-width: min(760px, 100%);
}

.chat-home-shell__message--user .chat-home-shell__message-body {
    align-items: end;
}

.chat-home-shell__message-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    font-size: 0.76rem;
    color: #64748b;
    margin-bottom: 0.05rem;
}

.chat-home-shell__bubble {
    border-radius: 1rem;
    padding: 0.92rem 1rem;
    white-space: pre-wrap;
    line-height: 1.58;
    font-size: 0.98rem;
    word-break: break-word;
}

.chat-home-shell__bubble--assistant {
    white-space: normal;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.chat-home-shell__bubble--assistant .markdown-message__content {
    padding-inline: 0.9rem;
}

.chat-home-shell__bubble--user {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #ffffff;
    border: 0;
    box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), 0.2);
}

.chat-home-shell__bubble--typing {
    color: #64748b;
}

.chat-home-shell__bubble-text {
    white-space: pre-wrap;
}

.chat-home-shell__composer-wrap {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    padding-top: 0.15rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(248, 250, 252, 0.96) 24px);
}

.chat-home-shell__rate-limit-note {
    margin-top: 0.45rem;
    padding-inline: 0.25rem;
    color: #64748b;
    font-size: 0.85rem;
}

@media (max-width: 991.98px) {
    .chat-home-shell {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 0.7rem;
    }

    .chat-home-shell__overlay {
        display: block;
        opacity: 0;
        pointer-events: none;
        z-index: 19;
    }

    .chat-home-shell__sidebar {
        position: fixed;
        top: 0.7rem;
        bottom: 0.7rem;
        left: 0.7rem;
        width: min(88vw, 320px);
        z-index: 20;
        transform: translateX(calc(-100% - 1rem));
        transition: transform 220ms ease;
        box-shadow: 24px 0 50px rgba(0, 0, 0, 0.42);
    }

    .chat-home-shell--sidebar-open .chat-home-shell__sidebar {
        transform: translateX(0);
    }

    .chat-home-shell--sidebar-open .chat-home-shell__overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .chat-home-shell__sidebar-toggle {
        display: inline-flex;
    }

    .chat-home-shell__subtitle {
        white-space: normal;
    }

    .chat-home-shell__main {
        width: 100%;
        padding: 0.8rem;
    }

    .chat-home-shell__messages {
        padding: 0.75rem 0.2rem 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .chat-home-shell {
        padding: 0.45rem;
        gap: 0.6rem;
    }

    .chat-home-shell__main,
    .chat-home-shell__sidebar {
        padding: 0.8rem;
        border-radius: 1rem;
    }

    .chat-home-shell__topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-home-shell__topbar-actions {
        justify-content: space-between;
    }

    .chat-home-shell__messages {
        border-radius: 0.95rem;
    }

    .chat-home-shell__messages > * {
        width: 100%;
    }

    .chat-home-shell__message-body {
        max-width: 100%;
    }
}

@media (max-width: 667.98px) {
    .chat-home-shell {
        padding-inline: 0;
    }

    .chat-home-shell__main {
        padding-inline: 0;
    }

    .chat-home-shell__messages {
        padding-inline: 0;
        overflow-x: hidden;
    }

    .chat-home-shell__message {
        gap: 0.4rem;
        min-width: 0;
    }

    .chat-home-shell__message--assistant {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-home-shell__message-body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .chat-home-shell__bubble--assistant {
        padding-inline: 0;
    }

    .chat-home-shell__message--assistant .chat-home-shell__message-body {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-home-shell__messages,
    .chat-home-shell__message,
    .chat-home-shell__conversation-item,
    .chat-home-shell__action-button {
        scroll-behavior: auto;
        animation: none;
        transition: none;
    }
}


/* GlobalChatPanel migrated from CSS isolation. */
.global-chat-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1020;
    pointer-events: none;
}

.global-chat-host--open,
.global-chat-host--minimized {
    pointer-events: auto;
}

.global-chat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-primary), #7c83ff);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.32);
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.global-chat-launcher:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
}

.global-chat-launcher__icon {
    font-size: 1.1rem;
}

.global-chat-launcher__text {
    letter-spacing: 0.02em;
}

.global-chat-panel {
    width: clamp(21rem, 32vw, 28rem);
    height: min(78dvh, 52rem);
    display: flex;
    flex-direction: column;
    border-radius: 1.35rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background:
        radial-gradient(circle at top, rgba(var(--brand-primary-rgb), 0.08), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.global-chat-panel--minimized {
    width: 20rem;
    height: auto;
    padding: 0.8rem;
}

.global-chat-panel__minimized-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.global-chat-panel__minimized-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.global-chat-panel__minimized-copy strong,
.global-chat-panel__title {
    color: #0f172a;
}

.global-chat-panel__minimized-copy span,
.global-chat-panel__subtitle,
.global-chat-panel__eyebrow {
    color: #64748b;
}

.global-chat-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.global-chat-panel__brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.global-chat-panel__title-wrap {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.global-chat-panel__eyebrow {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.global-chat-panel__title {
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.2;
}

.global-chat-panel__subtitle {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-chat-panel__header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.global-chat-panel__icon-button {
    appearance: none;
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.98);
    color: #0f172a;
    line-height: 1;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.global-chat-panel__icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--brand-primary-rgb), 0.28);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.global-chat-panel__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
}

.global-chat-panel__messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding-right: 0.15rem;
    scrollbar-gutter: stable;
}

.global-chat-panel__messages > * {
    width: min(100%, 100%);
}

.global-chat-panel__message {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    animation: globalChatMessageIn 180ms ease-out both;
    animation-delay: calc(var(--chat-message-index, 0) * 42ms);
    will-change: transform, opacity;
}

.global-chat-panel__message--user {
    justify-content: flex-end;
}

.global-chat-panel__message-body {
    display: grid;
    gap: 0.38rem;
    max-width: 100%;
}

.global-chat-panel__message-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.76rem;
    color: #64748b;
}

.global-chat-panel__bubble {
    border-radius: 1rem;
    padding: 0.92rem 1rem;
    white-space: pre-wrap;
    line-height: 1.58;
    font-size: 0.98rem;
    word-break: break-word;
}

.global-chat-panel__bubble--assistant {
    white-space: normal;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.global-chat-panel__bubble--assistant .markdown-message__content {
    padding-inline: 0.9rem;
}

.global-chat-panel__bubble--user {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), 0.2);
}

.global-chat-panel__bubble--typing {
    color: #64748b;
}

.global-chat-panel__bubble-text {
    white-space: pre-wrap;
}

.global-chat-panel__empty-hint {
    margin-top: 0.4rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.16);
    background: rgba(var(--brand-primary-rgb), 0.06);
}

.global-chat-panel__empty-hint-title {
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.global-chat-panel__empty-hint-text {
    color: #64748b;
}

.global-chat-panel__composer-wrap {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    padding-top: 0.1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(248, 250, 252, 0.96) 24px);
}

.global-chat-panel__rate-limit-note {
    margin-top: 0.4rem;
    padding-inline: 0.25rem;
    color: #64748b;
    font-size: 0.82rem;
}

.global-chat-panel__error {
    margin: 0;
    border-radius: 1rem;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(254, 242, 242, 0.96);
    color: #991b1b;
}

.global-chat-host--minimized .global-chat-panel {
    height: auto;
    overflow: hidden;
}

@keyframes globalChatMessageIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 991.98px) {
    .global-chat-host {
        right: 0.65rem;
        bottom: 0.65rem;
    }

    .global-chat-panel {
        width: min(100vw - 1.3rem, 34rem);
        height: min(84dvh, 58rem);
    }

    .global-chat-panel--minimized {
        width: min(100vw - 1.3rem, 22rem);
    }
}

@media (max-width: 640.98px) {
    .global-chat-host {
        inset: auto 0.5rem 0.5rem 0.5rem;
    }

    .global-chat-launcher {
        width: auto;
        justify-content: center;
    }

    .global-chat-panel {
        width: calc(100vw - 1rem);
        height: min(82dvh, 44rem);
        border-radius: 1.2rem 1.2rem 0.75rem 0.75rem;
    }

    .global-chat-panel--minimized {
        width: calc(100vw - 1rem);
    }

    .global-chat-panel__subtitle {
        white-space: normal;
    }
}

@media (max-width: 667.98px) {
    .global-chat-panel__body {
        padding-inline: 0;
    }

    .global-chat-panel__messages {
        padding-inline: 0;
        overflow-x: hidden;
    }

    .global-chat-panel__message {
        gap: 0.4rem;
        min-width: 0;
    }

    .global-chat-panel__message--assistant {
        flex-direction: column;
        align-items: flex-start;
    }

    .global-chat-panel__message-body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .global-chat-panel__bubble--assistant {
        padding-inline: 0;
    }

    .global-chat-panel__message--assistant .global-chat-panel__message-body {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .global-chat-launcher,
    .global-chat-panel__icon-button,
    .global-chat-panel__message {
        transition: none;
        animation: none;
    }
}
