.hf-ai {
    --hf-ink: #211a32;
    --hf-muted: #514a61;
    --hf-purple: #501e94;
    --hf-line: #d2c3eb;
    --hf-tint: #f2ebfb;
    position: fixed;
    z-index: 900;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    color: var(--hf-ink);
    font: .875rem/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.hf-ai[hidden], .hf-ai [hidden] { display: none !important; }
.hf-ai *, .hf-ai *::before, .hf-ai *::after { box-sizing: border-box; }
.hf-ai button, .hf-ai textarea, .hf-ai input, .hf-ai select { font: inherit; }
.hf-ai button {
    cursor: pointer;
    background: #fff;
    color: var(--hf-purple);
    border: 1px solid var(--hf-line);
    border-radius: .65rem;
    padding: .42rem .62rem;
    line-height: 1.15;
}
.hf-ai button:disabled { cursor: default; opacity: .55; }
.hf-ai button:focus-visible, .hf-ai a:focus-visible, .hf-ai :is(input,textarea,select):focus-visible {
    outline: 2px solid var(--hf-purple);
    outline-offset: 2px;
}
.hf-ai a { color: var(--hf-purple); text-decoration: underline; }
.hf-ai svg { display: block; width: 1.15rem; height: 1.15rem; flex: none; }
.hf-ai .hf-ai-primary, .hf-ai .hf-ai-send, .hf-ai .hf-ai-launcher {
    color: #fff;
    background: var(--hf-purple);
    border-color: var(--hf-purple);
    font-weight: 700;
}
.hf-ai .hf-ai-launcher {
    display: grid;
    place-items: center;
    width: 3.6rem;
    height: 3.6rem;
    margin-left: auto;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 .25rem 1.15rem #26104445;
}
.hf-ai-launcher svg { width: 2.1rem; height: 2.1rem; }
.hf-ai-panel {
    display: flex;
    flex-direction: column;
    width: min(22rem, calc(100vw - 2rem));
    height: min(34rem, calc(100dvh - 2rem));
    background: #fff;
    border: 1px solid var(--hf-line);
    border-radius: 1.25rem;
    box-shadow: 0 .65rem 2rem #3023442e;
    overflow: hidden;
    text-align: left;
    color: var(--hf-ink);
}
.hf-ai-panel[data-expanded="true"] { width: min(38rem, calc(100vw - 2rem)); height: min(45rem, calc(100dvh - 2rem)); }
.hf-ai-head {
    background: #efe6fa;
    display: flex;
    align-items: center;
    gap: .62rem;
    padding: .7rem .8rem;
    flex: none;
}
.hf-ai-avatar {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    background: var(--hf-purple);
}
.hf-ai-avatar svg { width: 75%; height: 75%; }
.hf-ai-brand { flex: 1; min-width: 0; }
.hf-ai-brand h2 { margin: 0; font: 800 1.06rem/1.16 Inter, system-ui, sans-serif; letter-spacing: -.025em; color: inherit; }
.hf-ai-brand h2:focus { outline: none; }
.hf-ai-brand > div { margin-top: .15rem; font-size: .73rem; color: #322743; white-space: nowrap; }
.hf-ai-presence::before {
    content: "";
    display: inline-block;
    width: .44rem;
    height: .44rem;
    border-radius: 50%;
    margin: 0 .28rem 0 .37rem;
    vertical-align: .04rem;
    background: #8a789b;
}
.hf-ai-presence[data-available="true"]::before { background: #35aa13; }
.hf-ai-head-actions, .hf-ai-actions, .hf-ai-feedback { display: flex; align-items: center; gap: .35rem; }
.hf-ai-actions, .hf-ai-feedback { flex-wrap: wrap; }
.hf-ai .hf-ai-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2rem;
    min-height: 2rem;
    padding: .32rem;
    border: 0;
    background: transparent;
    color: inherit;
}
.hf-ai .hf-ai-icon:hover, .hf-ai .hf-ai-icon[aria-pressed="true"] { background: var(--hf-tint); color: var(--hf-purple); }
.hf-ai-notice {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #f6f4f8;
    padding: .37rem .85rem;
    color: #494158;
    font-size: .72rem;
    flex: none;
}
.hf-ai-notice svg { width: .98rem; height: .98rem; }
.hf-ai-notice p, .hf-ai-tools p, .hf-ai-compose p, .hf-ai-ticket p { margin: 0; }
.hf-ai-tools:has(> :not([hidden])) { padding: .55rem .75rem; background: #fbf9fd; font-size: .78rem; }
.hf-ai-tools :is([data-history-list], [data-guest-transfer]) > .hf-ai-actions { margin-top: .4rem; }
.hf-ai-public-links { font-size: .75rem; }
.hf-ai-log {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: #c7bdcf transparent;
    scrollbar-width: thin;
    padding: 1.05rem .85rem .65rem;
}
.hf-ai-log article { display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 .7rem; }
.hf-ai-log article[data-role="user"] { justify-content: flex-end; }
.hf-ai-log article > .hf-ai-avatar { width: 1.75rem; height: 1.75rem; margin-top: .12rem; }
.hf-ai-message { min-width: 0; max-width: min(82%, 26rem); }
.hf-ai-log article[data-role="user"] .hf-ai-message { max-width: min(86%, 26rem); }
.hf-ai-bubble {
    width: fit-content;
    padding: .56rem .72rem;
    color: var(--hf-ink);
    background: var(--hf-tint);
    border-radius: .8rem;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.hf-ai-log article[data-role="user"] .hf-ai-bubble { color: #fff; background: #4d20d4; margin-left: auto; }
.hf-ai-log time { display: block; margin-top: .22rem; color: var(--hf-muted); font-size: .67rem; }
.hf-ai-log article[data-role="user"] time { text-align: right; }
.hf-ai-feedback { margin-top: .3rem; color: #5b526a; gap: .26rem; }
.hf-ai-feedback svg { width: 1rem; height: 1rem; }
.hf-ai .hf-ai-ticket-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .36rem .58rem;
    min-height: 1.92rem;
    border-color: #9c77c9;
    color: var(--hf-purple);
    font-size: .73rem;
    font-weight: 700;
}
.hf-ai-ticket-link svg { width: 1rem; height: 1rem; }
.hf-ai-compose, .hf-ai-ticket {
    display: grid;
    gap: .46rem;
    padding: .65rem .75rem .25rem;
    margin: 0;
    color: var(--hf-muted);
    font-size: .78rem;
}
.hf-ai-compose [data-chat-actions]:not(:has(> :not([hidden]))),
.hf-ai-compose [data-starters]:not(:has(> *)),
.hf-ai .hf-ai-status:empty { display: none; }
.hf-ai-compose [data-consent] { display: grid; gap: .26rem; }
.hf-ai-compose [data-account-actions] { justify-self: start; }
.hf-ai-compose [data-account-panel], .hf-ai-compose [data-router-selection],
.hf-ai-compose [data-wifi-selection] { display: grid; gap: .45rem; }
.hf-ai-compose [data-quote-selection] { display: grid; gap: .45rem; }
.hf-ai-compose [data-quote-preview] { white-space: pre-wrap; overflow-wrap: anywhere; }
.hf-ai-compose [data-account-panel] {
    max-height: min(15rem, 38dvh);
    overflow: auto;
    padding: .55rem;
    border: 1px solid var(--hf-line);
    border-radius: .65rem;
}
.hf-ai-compose [data-starters] { gap: .25rem; }
.hf-ai-compose [data-starters] button { font-size: .69rem; padding: .3rem .44rem; }
.hf-ai-input {
    display: flex;
    align-items: flex-end;
    gap: .1rem;
    padding: .14rem;
    border: 1px solid #c3a9e3;
    border-radius: .93rem;
    background: #fcfbfd;
}
.hf-ai-input:focus-within { border-color: var(--hf-purple); }
.hf-ai .hf-ai-input textarea {
    flex: 1;
    min-width: 0;
    min-height: 2.1rem;
    max-height: 5.5rem;
    border: 0;
    resize: none;
    padding: .48rem .52rem;
    background: transparent;
    color: var(--hf-ink);
    field-sizing: content;
    font-size: .82rem;
}
.hf-ai-input textarea::placeholder { color: #62576f; }
.hf-ai .hf-ai-input textarea:focus-visible { outline-offset: -2px; }
.hf-ai .hf-ai-send { width: 2.13rem; height: 2.13rem; display: grid; place-items: center; border-radius: 50%; padding: 0; flex: none; }
.hf-ai-send svg { width: 1rem; height: 1rem; }
.hf-ai-footer { padding: .58rem .6rem .73rem; text-align: center; font-size: .68rem; font-weight: 650; color: #40334e; background: #fbf9fe; }
.hf-ai-files { display: grid; gap: .35rem; }
.hf-ai-guide-links { display: grid; gap: .2rem; margin: .35rem 0; padding-inline-start: 1.2rem; font-size: .76rem; }
.hf-ai-upload-progress { width: 100%; height: .5rem; accent-color: var(--hf-purple); }
.hf-ai-file { display: flex; gap: .4rem; align-items: center; overflow-wrap: anywhere; }
.hf-ai-file a { display: flex; gap: .4rem; align-items: center; min-width: 0; }
.hf-ai-file img { width: 2rem; height: 2rem; border-radius: .3rem; object-fit: cover; flex: none; background: white; }
.hf-ai-bubble .hf-ai-file { margin-top: .4rem; }
.hf-ai-log [data-role=user] .hf-ai-file a { color: white; }
.hf-ai label { display: grid; gap: .2rem; font-weight: 600; }
.hf-ai label.hf-ai-check { display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.hf-ai input[type=checkbox] { accent-color: var(--hf-purple); }
.hf-ai :is(.hf-ai-ticket textarea, .hf-ai-ticket input:not([type=checkbox]), select) {
    width: 100%;
    color: var(--hf-ink);
    background: #fff;
    border: 1px solid var(--hf-line);
    border-radius: .45rem;
    padding: .35rem .5rem;
}
.hf-ai-ticket { flex: 1; overflow: auto; align-content: start; padding: .9rem .75rem; }
.hf-ai-panel:has(.hf-ai-wifi:not([hidden])) > :is(.hf-ai-compose, .hf-ai-log, .hf-ai-footer, .hf-ai-tools) { display: none; }
.hf-ai-ticket [data-ticket-fields] { display: grid; gap: .55rem; }
.hf-ai-ticket [data-guest-contact], .hf-ai-ticket [data-ticket-replies] { display: grid; gap: .55rem; }
.hf-ai-ticket [data-ticket-replies] { white-space: pre-wrap; overflow-wrap: anywhere; }
.hf-ai-ticket textarea { resize: vertical; max-height: 9rem; }
.hf-ai-ticket pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0; }
.hf-ai-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 560px) {
    .hf-ai:has(.hf-ai-panel:not([hidden])) { inset: 0; }
    .hf-ai .hf-ai-panel, .hf-ai .hf-ai-panel[data-expanded="true"] {
        width: 100%; height: 100dvh; border-radius: 0; border: 0;
        padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    }
    .hf-ai .hf-ai-expand { display: none; }
    .hf-ai .hf-ai-head-actions .hf-ai-icon { min-width: 2.45rem; min-height: 2.45rem; }
    .hf-ai .hf-ai-input textarea { font-size: 1rem; }
}

/* Markdown replies stay readable within the narrow chat panel. */
.hf-ai-prose { white-space: normal; overflow-wrap: anywhere; }
.hf-ai-prose > :first-child { margin-top: 0; }
.hf-ai-prose > :last-child { margin-bottom: 0; }
.hf-ai-prose p { margin: 0 0 .65em; }
.hf-ai-prose :is(ul,ol) { margin: .45em 0 .65em; padding-left: 1.4em; }
.hf-ai-prose li + li { margin-top: .3em; }
.hf-ai-prose :is(h1,h2,h3,h4,h5,h6) { font-size: 1.05em; line-height: 1.35; margin: .8em 0 .4em; }
.hf-ai-prose :is(code,pre) { font-size: .9em; }
.hf-ai-prose code { padding: .1em .25em; background: #ffffff80; border-radius: .2em; }
.hf-ai-prose pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: .6em; background: #ffffff80; border-radius: .45em; }
.hf-ai-prose pre code { padding: 0; background: none; }
.hf-ai-prose blockquote { margin: .6em 0; padding-left: .7em; border-left: .2em solid #af91d2; }
.hf-ai-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: .6em 0; }
.hf-ai-prose :is(th,td) { padding: .35em .5em; border: 1px solid #b9a4d0; text-align: left; }
