#vhvc-chat {
    --vhvc-ink: #22382e;
    --vhvc-muted: #55534d;
    --vhvc-paper: #fbfaf5;
    --vhvc-accent: #e7dfbe;
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 10000;
    color: var(--vhvc-ink);
    font: 400 15px/1.45 system-ui, sans-serif;
    text-align: left;
}
#vhvc-chat [hidden] { display: none !important; }
#vhvc-chat *, #vhvc-chat *::before, #vhvc-chat *::after { box-sizing: border-box; }
#vhvc-chat button {
    border: 0;
    background: var(--vhvc-ink);
    color: white;
    border-radius: 100px;
    padding: 0 16px;
    font: inherit;
    font-weight: 650;
    min-height: 44px;
    cursor: pointer;
}
#vhvc-chat button:disabled { opacity: .6; cursor: wait; }
#vhvc-chat :focus-visible { outline: 2px solid #3865bd; outline-offset: 3px; }
#vhvc-chat .vhvc-launch {
    display: block;
    margin-left: auto;
    background: var(--vhvc-accent);
    color: var(--vhvc-ink);
    box-shadow: 0 4px 22px #0003;
    padding-inline: 19px;
    min-height: 48px;
}
#vhvc-panel {
    display: flex;
    flex-direction: column;
    width: min(370px, calc(100vw - 40px));
    height: min(500px, calc(100vh - 90px));
    height: min(500px, calc(100dvh - 90px));
    overflow: auto;
    margin-bottom: 10px;
    background: var(--vhvc-paper);
    border: 1px solid #dedcd4;
    border-radius: 18px;
    box-shadow: 0 12px 45px #0003;
}
#vhvc-chat .vhvc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background: var(--vhvc-ink);
    color: white;
}
#vhvc-title { margin: 0; color: inherit; font: 700 17px/1.35 system-ui, sans-serif; }
#vhvc-chat .vhvc-close { font-size: 24px; }
#vhvc-chat .vhvc-log { flex: 1; min-height: 44px; overflow: auto; padding: 12px; }
#vhvc-chat .vhvc-message {
    width: fit-content;
    max-width: 92%;
    padding: 9px 12px;
    margin: 0 0 9px;
    border-radius: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
#vhvc-chat .vhvc-agent { background: #edf1e9; }
#vhvc-chat .vhvc-visitor { background: var(--vhvc-accent); margin-left: auto; }
#vhvc-chat .vhvc-status { margin: 0; padding: 0 12px 8px; font-size: 12px; color: var(--vhvc-muted); }
#vhvc-chat .vhvc-status:empty { display: none; }
#vhvc-chat .vhvc-form { display: flex; gap: 8px; padding: 8px 12px; margin: 0; }
#vhvc-message {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #aaa69b;
    border-radius: 10px;
    padding: 8px 10px;
    background: white;
    color: var(--vhvc-ink);
    font: 400 16px/1.3 system-ui, sans-serif;
}
#vhvc-chat .vhvc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

#vhvc-chat .vhvc-prompts { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 12px; }
#vhvc-chat .vhvc-prompts button {
    background: #eef2eb;
    color: var(--vhvc-ink);
    border: 1px solid #d8e2d7;
    font-size: 12px;
    min-height: 34px;
    padding-inline: 10px;
}
#vhvc-chat .vhvc-message a { color: inherit; text-decoration: underline; font-weight: 650; }

#vhvc-chat .vhvc-typing {
    display: inline-flex;
    gap: 4px;
    margin-inline-start: 7px;
    align-items: center;
    vertical-align: middle;
}
#vhvc-chat .vhvc-typing span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: vhvc-typing-bounce 900ms ease-in-out infinite;
}
#vhvc-chat .vhvc-typing span:nth-child(2) { animation-delay: 120ms; }
#vhvc-chat .vhvc-typing span:nth-child(3) { animation-delay: 240ms; }
@keyframes vhvc-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    #vhvc-chat .vhvc-typing span { animation: none; }
}

#vhvc-chat .vhvc-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 8px;
    font-size: 13px;
}
