.oj-ai-chat {
    --oj-ai-surface: #ffffff;
    --oj-ai-text: #171717;
    --oj-ai-muted: #6b7280;
    --oj-ai-line: #e7e7e9;
    --oj-ai-assistant: #f2f3f5;
    --oj-ai-focus: #2563eb;
    position: fixed;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 999999;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: var(--oj-ai-text);
    -webkit-font-smoothing: antialiased;
}

.oj-ai-chat,
.oj-ai-chat * {
    box-sizing: border-box;
}

.oj-ai-chat button,
.oj-ai-chat textarea,
.oj-ai-chat input {
    font: inherit;
}

.oj-ai-chat button {
    -webkit-tap-highlight-color: transparent;
}

.oj-ai-chat__toggle {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 50%;
    background: var(--oj-ai-launcher-icon-bg, var(--oj-ai-header-bg, #111111));
    color: var(--oj-ai-header-text, #ffffff);
    box-shadow: 0 14px 34px rgb(0 0 0 / 22%);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.oj-ai-chat__toggle svg {
    display: block;
    width: 34px;
    height: 34px;
}

.oj-ai-chat__toggle img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.oj-ai-chat__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgb(0 0 0 / 26%);
}

.oj-ai-chat__panel {
    position: absolute;
    right: 0;
    bottom: 82px;
    display: flex;
    flex-direction: column;
    width: min(440px, calc(100vw - 28px));
    height: min(720px, calc(100dvh - 122px));
    min-height: 470px;
    overflow: hidden;
    border: 1px solid rgb(20 20 20 / 9%);
    border-radius: 28px;
    background: var(--oj-ai-surface);
    box-shadow: 0 26px 80px rgb(0 0 0 / 20%), 0 3px 10px rgb(0 0 0 / 8%);
    isolation: isolate;
}

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

.oj-ai-chat__header {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 94px;
    padding: 20px 20px 19px;
    border-bottom: 1px solid var(--oj-ai-line);
    background: var(--oj-ai-surface);
    color: var(--oj-ai-text);
}

.oj-ai-chat__header::before {
    position: absolute;
    inset: 0 24px auto;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: var(--oj-ai-header-bg, #111111);
    content: "";
}

.oj-ai-chat__brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.oj-ai-chat__brand-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: var(--oj-ai-header-text, #ffffff);
}

.oj-ai-chat__brand-mark {
    width: 46px;
    height: 46px;
    background: var(--oj-ai-assistant-icon-bg, var(--oj-ai-header-bg, #111111));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%);
}

.oj-ai-chat__brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oj-ai-chat__brand-mark svg {
    width: 27px;
    height: 27px;
}

.oj-ai-chat__heading {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.oj-ai-chat__heading strong,
.oj-ai-chat__heading small {
    overflow-wrap: anywhere;
}

.oj-ai-chat__heading strong {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.oj-ai-chat__heading small {
    color: var(--oj-ai-muted);
    font-size: 12px;
    line-height: 1.35;
}

.oj-ai-chat__header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.oj-ai-chat__icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #4b4b4f;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.oj-ai-chat__icon-button svg {
    display: block;
    width: 21px;
    height: 21px;
}

.oj-ai-chat__icon-button:hover {
    border-color: var(--oj-ai-line);
    background: #f5f5f6;
    color: var(--oj-ai-text);
}

.oj-ai-chat__header-action--handoff {
    background: var(--oj-ai-handoff-bg, #ffffff);
    color: var(--oj-ai-handoff-text, #111111);
}

.oj-ai-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 22px 20px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c9c9cd transparent;
    background: var(--oj-ai-surface);
}

.oj-ai-chat__message {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    margin: 0 0 16px;
}

.oj-ai-chat__message--user {
    justify-content: flex-end;
}

.oj-ai-chat__message-content {
    min-width: 0;
    max-width: 100%;
}

.oj-ai-chat__avatar {
    display: none;
}

.oj-ai-chat__bubble {
    width: fit-content;
    max-width: 100%;
    padding: 12px 15px;
    border-radius: 18px 18px 18px 6px;
    background: var(--oj-ai-assistant);
    color: var(--oj-ai-text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.oj-ai-chat__message--user .oj-ai-chat__bubble {
    max-width: 86%;
    border-radius: 18px 18px 6px 18px;
    background: var(--oj-ai-header-bg, #111111);
    color: var(--oj-ai-header-text, #ffffff);
}

.oj-ai-chat__text-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.oj-ai-chat__cards {
    display: grid;
    gap: 9px;
    margin: 0 0 16px;
}

.oj-ai-chat__card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 1px solid var(--oj-ai-line);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    box-shadow: 0 4px 16px rgb(0 0 0 / 5%);
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease;
}

.oj-ai-chat__card:hover {
    border-color: #c9c9cd;
    transform: translateY(-1px);
}

.oj-ai-chat__card img {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.oj-ai-chat__card span {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.oj-ai-chat__card strong {
    overflow-wrap: anywhere;
}

.oj-ai-chat__card small {
    color: #55565a;
}

.oj-ai-chat__card em {
    color: #277330;
    font-size: 11px;
    font-style: normal;
}

.oj-ai-chat__starters {
    flex: 0 0 auto;
    padding: 4px 18px 12px;
    background: var(--oj-ai-surface);
}

.oj-ai-chat__starters:empty {
    display: none;
}

.oj-ai-chat__followups {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 16px;
}

.oj-ai-chat__starter-questions {
    margin: 0;
}

.oj-ai-chat__followup {
    max-width: 100%;
    padding: 9px 13px;
    border: 1px solid #dedee2;
    border-radius: 999px;
    background: #fff;
    color: #38383c;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 7px rgb(0 0 0 / 4%);
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.oj-ai-chat__followup:hover {
    border-color: var(--oj-ai-header-bg, #111111);
    background: #f7f7f8;
    color: var(--oj-ai-text);
}

.oj-ai-chat__form {
    flex: 0 0 auto;
    padding: 0 16px 8px;
    background: var(--oj-ai-surface);
}

.oj-ai-chat__input-shell {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 46px;
    align-items: end;
    gap: 6px;
    min-height: 68px;
    padding: 10px 10px 10px 12px;
    border: 1px solid #d8d8dc;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 18px rgb(0 0 0 / 6%);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.oj-ai-chat__input-shell:focus-within {
    border-color: #98989f;
    box-shadow: 0 0 0 3px rgb(37 99 235 / 13%), 0 5px 20px rgb(0 0 0 / 7%);
}

.oj-ai-chat__input-icon {
    align-self: center;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: #85858b;
}

.oj-ai-chat__input-icon svg {
    width: 20px;
    height: 20px;
}

.oj-ai-chat__input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    max-height: 128px;
    margin: 0;
    padding: 12px 4px 10px;
    overflow-y: auto;
    resize: none;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: var(--oj-ai-text);
    line-height: 1.4;
}

.oj-ai-chat__input::placeholder {
    color: #89898f;
    opacity: 1;
}

.oj-ai-chat__send {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--oj-ai-header-bg, #111111);
    color: var(--oj-ai-header-text, #ffffff);
    cursor: pointer;
    transition: transform .16s ease, opacity .16s ease;
}

.oj-ai-chat__send:hover {
    transform: scale(1.04);
}

.oj-ai-chat__send svg {
    width: 21px;
    height: 21px;
}

.oj-ai-chat__send--stop svg {
    display: none;
}

.oj-ai-chat__send--stop::after {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: currentColor;
    content: "";
}

.oj-ai-chat__send:disabled {
    cursor: wait;
    opacity: .5;
}

.oj-ai-chat__privacy {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 18px 12px;
    background: var(--oj-ai-surface);
    color: #77777d;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
}

.oj-ai-chat__privacy svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
}

.oj-ai-chat__privacy a {
    margin-left: 3px;
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.oj-ai-chat__privacy button {
    margin: 0 0 0 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.oj-ai-chat__feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0 3px;
    color: #6c6c72;
    font-size: 11px;
}

.oj-ai-chat__feedback button {
    display: grid;
    place-items: center;
    width: 29px;
    height: 27px;
    padding: 0;
    border: 1px solid #dddddf;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
}

.oj-ai-chat__feedback button:hover {
    border-color: #9b9ba0;
    background: #f5f5f6;
}

.oj-ai-chat__utility {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--oj-ai-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 5%);
}

.oj-ai-chat__utility form {
    display: grid;
    gap: 9px;
}

.oj-ai-chat__utility strong {
    font-size: 14px;
}

.oj-ai-chat__utility input,
.oj-ai-chat__utility textarea {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid #d7d7da;
    border-radius: 10px;
    background: #fff;
    color: var(--oj-ai-text);
    font-size: 13px;
}

.oj-ai-chat__utility textarea {
    min-height: 70px;
    resize: vertical;
}

.oj-ai-chat__utility button {
    justify-self: start;
    padding: 9px 13px;
    border: 0;
    border-radius: 10px;
    background: var(--oj-ai-header-bg, #111111);
    color: var(--oj-ai-header-text, #ffffff);
    font-size: 12px;
    cursor: pointer;
}

.oj-ai-chat__utility button:disabled {
    cursor: wait;
    opacity: .55;
}

.oj-ai-chat__utility-status {
    min-height: 16px;
    margin-top: 7px;
    color: #6c6c72;
    font-size: 11px;
}

.oj-ai-chat__consent {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #55565a;
    font-size: 11px;
    line-height: 1.35;
}

.oj-ai-chat__consent input {
    flex: 0 0 auto;
    width: auto;
    margin: 2px 0 0;
}

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

.oj-ai-chat :is(button, a, input, textarea, select, [contenteditable="true"]):focus-visible {
    outline: 3px solid var(--oj-ai-focus);
    outline-offset: 2px;
}

.oj-ai-chat__panel:focus-visible {
    outline: 3px solid var(--oj-ai-focus);
    outline-offset: -4px;
}

.oj-ai-chat__input:focus-visible {
    outline: 0;
}

@media (max-width: 560px) {
    .oj-ai-chat {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .oj-ai-chat__toggle {
        width: 58px;
        height: 58px;
    }

    .oj-ai-chat__toggle svg {
        width: 31px;
        height: 31px;
    }

    .oj-ai-chat__panel {
        position: fixed;
        inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
        border-radius: 22px;
    }

    .oj-ai-chat__header {
        min-height: 82px;
        padding: 16px 14px 15px;
    }

    .oj-ai-chat__brand {
        gap: 10px;
    }

    .oj-ai-chat__brand-mark {
        width: 42px;
        height: 42px;
    }

    .oj-ai-chat__heading strong {
        font-size: 15px;
    }

    .oj-ai-chat__heading small {
        max-width: 160px;
        font-size: 11px;
    }

    .oj-ai-chat__header-actions {
        gap: 2px;
    }

    .oj-ai-chat__icon-button {
        width: 36px;
        height: 36px;
    }

    .oj-ai-chat__messages {
        padding: 18px 14px 9px;
    }

    .oj-ai-chat__message {
        gap: 7px;
        margin-bottom: 14px;
    }

    .oj-ai-chat__bubble {
        padding: 11px 13px;
    }

    .oj-ai-chat__starters {
        padding: 3px 14px 10px;
    }

    .oj-ai-chat__followup {
        padding: 8px 11px;
        font-size: 11px;
    }

    .oj-ai-chat__form {
        padding: 0 10px 7px;
    }

    .oj-ai-chat__input-shell {
        grid-template-columns: 26px minmax(0, 1fr) 44px;
        min-height: 64px;
        padding: 8px 8px 8px 10px;
        border-radius: 18px;
    }

    .oj-ai-chat__send {
        width: 44px;
        height: 44px;
    }

    .oj-ai-chat__privacy {
        padding-bottom: 10px;
    }
}

@media (max-width: 360px) {
    .oj-ai-chat__heading small {
        display: none;
    }

    .oj-ai-chat__header {
        min-height: 72px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .oj-ai-chat *,
    .oj-ai-chat *::before,
    .oj-ai-chat *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (forced-colors: active) {
    .oj-ai-chat__panel,
    .oj-ai-chat__input-shell,
    .oj-ai-chat__bubble,
    .oj-ai-chat__card,
    .oj-ai-chat__followup {
        border: 1px solid CanvasText;
    }
}

/* Optional commerce, source and navigation controls. */
.oj-ai-chat__card {
    display: block;
    padding: 0;
    overflow: hidden;
}

.oj-ai-chat__card-main {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
}

.oj-ai-chat__card-main img {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.oj-ai-chat__card-main > span {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.oj-ai-chat__card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 10px 10px 81px;
}

.oj-ai-chat__card-action {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid #d3d3d7;
    border-radius: 999px;
    background: #fff;
    color: #303034;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.oj-ai-chat__card-action:hover,
.oj-ai-chat__card-action[aria-pressed="true"] {
    border-color: var(--oj-ai-header-bg, #111111);
    background: #f3f3f5;
}

.oj-ai-chat__card-action--primary {
    border-color: var(--oj-ai-header-bg, #111111);
    background: var(--oj-ai-header-bg, #111111);
    color: var(--oj-ai-header-text, #ffffff);
}

.oj-ai-chat__card-action--primary:hover {
    background: var(--oj-ai-header-bg, #111111);
    color: var(--oj-ai-header-text, #ffffff);
    opacity: .86;
}

.oj-ai-chat__sources {
    margin: -4px 0 16px;
    padding: 10px 12px;
    border-left: 3px solid var(--oj-ai-header-bg, #111111);
    border-radius: 0 10px 10px 0;
    background: #f8f8f9;
    color: #5f6065;
    font-size: 11px;
}

.oj-ai-chat__sources > strong {
    display: block;
    margin-bottom: 4px;
    color: var(--oj-ai-text);
}

.oj-ai-chat__sources ul {
    margin: 0;
    padding-left: 18px;
}

.oj-ai-chat__sources a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.oj-ai-chat__latest {
    align-self: center;
    flex: 0 0 auto;
    margin: -4px 0 7px;
    padding: 6px 11px;
    border: 1px solid #d8d8dc;
    border-radius: 999px;
    background: #fff;
    color: #4b4b50;
    box-shadow: 0 3px 12px rgb(0 0 0 / 8%);
    font-size: 11px;
    cursor: pointer;
}

.oj-ai-chat__compare-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-top: 1px solid var(--oj-ai-line);
    background: #f7f7f8;
    color: #55565a;
    font-size: 11px;
}

.oj-ai-chat__compare-bar[hidden] {
    display: none;
}

.oj-ai-chat__compare-bar span {
    flex: 1;
}

.oj-ai-chat__compare-bar button {
    padding: 6px 9px;
    border: 1px solid #d1d1d5;
    border-radius: 999px;
    background: #fff;
    color: var(--oj-ai-text);
    font-size: 10px;
    cursor: pointer;
}

.oj-ai-chat__compare-bar [data-oj-ai-compare-submit] {
    border-color: var(--oj-ai-header-bg, #111111);
    background: var(--oj-ai-header-bg, #111111);
    color: var(--oj-ai-header-text, #fff);
}

.oj-ai-chat__compare-bar button:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.oj-ai-chat__comparison {
    margin: 0 0 17px;
    padding: 12px;
    border: 1px solid var(--oj-ai-line);
    border-radius: 15px;
    background: #fff;
}

.oj-ai-chat__comparison h3 {
    margin: 0 0 9px;
    font-size: 13px;
}

.oj-ai-chat__comparison-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.oj-ai-chat__comparison table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    line-height: 1.35;
}

.oj-ai-chat__comparison th,
.oj-ai-chat__comparison td {
    min-width: 105px;
    padding: 7px;
    border: 1px solid #e3e3e6;
    text-align: left;
    vertical-align: top;
}

.oj-ai-chat__comparison tr > :first-child {
    min-width: 92px;
    background: #f7f7f8;
}

.oj-ai-chat__comparison a {
    color: inherit;
    font-weight: 700;
}

@media (max-width: 560px) {
    .oj-ai-chat__card-actions {
        padding-left: 10px;
    }

    .oj-ai-chat__compare-bar {
        flex-wrap: wrap;
        padding: 7px 10px;
    }

    .oj-ai-chat__compare-bar span {
        flex-basis: 100%;
    }
}

@media (forced-colors: active) {
    .oj-ai-chat__sources,
    .oj-ai-chat__comparison,
    .oj-ai-chat__card-action,
    .oj-ai-chat__latest,
    .oj-ai-chat__compare-bar {
        border: 1px solid CanvasText;
    }
}
