.chat {
    position: fixed;
    right: var(--space-md);
    bottom: 4.75rem;
    z-index: 70;
    font-family: var(--font);
}
.chat-launcher {
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    border: 0;
    border-radius: 99px;
    background: var(--primary);
    color: #fff;
    font: 500 0.875rem/1.25rem var(--font);
    box-shadow: var(--shadow-2);
    cursor: pointer;
}
.chat-launcher:hover {
    background: var(--primary-container);
}
.chat-panel {
    position: fixed;
    right: var(--space-md);
    bottom: var(--space-md);
    width: min(24rem, calc(100vw - 2rem));
    height: min(34rem, calc(100dvh - 2rem));
    display: flex;
    flex-direction: column;
    background: #fff;
    border: var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}
.chat-panel[hidden] {
    display: none;
}
.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-low);
    border-bottom: var(--border);
}
.chat-head h2 {
    margin: 0;
}
.chat-close {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: var(--r);
    background: transparent;
    color: var(--primary);
    font: 500 0.875rem var(--font);
    cursor: pointer;
}
.chat-close:hover {
    background: var(--surface-container);
}
.chat-notice {
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--on-surface-variant);
    background: var(--amber-bg);
}
.chat-log {
    flex: 1;
    overflow: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.chat-msg {
    max-width: 88%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    line-height: 1.35rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.chat-msg--bot {
    align-self: flex-start;
    background: var(--surface-container);
    color: var(--on-surface);
}
.chat-msg--user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
}
.chat-msg .chip {
    margin-top: var(--space-sm);
    display: block;
}
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: 0 var(--space-md) var(--space-sm);
}
.chat-chips[hidden],
.chat-contact[hidden] {
    display: none;
}
.chat-contact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: 0 var(--space-md) var(--space-sm);
}
.chat-contact .btn {
    min-height: 2.5rem;
    padding: 0.35rem 0.9rem;
}
.chat-form {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md) var(--space-md);
    border-top: var(--border);
}
.chat-form .btn:disabled,
.chat-form .input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
@media (max-width: 30em) {
    .chat-panel {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: min(36rem, 85dvh);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
    }
}
