[data-pwa-install] {
    color: #fbbf24;
}

[data-pwa-install].is-visible {
    display: grid !important;
}

.pe-pwa-ios-tip {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: end center;
    padding: 18px;
    background: rgba(0, 0, 0, .5);
}

.pe-pwa-ios-tip.is-visible {
    display: grid;
}

.pe-pwa-ios-tip__panel {
    width: min(420px, 100%);
    border: 1px solid #3f3f46;
    border-radius: 12px;
    padding: 18px;
    background: #18181b;
    color: #f8fafc;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.pe-pwa-ios-tip__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 900;
}

.pe-pwa-ios-tip__body {
    margin: 0;
    color: #d4d4d8;
    font-size: 14px;
    line-height: 1.7;
}

.pe-pwa-ios-tip__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.pe-pwa-ios-tip__close {
    min-height: 38px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0 14px;
    background: #d97706;
    color: #111111;
    font-weight: 900;
    cursor: pointer;
}

.pe-pwa-app-menu {
    position: relative;
    display: inline-flex;
}

.pe-pwa-app-menu__trigger {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--gray-500, #71717a);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}

.pe-pwa-app-menu__trigger:hover,
.pe-pwa-app-menu__trigger[aria-expanded="true"] {
    background: rgba(245, 158, 11, .12);
    color: #d97706;
}

.pe-pwa-app-menu__trigger svg {
    width: 1.25rem;
    height: 1.25rem;
}

.pe-pwa-app-menu__panel {
    position: absolute;
    inset-block-start: calc(100% + .5rem);
    inset-inline-end: 0;
    z-index: 90;
    min-width: 13rem;
    overflow: hidden;
    border: 1px solid rgba(161, 161, 170, .22);
    border-radius: .75rem;
    background: #18181b;
    padding: .35rem;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

html:not(.dark) .pe-pwa-app-menu__panel {
    border-color: rgba(209, 213, 219, .95);
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.pe-pwa-app-menu__item {
    display: flex;
    width: 100%;
    min-height: 2.45rem;
    align-items: center;
    gap: .65rem;
    border: 0;
    border-radius: .55rem;
    background: transparent;
    color: #f8fafc;
    padding: .55rem .7rem;
    font: 700 .875rem/1.25 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: start;
    cursor: pointer;
}

html:not(.dark) .pe-pwa-app-menu__item {
    color: #111827;
}

html:not(.dark) .pe-pwa-app-menu__item:hover {
    background: #fff7ed;
    color: #9a3412;
}

.pe-pwa-app-menu__item:hover {
    background: rgba(245, 158, 11, .14);
    color: #fbbf24;
}

.pe-pwa-app-menu__item.is-visible {
    display: flex !important;
}

.pe-pwa-app-menu__item svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

html[dir="rtl"] .pe-pwa-app-menu__panel {
    inset-inline-end: auto;
    inset-inline-start: 0;
}

.pe-topbar-tools {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin-inline-end: .25rem;
}

.pe-ai-chat {
    position: relative;
    display: inline-flex;
}

.pe-ai-chat__trigger {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--gray-500, #71717a);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.pe-ai-chat__trigger:hover,
.pe-ai-chat__trigger[aria-expanded="true"] {
    background: rgba(245, 158, 11, .12);
    color: #d97706;
}

.pe-ai-chat__trigger:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

.pe-ai-chat__trigger::before {
    width: 1.35rem;
    height: 1.35rem;
    background: currentColor;
    content: "";
    mask: url("/images/chatbot.svg") center / contain no-repeat;
    -webkit-mask: url("/images/chatbot.svg") center / contain no-repeat;
}

.pe-ai-chat__trigger img {
    display: none;
}

.pe-ai-chat__panel {
    position: fixed;
    inset-block-start: 4.25rem;
    inset-inline-end: 1rem;
    z-index: 95;
    display: flex;
    width: min(26rem, calc(100vw - 1.5rem));
    max-height: min(36rem, calc(100dvh - 5.25rem));
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(161, 161, 170, .22);
    border-radius: .5rem;
    background: #111827;
    color: #f8fafc;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

html.dark .pe-ai-chat__panel {
    background: #18181b;
}

.pe-ai-chat__panel[hidden] {
    display: none !important;
}

html:not(.dark) .pe-ai-chat__panel {
    border-color: rgba(209, 213, 219, .95);
    background: #ffffff;
    color: #111827;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .16);
}

.pe-ai-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
    padding: .85rem .95rem;
}

html:not(.dark) .pe-ai-chat__header {
    border-bottom-color: rgba(226, 232, 240, .95);
}

.pe-ai-chat__heading {
    min-width: 0;
}

.pe-ai-chat__eyebrow {
    display: block;
    color: #f59e0b;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2;
}

.pe-ai-chat__title {
    margin: .15rem 0 0;
    color: inherit;
    font-size: .96rem;
    font-weight: 850;
    line-height: 1.25;
}

.pe-ai-chat__close {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: .5rem;
    background: rgba(148, 163, 184, .12);
    color: #cbd5e1;
    cursor: pointer;
}

html:not(.dark) .pe-ai-chat__close {
    color: #475569;
}

.pe-ai-chat__close:hover {
    background: rgba(245, 158, 11, .14);
    color: #fbbf24;
}

.pe-ai-chat__close svg,
.pe-ai-chat__send svg,
.pe-ai-chat__copy svg {
    width: 1rem;
    height: 1rem;
}

.pe-ai-chat__messages {
    display: flex;
    min-height: 11rem;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .75rem;
    overflow-y: auto;
    padding: .95rem;
    overscroll-behavior: contain;
}

.pe-ai-chat__history-status {
    align-self: center;
    border: 1px solid rgba(245, 158, 11, .24);
    border-radius: 999px;
    background: rgba(245, 158, 11, .1);
    padding: .28rem .65rem;
    color: #fbbf24;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.25;
}

html:not(.dark) .pe-ai-chat__history-status {
    background: #fff7ed;
    color: #9a3412;
}

.pe-ai-chat__empty {
    display: grid;
    gap: .35rem;
    margin: auto;
    color: #cbd5e1;
    text-align: center;
    line-height: 1.55;
}

.pe-ai-chat__empty strong {
    color: #f8fafc;
    font-size: .92rem;
}

.pe-ai-chat__empty span {
    font-size: .84rem;
}

html:not(.dark) .pe-ai-chat__empty {
    color: #64748b;
}

html:not(.dark) .pe-ai-chat__empty strong {
    color: #0f172a;
}

.pe-ai-chat__message {
    display: grid;
    max-width: 92%;
    gap: .32rem;
}

.pe-ai-chat__message--user {
    margin-inline-start: auto;
    justify-items: end;
}

.pe-ai-chat__message--assistant {
    margin-inline-end: auto;
    justify-items: start;
}

.pe-ai-chat__message-meta {
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 800;
}

.pe-ai-chat__bubble {
    display: grid;
    gap: .55rem;
    margin: 0;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: .5rem;
    padding: .62rem .72rem;
    font-size: .86rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pe-ai-chat__text {
    margin: 0;
}

.pe-ai-chat__message--assistant .pe-ai-chat__bubble {
    white-space: normal;
}

.pe-ai-chat__message--assistant .pe-ai-chat__text {
    display: grid;
    gap: .45rem;
}

.pe-ai-chat__text p,
.pe-ai-chat__text ul,
.pe-ai-chat__text ol {
    margin: 0;
}

.pe-ai-chat__text ul,
.pe-ai-chat__text ol {
    display: grid;
    gap: .28rem;
    padding-inline-start: 1.15rem;
}

.pe-ai-chat__text li {
    padding-inline-start: .1rem;
}

.pe-ai-chat__message--user .pe-ai-chat__bubble {
    border-color: rgba(251, 191, 36, .38);
    background: rgba(245, 158, 11, .12);
    color: #fde68a;
    font-weight: 800;
}

html:not(.dark) .pe-ai-chat__message--user .pe-ai-chat__bubble {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.pe-ai-chat__message--assistant .pe-ai-chat__bubble {
    border-color: rgba(96, 165, 250, .36);
    background: rgba(59, 130, 246, .14);
    color: #dbeafe;
}

html:not(.dark) .pe-ai-chat__message--assistant .pe-ai-chat__bubble {
    border-color: rgba(96, 165, 250, .32);
    background: #eff6ff;
    color: #0f172a;
}

.pe-ai-chat__copy {
    display: inline-flex;
    min-height: 1.85rem;
    align-items: center;
    justify-self: end;
    gap: .35rem;
    border: 1px solid rgba(96, 165, 250, .34);
    border-radius: .45rem;
    background: rgba(59, 130, 246, .12);
    padding: .25rem .48rem;
    color: #bfdbfe;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}

.pe-ai-chat__copy:hover {
    background: rgba(59, 130, 246, .2);
    color: #eff6ff;
}

html:not(.dark) .pe-ai-chat__copy {
    background: #eff6ff;
    color: #1d4ed8;
}

html:not(.dark) .pe-ai-chat__copy:hover {
    background: #dbeafe;
    color: #1e40af;
}

.pe-ai-chat__form {
    display: grid;
    gap: .55rem;
    border-top: 1px solid rgba(148, 163, 184, .22);
    padding: .85rem .95rem .95rem;
}

html:not(.dark) .pe-ai-chat__form {
    border-top-color: rgba(226, 232, 240, .95);
}

.pe-ai-chat__input {
    width: 100%;
    min-height: 4.35rem;
    max-height: 8rem;
    resize: vertical;
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: .5rem;
    background: rgba(15, 23, 42, .58);
    padding: .68rem .75rem;
    color: #f8fafc;
    font-size: .88rem;
    line-height: 1.55;
    outline: none;
}

html.dark .pe-ai-chat__input {
    background: #18181b;
}

html:not(.dark) .pe-ai-chat__input {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.pe-ai-chat__input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .16);
}

.pe-ai-chat__input::placeholder {
    color: #94a3b8;
}

.pe-ai-chat__form-meta {
    display: flex;
    min-height: 1.1rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: #94a3b8;
    font-size: .72rem;
    line-height: 1.35;
}

.pe-ai-chat__counter.is-over,
.pe-ai-chat__error {
    color: #f87171;
    font-weight: 800;
}

.pe-ai-chat__send {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 1px solid #c75f00;
    border-radius: .5rem;
    background: #e17100;
    padding: .48rem .8rem;
    color: #111827;
    font-size: .84rem;
    font-weight: 850;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, opacity .16s ease;
}

.pe-ai-chat__send:hover {
    border-color: #f59e0b;
    background: #f59e0b;
}

.pe-ai-chat__send:disabled {
    cursor: not-allowed;
    opacity: .56;
}

.pe-ai-chat__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

html[dir="rtl"] .pe-ai-chat__panel {
    inset-inline-start: 1rem;
    inset-inline-end: auto;
}

@media (max-width: 640px) {
    .pe-topbar-tools {
        gap: .1rem;
        margin-inline-end: .1rem;
    }

    .pe-ai-chat__panel {
        inset-block-start: auto;
        inset-block-end: .65rem;
        inset-inline: .5rem;
        width: auto;
        max-height: min(34rem, calc(100dvh - 1.3rem));
    }

    html[dir="rtl"] .pe-ai-chat__panel {
        inset-inline: .5rem;
    }

    .pe-ai-chat__messages {
        min-height: 12rem;
    }
}
