.has-ai-root,
.has-ai-root * {
    box-sizing: border-box;
}

.has-ai-root {
    --has-navy: #061f3d;
    --has-navy-2: #0b2d56;
    --has-red: #e31f26;
    --has-text: #14233a;
    --has-muted: #647184;
    --has-line: #e3e8ee;
    font-family: Arial, Helvetica, sans-serif;
}

.has-ai-launcher {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 999998;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background: var(--has-navy);
    color: #fff;
    box-shadow: 0 12px 35px rgba(5, 25, 50, .28);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease;
}

.has-ai-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 38px rgba(5, 25, 50, .34);
}

.has-ai-launcher:after {
    content: "";
    position: absolute;
    right: 1px;
    top: 2px;
    width: 13px;
    height: 13px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #20b85a;
}

.has-ai-launcher svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.has-ai-launcher > span {
    position: absolute;
    right: -2px;
    bottom: -2px;
    min-width: 25px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 10px;
    background: var(--has-red);
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
}

.has-ai-panel {
    position: fixed;
    right: 22px;
    bottom: 166px;
    z-index: 999999;
    width: 380px;
    height: min(570px, calc(100vh - 190px));
    min-height: 430px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(6, 31, 61, .10);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(4, 24, 47, .24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.has-ai-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.has-ai-header {
    position: relative;
    min-height: 76px;
    padding: 14px 52px 14px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--has-navy), var(--has-navy-2));
}

.has-ai-header:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--has-red);
}

.has-ai-brandmark {
    flex: 0 0 auto;
    width: 43px;
    height: 43px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -.03em;
}

.has-ai-headcopy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.has-ai-headcopy strong {
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.has-ai-headcopy span {
    color: #cbd8e6;
    font-size: 11px;
}

.has-ai-headcopy i {
    width: 7px;
    height: 7px;
    margin-right: 5px;
    display: inline-block;
    border-radius: 50%;
    background: #20b85a;
}

.has-ai-close {
    position: absolute;
    right: 15px;
    top: 18px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 30px;
}

.has-ai-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 17px 14px 8px;
    background:
        linear-gradient(rgba(247,249,252,.94), rgba(247,249,252,.94)),
        radial-gradient(circle at 20% 15%, rgba(6,31,61,.08), transparent 28%);
}

.has-ai-message {
    width: 100%;
    margin: 0 0 10px;
    display: flex;
}

.has-ai-message.has-ai-user {
    justify-content: flex-end;
}

.has-ai-bubble {
    max-width: 84%;
    padding: 10px 12px;
    border: 1px solid var(--has-line);
    border-radius: 13px 13px 13px 4px;
    background: #fff;
    color: var(--has-text);
    box-shadow: 0 3px 10px rgba(12,31,52,.035);
    font-size: 13px;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.has-ai-user .has-ai-bubble {
    border-color: var(--has-navy);
    border-radius: 13px 13px 4px 13px;
    background: var(--has-navy);
    color: #fff;
}

.has-ai-error .has-ai-bubble {
    border-color: #f2c7c9;
    background: #fff7f7;
}

.has-ai-quick {
    flex: 0 0 auto;
    padding: 7px 12px 3px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    background: #fff;
}

.has-ai-quick button {
    flex: 0 0 auto;
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid #ccd6e1;
    border-radius: 16px;
    background: #fff;
    color: var(--has-navy);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.has-ai-quick button:hover {
    border-color: var(--has-red);
    color: var(--has-red);
}

.has-ai-actions {
    flex: 0 0 auto;
    padding: 5px 12px 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    background: #fff;
}

.has-ai-actions a {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--has-navy);
    border-radius: 6px;
    color: var(--has-navy);
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 800;
}

.has-ai-actions a:last-child {
    border-color: var(--has-red);
    background: var(--has-red);
    color: #fff;
}

.has-ai-form {
    flex: 0 0 auto;
    margin: 0 12px;
    padding: 7px 7px 7px 11px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    border: 1px solid #cad4df;
    border-radius: 11px;
    background: #fff;
}

.has-ai-form:focus-within {
    border-color: #8ba0b7;
    box-shadow: 0 0 0 3px rgba(11,45,86,.06);
}

.has-ai-form textarea {
    flex: 1 1 auto;
    width: 100%;
    min-height: 36px;
    max-height: 100px;
    padding: 8px 2px 6px;
    resize: none;
    overflow-y: auto;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--has-text);
    box-shadow: none !important;
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
}

.has-ai-form button {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--has-red);
    color: #fff;
    cursor: pointer;
}

.has-ai-form button:disabled {
    opacity: .55;
    cursor: wait;
}

.has-ai-form button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.has-ai-disclaimer {
    flex: 0 0 auto;
    padding: 7px 14px 10px;
    color: #7b8794;
    background: #fff;
    font-size: 9.5px;
    line-height: 1.35;
    text-align: center;
}

.has-ai-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.has-ai-typing {
    width: 55px;
    display: flex;
    gap: 4px;
}

.has-ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8190a1;
    animation: has-ai-dot 1.1s infinite ease-in-out;
}

.has-ai-typing span:nth-child(2) {
    animation-delay: .12s;
}

.has-ai-typing span:nth-child(3) {
    animation-delay: .24s;
}

@keyframes has-ai-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 600px) {
    .has-ai-launcher {
        right: 14px;
        bottom: 88px;
        width: 58px;
        height: 58px;
    }

    .has-ai-panel {
        left: 10px;
        right: 10px;
        bottom: 158px;
        width: auto;
        height: min(570px, calc(100vh - 178px));
        min-height: 390px;
    }

    .has-ai-bubble {
        max-width: 88%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .has-ai-panel,
    .has-ai-launcher,
    .has-ai-typing span {
        transition: none;
        animation: none;
    }
}
