.hm-assistant {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1080;
    font-family: inherit;
}

.hm-assistant__button {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #151515;
    color: #fff;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.hm-assistant__button:focus-visible,
.hm-assistant__send:focus-visible,
.hm-assistant__close:focus-visible,
.hm-assistant__cta:focus-visible {
    outline: 3px solid rgba(71, 180, 138, 0.35);
    outline-offset: 3px;
}

.hm-assistant__panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(380px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 110px));
    background: #fff;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    display: none;
    overflow: hidden;
}

.hm-assistant.is-open .hm-assistant__panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.hm-assistant__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #151515;
    color: #fff;
}

.hm-assistant__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
}

.hm-assistant__status {
    margin: 2px 0 0;
    color: #b8f1d6;
    font-size: 0.78rem;
}

.hm-assistant__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hm-assistant__messages {
    padding: 14px;
    background: #f8faf9;
    overflow-y: auto;
}

.hm-assistant__message {
    max-width: 86%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 0.93rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.hm-assistant__message-text {
    display: block;
}

.hm-assistant__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 34px;
    margin-top: 10px;
    padding: 7px 11px;
    border-radius: 8px;
    background: #151515;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.hm-assistant__cta:hover {
    color: #fff;
    text-decoration: none;
    background: #1d6f50;
}

.hm-assistant__message--bot {
    position: relative;
    background: #fff;
    color: #20242a;
    border: 1px solid #e6e8ec;
    padding-right: 42px;
}

.hm-assistant__message--user {
    margin-left: auto;
    background: #1d6f50;
    color: #fff;
}

.hm-assistant__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e6e8ec;
    background: #fff;
}

.hm-assistant__input {
    min-width: 0;
    border: 1px solid #d5d9df;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.hm-assistant__send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: #151515;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.12rem;
}

.hm-assistant__send:disabled {
    background: #8d949e;
    cursor: wait;
}

.hm-assistant__speech {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 28px;
    height: 28px;
    border: 1px solid #dbe1e7;
    border-radius: 50%;
    background: #f8faf9;
    color: #151515;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
}

.hm-assistant__speech:disabled {
    color: #6b7280;
    cursor: wait;
}

@media (max-width: 520px) {
    .hm-assistant {
        right: 12px;
        bottom: 12px;
    }

    .hm-assistant__panel {
        right: -4px;
        bottom: 68px;
        width: calc(100vw - 24px);
        height: min(620px, calc(100vh - 96px));
    }
}
