.templeo-assistant {
    --templeo-ink: #202742;
    --templeo-violet: #8460c4;
    --templeo-pink: #c2378b;
    --templeo-sky: #438ea5;
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 2147483000;
    font-family: Inter, Poppins, Arial, sans-serif;
    color: var(--templeo-ink);
}

.templeo-assistant__trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 8px 19px 8px 8px;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 999px;
    background: linear-gradient(120deg, var(--templeo-violet), var(--templeo-pink));
    color: #fff;
    box-shadow: 0 12px 32px rgba(194, 55, 139, .42), 0 0 0 5px rgba(194, 55, 139, .12);
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
}

.templeo-assistant__trigger-icon,
.templeo-assistant__brand {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--templeo-sky), var(--templeo-violet), var(--templeo-pink));
    color: #fff;
    font-weight: 800;
}

.templeo-assistant__trigger-icon { width: 40px; height: 40px; font-size: 19px; background: rgba(32, 39, 66, .78); }
.templeo-assistant__brand { width: 42px; height: 42px; flex: 0 0 42px; font-size: 20px; }

.templeo-assistant__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(390px, calc(100vw - 28px));
    height: min(590px, calc(100vh - 110px));
    overflow: hidden;
    border: 1px solid #e5e7ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(32, 39, 66, .26);
}

.templeo-assistant__panel[hidden] { display: none !important; }
.templeo-assistant__panel:not([hidden]) { display: flex; flex-direction: column; }
.templeo-assistant.is-open .templeo-assistant__trigger { visibility: hidden; }

.templeo-assistant__header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 16px;
    color: #fff;
    background: var(--templeo-ink);
}

.templeo-assistant__header strong { display: block; color: #fff; font-size: 15px; }
.templeo-assistant__role { display: block; margin-top: 1px; color: rgba(255,255,255,.76); font-size: 12px; }
.templeo-assistant__close { margin-left: auto; padding: 5px; border: 0; background: transparent; color: #fff; font-size: 27px; line-height: 1; cursor: pointer; }

.templeo-assistant__messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 11px;
    overflow-y: auto;
    padding: 16px;
    background: #f6f7fa;
}

.templeo-assistant__message {
    max-width: 86%;
    padding: 10px 13px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.48;
}

.templeo-assistant__message--bot { align-self: flex-start; border: 1px solid #e3e6ee; border-bottom-left-radius: 4px; background: #fff; }
.templeo-assistant__message--user { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--templeo-violet); color: #fff; }
.templeo-assistant__status { padding: 7px 16px; background: #f6f7fa; color: #697289; font-size: 12px; }

.templeo-assistant__actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e5e7ef;
    background: #fff;
}
.templeo-assistant__actions[hidden] { display: none !important; }
.templeo-assistant__actions button,
.templeo-assistant__actions a {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.templeo-assistant__apply-chat {
    border: 0;
    background: linear-gradient(120deg, var(--templeo-violet), var(--templeo-pink));
    color: #fff;
}
.templeo-assistant__apply-classic {
    border: 1px solid var(--templeo-violet);
    background: #fff;
    color: var(--templeo-violet);
}

.templeo-assistant__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 12px;
    border-top: 1px solid #e5e7ef;
}

.templeo-assistant__form textarea {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px;
    max-height: 110px;
    resize: none;
    padding: 10px 12px;
    border: 1px solid #cfd4df;
    border-radius: 11px;
    outline: none;
    font: inherit;
    font-size: 14px;
}

.templeo-assistant__form textarea:focus { border-color: var(--templeo-violet); box-shadow: 0 0 0 2px rgba(132, 96, 196, .13); }
.templeo-assistant__form button {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 76px;
    min-height: 42px;
    padding: 0 15px !important;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(120deg, var(--templeo-violet), var(--templeo-pink));
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}
.templeo-assistant__form button:disabled { opacity: .55; cursor: wait; }
.templeo-assistant__privacy { margin: 0; padding: 0 13px 11px; color: #727b90; font-size: 10.5px; line-height: 1.35; }

@media (max-width: 520px) {
    .templeo-assistant { right: 14px; bottom: 84px; }
    .templeo-assistant__panel { position: fixed; inset: 10px; width: auto; height: auto; }
    .templeo-assistant__trigger-label { display: none; }
    .templeo-assistant__trigger { padding-right: 8px; }
    .templeo-assistant__form button { min-width: 64px; padding-inline: 11px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .templeo-assistant * { scroll-behavior: auto !important; }
}
