#hth-chat-root {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9999;
    font-family: var(--hth-font, system-ui, sans-serif);
    overflow: visible;
}

.hth-chat-launcher {
    position: relative;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: none;
    background: var(--hth-accent, #eb633d);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hth-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hth-chat-launcher:hover {
    background: var(--hth-accent-hover, #d4532f);
}

.hth-chat-launcher.is-open {
    background: #374151;
}

.hth-chat-launcher.is-open:hover {
    background: #1f2937;
}

.hth-chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(3.25rem + 0.75rem);
    width: min(380px, calc(100vw - 2rem));
    height: min(520px, calc(100dvh - 6rem));
    max-height: calc(100dvh - 5rem);
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 0 12px rgba(0, 0, 0, 0.06),
        0 0 28px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1;
}

.hth-chat-panel[hidden] {
    display: none !important;
}

.hth-chat-head {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fafafa;
}

.hth-chat-head strong {
    display: block;
    font-size: 1rem;
}

.hth-chat-head span,
.hth-chat-head__hint {
    font-size: 0.8rem;
    color: var(--hth-text-muted, #4b5563);
}

.hth-chat-head__status {
    margin-top: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.78rem;
    line-height: 1.35;
}

.hth-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f3f4f6;
}

.hth-chat-empty {
    color: var(--hth-text-muted, #4b5563);
    font-size: 0.9rem;
}

.hth-chat-msg {
    max-width: 88%;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.4;
    word-break: break-word;
}

.hth-chat-msg--client {
    background: #fff;
    margin-left: auto;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.hth-chat-msg--operator {
    background: #e8f5e9;
    margin-right: auto;
}

.hth-chat-extra {
    padding: 0.5rem 1rem 0;
}

.hth-chat-extra input {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.hth-chat-extra input:last-child {
    margin-bottom: 0;
}

.hth-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.hth-chat-form input[type="text"] {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
}

.hth-chat-form button {
    border: none;
    border-radius: 8px;
    background: var(--hth-accent, #eb633d);
    color: #fff;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.hth-chat-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}
