/* ==========================================================================
   Public Rashid - the floating assistant on the landing page
   --------------------------------------------------------------------------
   The button, panel, conversation, composer and Rashid on stage all come from
   the in-app assistant's stylesheet (includes/css/ai-assistant.css), loaded
   just before this file, so Public Rashid looks and behaves like the Rashid
   inside Ajari. This file only adds what the public version needs:
   - its place beside the page's own WhatsApp button,
   - the suggested questions inside the conversation,
   - the invitation to contact the team (WhatsApp) and the retry button,
   - the page scroll lock while the chat fills a phone screen.
   Logical properties only: Arabic (RTL) and English (LTR) share every rule.
   ========================================================================== */

/* the launcher stands just above the WhatsApp button in the same corner (--ai-fab-lift is
   measured by rashid-public.js), centred on it */
.ajari-ai--public .ai-fab { inset-inline-end: 19px; }
@media (max-width: 575px) { .ajari-ai--public .ai-fab { inset-inline-end: 22px; } }

/* desktop / tablet: a floating panel that leaves the page's navigation visible */
.ajari-ai--public .ai-panel {
    height: min(660px, calc(100vh - 120px));
    height: min(660px, calc(100dvh - 120px));
}
@media (max-width: 767px) and (min-width: 576px) {
    .ajari-ai--public .ai-panel { height: min(640px, calc(100dvh - 32px)); }
}
/* phones: full screen like the in-app chat; rashid-public.js keeps it inside the visual viewport
   so the virtual keyboard never covers the message box */
@media (max-width: 575px) {
    .ajari-ai--public .ai-panel { inset-block-end: auto; }
}
html.ajari-rashid-lock, html.ajari-rashid-lock body { overflow: hidden; }

/* the welcome: Rashid's first message with the suggested questions under it */
.ajari-ai--public .rp-welcome .ai-answer { max-width: 100%; }
.rp-suggest { margin-block-start: 12px; }
.rp-suggest-label {
    margin: 0 0 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ai-muted);
}
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--ai-line-strong);
    border-radius: 999px;
    background: var(--ai-surface);
    color: var(--ai-ink);
    font-size: 13.5px;
    line-height: 1.35;
    text-align: start;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s ease, background .15s ease, transform .15s var(--ai-ease);
}
.rp-chip:hover { border-color: var(--ai-brand); background: var(--ai-tint); }
.rp-chip:active { transform: scale(.97); background: var(--ai-tint-strong); }
.rp-chip:disabled { opacity: .55; cursor: default; transform: none; }
.rp-chip-icon { flex: none; color: var(--ai-brand); }
.rp-chip-icon svg { width: 14px; height: 14px; }
.rp-chip-text { min-width: 0; overflow-wrap: anywhere; unicode-bidi: plaintext; }

/* the invitation to talk to the team, with the official WhatsApp link */
.ajari-ai--public .ai-msg.is-contact .ai-answer-body {
    border-color: color-mix(in srgb, #25d366 40%, var(--ai-say-line));
}
.ajari-ai .rp-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    margin-block-start: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #25d366;
    color: #06351c;
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px -8px rgba(37, 211, 102, .55);
    touch-action: manipulation;
    transition: transform .15s var(--ai-ease), box-shadow .15s ease;
}
.ajari-ai .rp-wa svg { width: 20px; height: 20px; }
.ajari-ai .rp-wa:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(37, 211, 102, .65); color: #06351c; }
.ajari-ai .rp-wa:focus-visible { outline: 3px solid rgba(37, 211, 102, .55); outline-offset: 2px; }
@media (max-width: 575px) { .ajari-ai .rp-wa { width: 100%; } }

/* try again (connection problems only) */
.ajari-ai .rp-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-block-start: 8px;
    padding: 6px 12px;
    border: 1px solid var(--ai-line-strong);
    border-radius: 999px;
    background: var(--ai-surface);
    color: var(--ai-ink);
    font-size: 13px;
    font-weight: 600;
}
.ajari-ai .rp-retry svg { width: 15px; height: 15px; }
.ajari-ai .rp-retry:hover { border-color: var(--ai-brand); }

/* the landing page's typographic resets must not leak into the chat */
.ajari-ai--public .ai-md p, .ajari-ai--public .ai-md li { font-size: inherit; color: inherit; }
.ajari-ai--public .ai-md a.ai-link { color: var(--ai-brand); }

/* nav entry point: a small live dot */
.aj-nav__links .aj-nav__ai { display: inline-flex; align-items: center; gap: 6px; }
.aj-nav__links .aj-nav__ai::before {
    content: '';
    inline-size: 0.45rem;
    block-size: 0.45rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* the landing page styles every h2 / p under body.aj (display face, margins, tracking):
   the chat keeps the in-app assistant's own typography */
.ajari-ai--public .ai-title {
    margin: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
}
.ajari-ai--public .ai-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 1.35; }
.ajari-ai--public .ai-head { align-items: center; }
.ajari-ai--public .rp-suggest-label, .ajari-ai--public .ai-foot { font-family: inherit; letter-spacing: normal; }
