/* ───────────────────────────────────────────────────────────────────
   SamiAI — the Sami theme (the default look), loaded after frontend.css.

   Phone first: the rules outside the media queries are the phone's (and the
   floating window's, which is as narrow); the desktop adds its own from
   521px, the product row from 641px. Every rule hangs from the theme class
   the template puts on #aic-chat-widget, so Boutique and Classic never see
   it. Appearance only: no element is added or removed here.
   ─────────────────────────────────────────────────────────────────── */

#aic-chat-widget.aic-theme-sami {
    --aic-primary:        #6B34D6;
    --aic-primary-dark:   #5B21B6;
    --aic-primary-soft:   #F6F3FA;
    --aic-accent:         #46085E;
    --aic-ink:            #1F1A28;
    --aic-text:           #1F1A28;
    --aic-text-muted:     #5B5668;
    --aic-text-subtle:    #6B6678;
    --aic-border:         #E7E0F1;
    --aic-border-soft:    #EFEAF5;
    --aic-border-strong:  #DCD3EA;
    --aic-chip:           #F6F3FA;
    --aic-chip-hover:     #EDE5F7;
    --aic-header-grad:    linear-gradient(110deg, #EFE6FA, #F8F5FC);
    --aic-field-grad:     linear-gradient(90deg, #A9B8D8, #8B2FD0);
    --aic-avatar:         #1B1720;
    --aic-online:         #16A34A;
    --aic-online-text:    #1E6B3A;
    --aic-thumb:          #F1ECF8;

    max-width: 720px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border: 1px solid var(--aic-border);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(70, 8, 94, 0.08);
}

/* In the page, on a phone, the card takes the screen that is left under
   what comes before it (--aic-page-top, measured by frontend.js): header on
   top, the part that scrolls in the middle, the field always at the bottom. */
@media (max-width: 520px) {
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) {
        height: 560px !important;
        height: clamp(440px, calc(100dvh - var(--aic-page-top, 200px) - 12px), 760px) !important;
        max-height: none !important;
        scroll-margin-top: calc(var(--aic-sticky-top, 0px) + 12px);
    }
    /* Once the conversation has started the card is the whole screen:
       frontend.js brings it to the top of the page at each question, under
       the header the theme keeps fixed there (--aic-sticky-top), if any. */
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget):has(#aic-messages:not(:empty)) {
        height: max(380px, calc(100dvh - var(--aic-sticky-top, 0px) - 24px)) !important;
    }
}

#aic-chat-widget.aic-theme-sami button:focus-visible,
#aic-chat-widget.aic-theme-sami a:focus-visible {
    outline: 2px solid var(--aic-primary);
    outline-offset: 2px;
}

/* ─── Header ────────────────────────────────────────────────────── */
#aic-chat-widget.aic-theme-sami .aic-header {
    padding: 8px 12px 8px 14px;
    gap: 8px;
    flex-wrap: nowrap;
}
#aic-chat-widget.aic-theme-sami .aic-header .aic-title { gap: 10px; min-width: 0; }
#aic-chat-widget.aic-theme-sami .aic-header .aic-title::after { display: none; }
#aic-chat-widget.aic-theme-sami .aic-header .aic-logo { height: 26px; }
#aic-chat-widget.aic-theme-sami .aic-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: var(--aic-online-text);
    white-space: nowrap;
}
#aic-chat-widget.aic-theme-sami .aic-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aic-online);
}
#aic-chat-widget.aic-theme-sami #aic-new-chat-btn {
    flex: none;
    min-height: 44px;
    padding: 0 14px;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--aic-border-strong);
    border-radius: 999px;
    box-shadow: none;
    color: var(--aic-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
#aic-chat-widget.aic-theme-sami #aic-new-chat-btn::before {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231F1A28' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
#aic-chat-widget.aic-theme-sami #aic-new-chat-btn:hover {
    background: var(--aic-chip);
    border-color: var(--aic-border-strong);
    transform: none;
}

/* ─── Suggestions ───────────────────────────────────────────────── */
#aic-chat-widget.aic-theme-sami #aic-suggestions {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 12px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    background: #fff;
}
#aic-chat-widget.aic-theme-sami #aic-suggestions:not(:empty)::before {
    content: attr(data-label);
    grid-column: 1 / -1;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--aic-text-muted);
}
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip {
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    background: var(--aic-chip);
    border: 1px solid var(--aic-border);
    border-radius: 14px;
    box-shadow: none;
    color: var(--aic-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0 !important;
    text-align: left;
}
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip:hover {
    background: var(--aic-chip-hover);
    border-color: var(--aic-border);
    box-shadow: none;
    transform: none;
}
/* The icon in a white circle. One per place, in turn: a sun, a tick, a star,
   two circles, a person. */
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip::before {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin: 0;
    border-radius: 50%;
    background-color: #fff;
    background-size: 16px 16px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B34D6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip:nth-child(5n+2)::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B34D6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.5'/%3E%3C/svg%3E");
}
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip:nth-child(5n+3)::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B34D6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z'/%3E%3C/svg%3E");
}
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip:nth-child(5n+4)::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B34D6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='12' r='5'/%3E%3Ccircle cx='15' cy='12' r='5'/%3E%3C/svg%3E");
}
#aic-chat-widget.aic-theme-sami .aic-suggestion-chip:nth-child(5n+5)::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236B34D6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7'/%3E%3C/svg%3E");
}

/* ─── Messages ──────────────────────────────────────────────────── */
#aic-chat-widget.aic-theme-sami #aic-messages {
    padding: 14px 12px 6px;
    background: #fff;
    border-bottom: 1px solid var(--aic-border-soft);
}
#aic-chat-widget.aic-theme-sami .aic-message { margin: 0 0 14px; }
#aic-chat-widget.aic-theme-sami .aic-user {
    /* A message written on several lines keeps them. */
    white-space: pre-wrap;
    max-width: 85%;
    padding: 10px 14px;
    background: var(--aic-accent);
    border-radius: 18px 18px 4px 18px;
    box-shadow: none;
    font-size: 15px;
    line-height: 1.4;
}
/* On a phone the reply takes the whole width: no avatar beside it. */
#aic-chat-widget.aic-theme-sami .aic-assistant {
    margin-left: 0;
    max-width: none;
    gap: 12px;
    padding: 12px;
    background: var(--aic-chip);
    border: 0;
    border-radius: 18px 18px 18px 4px;
    font-size: 15px;
    line-height: 1.45;
}
#aic-chat-widget.aic-theme-sami .aic-assistant.aic-streaming { gap: 6px; }
#aic-chat-widget.aic-theme-sami .aic-assistant::before { display: none; }
#aic-chat-widget.aic-theme-sami .aic-assistant > p { margin: 0; }
#aic-chat-widget.aic-theme-sami .aic-assistant > p:empty { display: none; }
#aic-chat-widget.aic-theme-sami .aic-message.aic-assistant.aic-product-only,
#aic-chat-widget.aic-theme-sami .aic-assistant:has(> .ai-product-preview:only-child) {
    padding: 0;
    background: transparent;
}

/* ─── Product row ───────────────────────────────────────────────── */
/* The markup is the one of product-line.php, untouched. .ai-product-info
   steps aside (display: contents) so that picture, name, price and actions
   sit on one grid: on a phone the actions go under, the whole width. */
#aic-chat-widget.aic-theme-sami .ai-product-preview {
    margin: 0;
    padding: 10px;
    border: 1px solid var(--aic-border);
    border-radius: 14px;
    background: #fff;
    overflow: visible;
    transition: none;
}
#aic-chat-widget.aic-theme-sami .ai-product-preview:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--aic-border);
}
/* What wpautop leaves inside the card. */
#aic-chat-widget.aic-theme-sami .ai-product-preview br,
#aic-chat-widget.aic-theme-sami .ai-product-preview p:empty { display: none; }
#aic-chat-widget.aic-theme-sami .ai-product-link {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: 1fr auto 1fr auto;
    column-gap: 12px;
    row-gap: 0;
    align-items: center;
}
#aic-chat-widget.aic-theme-sami .ai-product-info { display: contents; }
#aic-chat-widget.aic-theme-sami .aic-product-image {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: center;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: var(--aic-thumb);
}
#aic-chat-widget.aic-theme-sami .ai-product-title {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
}
#aic-chat-widget.aic-theme-sami .ai-product-title a {
    display: inline !important;
    color: var(--aic-primary-dark);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
#aic-chat-widget.aic-theme-sami .ai-product-color {
    grid-column: 2;
    grid-row: 2;
    margin-top: 2px;
}
#aic-chat-widget.aic-theme-sami .ai-product-price {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    color: var(--aic-text);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
}
#aic-chat-widget.aic-theme-sami .ai-product-price del,
#aic-chat-widget.aic-theme-sami .ai-product-price del .amount {
    margin: 0;
    color: var(--aic-text-subtle);
    font-size: 13px;
    font-weight: 400;
}
#aic-chat-widget.aic-theme-sami .ai-product-price ins,
#aic-chat-widget.aic-theme-sami .ai-product-price ins .amount {
    color: var(--aic-text);
    font-size: 16px;
    text-decoration: none;
}
#aic-chat-widget.aic-theme-sami .ai-product-actions {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--aic-border-soft);
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
}
/* The cart on the right, after "View product", whatever the width. */
#aic-chat-widget.aic-theme-sami .aic-product-line .aic-add-to-cart {
    order: 2;
    flex: none;
    width: 44px;
    height: 44px;
    margin: 0 6px 0 0;
    border-radius: 12px;
    background: var(--aic-accent) !important;
}
#aic-chat-widget.aic-theme-sami .aic-product-line .aic-add-to-cart .aic-cart-ico {
    width: 20px;
    height: 20px;
}
#aic-chat-widget.aic-theme-sami .aic-product-line .aic-add-to-cart::after {
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    color: var(--aic-accent);
    font-size: 14px;
    line-height: 18px;
    box-shadow: 0 0 0 1.5px var(--aic-accent);
}
#aic-chat-widget.aic-theme-sami .aic-product-line .aic-add-to-cart.is-done { background: #2e7d32 !important; }
#aic-chat-widget.aic-theme-sami .aic-product-line .aic-add-to-cart.is-error { background: #c0392b !important; }
#aic-chat-widget.aic-theme-sami .ai-cta-button {
    order: 1;
    min-height: 44px;
    margin: 0 auto 0 0;
    padding: 0 6px;
    color: var(--aic-primary-dark);
    font-size: 14px;
    font-weight: 600;
}
#aic-chat-widget.aic-theme-sami .ai-cta-button:hover { color: var(--aic-accent); }

/* ─── Answers to tap, variants ──────────────────────────────────── */
/* The choices Sami offers at the end of a reply: inside the bubble, on as
   many rows as they need. */
#aic-chat-widget.aic-theme-sami .aic-quick-replies {
    margin-top: 0;
    gap: 8px;
}
#aic-chat-widget.aic-theme-sami .aic-quick-reply {
    max-width: 100%;
    min-height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--aic-border-strong);
    border-radius: 999px;
    color: var(--aic-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#aic-chat-widget.aic-theme-sami .aic-quick-reply:hover:not(:disabled) {
    background: #fff;
    border-color: #8B2FD0;
    color: var(--aic-accent);
}
#aic-chat-widget.aic-theme-sami .aic-var-option {
    min-height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--aic-border-strong);
    border-radius: 999px;
    color: var(--aic-text);
    font-size: 14px;
    font-weight: 500;
}
#aic-chat-widget.aic-theme-sami .aic-var-option:hover { background: var(--aic-chip-hover); }
#aic-chat-widget.aic-theme-sami .aic-quick-reply.selected,
#aic-chat-widget.aic-theme-sami .aic-var-option.selected {
    background: var(--aic-accent);
    border-color: var(--aic-accent);
    color: #fff;
}

/* ─── "Added to cart" ───────────────────────────────────────────── */
/* On a phone the text on top and the two links under it, half the width
   each; from 521px text and links on one row, the links under if short of
   room. The cart emoji of the text is drawn as a tick in a green circle. */
#aic-chat-widget.aic-theme-sami .aic-cart-confirm {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    margin-top: 0;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--aic-border);
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm-text {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 400;
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm-text strong { font-weight: 600; }
#aic-chat-widget.aic-theme-sami .aic-cart-confirm-ico {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8F5EC url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231E6B3A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 18px;
    font-size: 0;
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm-what { min-width: 0; }
#aic-chat-widget.aic-theme-sami .aic-cart-confirm-actions {
    display: flex;
    gap: 8px;
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm .ai-cta-button {
    flex: 1 1 0;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm .aic-go-cart {
    background: #fff;
    border: 1px solid var(--aic-border-strong);
    color: var(--aic-primary-dark);
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm .aic-go-cart:hover { background: var(--aic-chip); }
#aic-chat-widget.aic-theme-sami .aic-cart-confirm .aic-go-checkout,
#aic-chat-widget.aic-theme-sami .aic-cart-confirm .aic-go-checkout:hover {
    background: var(--aic-accent);
    border: 1px solid var(--aic-accent);
    color: #fff;
}
#aic-chat-widget.aic-theme-sami .aic-cart-confirm .aic-go-checkout:hover { filter: brightness(1.2); }

/* ─── Field ─────────────────────────────────────────────────────── */
#aic-chat-widget.aic-theme-sami .aic-input-area {
    margin: 10px 12px 0;
    padding: 4px 4px 4px 16px;
    gap: 6px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: linear-gradient(#fff, #fff) padding-box,
                var(--aic-field-grad) border-box;
    box-shadow: none;
}
#aic-chat-widget.aic-theme-sami .aic-input-area::before { display: none; }
#aic-chat-widget.aic-theme-sami .aic-input-area:focus-within {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(107, 52, 214, 0.25);
}
/* 16px: below it iOS zooms the page when the field takes the focus. */
#aic-chat-widget.aic-theme-sami #aic-input {
    min-width: 0;
    height: 44px;
    padding: 0;
    font-size: 16px;
    color: var(--aic-text);
    box-shadow: none;
}
#aic-chat-widget.aic-theme-sami #aic-input::placeholder { color: var(--aic-text-subtle); }
/* The field is a textarea: one line that grows with a long text, up to
   four on a phone (five from 521px), then it scrolls inside. Everything a
   theme gives its textareas is set back here. */
#aic-chat-widget.aic-theme-sami textarea#aic-input {
    display: block;
    flex: 1 1 auto;
    box-sizing: border-box;
    width: auto;
    min-height: 44px;
    max-height: 116px;
    height: 44px;
    margin: 0;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: 0;
    resize: none;
    overflow-x: hidden;
    overflow-y: hidden;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
    color: var(--aic-text);
}
/* Taller than one line: a rounded box instead of a pill, the button low. */
#aic-chat-widget.aic-theme-sami .aic-input-area.aic-multiline {
    align-items: flex-end;
    padding-top: 8px;
    padding-bottom: 8px;
    border-radius: 24px;
}
/* On a phone a round button with the arrow; "Send" stays for who listens. */
#aic-chat-widget.aic-theme-sami #aic-send-btn {
    flex: none;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--aic-accent);
    box-shadow: none;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
#aic-chat-widget.aic-theme-sami #aic-send-btn .aic-send-icon { display: none; }
#aic-chat-widget.aic-theme-sami #aic-send-btn .aic-send-arrow {
    display: block;
    width: 18px;
    height: 18px;
}
#aic-chat-widget.aic-theme-sami #aic-send-btn:hover:not(:disabled) {
    filter: brightness(1.2);
    transform: none;
    box-shadow: none;
}
#aic-chat-widget.aic-theme-sami .aic-input-note {
    margin: 8px 12px 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--aic-text-muted);
}
#aic-chat-widget.aic-theme-sami .aic-footer-actions {
    padding: 0 12px;
    background: transparent;
}
#aic-chat-widget.aic-theme-sami .aic-lead-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* ─── From 521px: the desktop ───────────────────────────────────── */
@media (min-width: 521px) {
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) {
        padding-bottom: 18px;
        border-radius: 24px;
        box-shadow: 0 12px 40px rgba(70, 8, 94, 0.08);
    }
    /* Before the first message the card is as tall as what it holds: no
       white space under the suggestions. */
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget):has(#aic-messages:empty) {
        height: auto !important;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-messages:empty {
        display: none;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget):has(#aic-messages:empty) #aic-suggestions {
        border-bottom: 1px solid var(--aic-border-soft);
    }

    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-header {
        padding: 14px 20px;
        gap: 12px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-header .aic-title { gap: 12px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-header .aic-logo { height: 30px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-status {
        gap: 6px;
        font-size: 13px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-status::before {
        width: 9px;
        height: 9px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-new-chat-btn {
        padding: 0 18px;
        gap: 8px;
        font-size: 13px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-new-chat-btn::before {
        width: 16px;
        height: 16px;
    }

    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-suggestions {
        padding: 24px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-suggestions:not(:empty)::before {
        margin-bottom: 0;
        font-size: 14px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-suggestion-chip {
        min-height: 64px;
        padding: 12px 16px;
        line-height: 1.35;
    }
    /* An odd one left alone at the end takes the whole row. */
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-suggestion-chip:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-suggestion-chip::before {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        background-size: 18px 18px;
    }

    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-messages { padding: 24px 24px 4px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-message { margin-bottom: 20px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-user {
        max-width: 80%;
        padding: 12px 16px;
        line-height: 1.45;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-assistant {
        margin-left: 42px;
        gap: 14px;
        padding: 16px;
        line-height: 1.5;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-assistant.aic-streaming { gap: 6px; }
    /* Sami's avatar beside the reply: the star on the dark circle. */
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-assistant::before {
        display: block;
        left: -42px;
        top: 0;
        width: 32px;
        height: 32px;
        background: var(--aic-avatar) url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M12 2l2.2 6.8L21 11l-6.8 2.2L12 20l-2.2-6.8L3 11l6.8-2.2z'/%3E%3C/svg%3E") no-repeat center / 16px;
        box-shadow: none;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-assistant + .aic-assistant::before,
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-assistant:has(> .ai-product-preview:only-child)::before {
        display: none;
    }

    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-quick-reply { padding: 0 18px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-cart-confirm {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 16px;
        padding: 12px 14px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-cart-confirm-text { flex: 1 1 240px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-cart-confirm-actions {
        flex: none;
        flex-wrap: wrap;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-cart-confirm .ai-cta-button {
        flex: none;
        padding: 0 16px;
    }

    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-input-area {
        margin: 20px 24px 0;
        padding: 6px 6px 6px 22px;
        gap: 8px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-input { height: 48px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) textarea#aic-input {
        min-height: 48px;
        max-height: 144px;
        padding: 12px 0;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-send-btn {
        width: auto;
        height: 48px;
        padding: 0 24px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-send-btn .aic-send-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        display: inline;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) #aic-send-btn .aic-send-arrow {
        width: 16px;
        height: 16px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-input-note {
        margin: 12px 24px 0;
        font-size: 13px;
        line-height: 1.4;
    }
}

/* ─── From 641px: the product row on one line ───────────────────── */
@media (min-width: 641px) {
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-preview {
        padding: 12px;
        border-radius: 16px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-link {
        grid-template-columns: 88px minmax(0, 1fr) auto;
        grid-template-rows: 1fr auto 1fr;
        column-gap: 16px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-product-image {
        width: 88px;
        height: 88px;
        border-radius: 12px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-title { font-size: 16px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-price,
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-price ins,
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-price ins .amount { font-size: 17px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-price { margin-top: 6px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-price del,
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-price del .amount { font-size: 14px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-product-actions {
        grid-column: 3;
        grid-row: 1 / span 3;
        align-self: center;
        margin: 0;
        padding: 0;
        border-top: 0;
        gap: 4px;
    }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .aic-product-line .aic-add-to-cart { margin: 0 6px 0 8px; }
    #aic-chat-widget.aic-theme-sami:not(#aic-floating-widget #aic-chat-widget) .ai-cta-button { padding: 0 8px; }
}

/* ═══════════════════════════════════════════════════════════════════
   The floating chat. Launcher and panel live outside #aic-chat-widget:
   floating-button.php puts the theme class on each of them.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Launcher: a square with the star and one word ─────────────── */
/* 56px on every screen: the design's 64 read as too big on the shop. */
/* The colour is the accent; a shop's own (Settings → Widget → Floating
   button color) is printed after this and wins. --aic-corner-offset is
   what frontend.js adds to stand above another button in the corner. */
#aic-floating-btn.aic-theme-sami {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--aic-bar-offset, 0px) + var(--aic-corner-offset, 0px));
    width: 56px;
    height: 56px;
    flex-direction: column;
    gap: 3px;
    padding: 0;
    background: #46085E;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(70, 8, 94, 0.35);
    color: #fff;
    font-family: var(--aic-font);
    overflow: visible;
    transition: transform 0.15s ease;
}
#aic-floating-btn.aic-theme-sami:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(70, 8, 94, 0.35);
}
#aic-floating-btn.aic-theme-sami:focus-visible {
    outline: 2px solid #6B34D6;
    outline-offset: 3px;
    box-shadow: 0 8px 24px rgba(70, 8, 94, 0.35);
}
#aic-floating-btn.aic-theme-sami .aic-icon.aic-icon-chat,
#aic-floating-btn.aic-theme-sami .aic-icon.aic-icon-chevron { display: none; }
#aic-floating-btn.aic-theme-sami .aic-icon.aic-icon-star {
    display: block;
    width: 22px;
    height: 22px;
}
#aic-floating-btn.aic-theme-sami .aic-launcher-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
#aic-floating-btn.aic-theme-sami .aic-launcher-dot {
    display: block;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #16A34A;
}
/* One soft ring, once per visit (frontend.js adds .aic-attention); the
   steady pulse of the other themes is not this theme's. */
#aic-floating-btn.aic-theme-sami::after,
#aic-floating-btn.aic-theme-sami.aic-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: auto;
    border-radius: 14px;
    background: none;
    box-shadow: 0 0 0 0 rgba(70, 8, 94, 0.45);
    opacity: 0;
    pointer-events: none;
    animation: none;
}
#aic-floating-btn.aic-theme-sami.aic-attention::after { animation: aicSamiAttention 1.5s ease-out 1; }
@keyframes aicSamiAttention {
    0%   { opacity: 1; box-shadow: 0 0 0 0 rgba(70, 8, 94, 0.45); }
    100% { opacity: 0; box-shadow: 0 0 0 18px rgba(70, 8, 94, 0); }
}
@media (prefers-reduced-motion: reduce) {
    #aic-floating-btn.aic-theme-sami { transition: none; }
    #aic-floating-btn.aic-theme-sami:hover { transform: none; }
    #aic-floating-btn.aic-theme-sami.aic-attention::after { animation: none; }
    #aic-floating-widget.aic-theme-sami.aic-open { animation: none; }
}
/* The panel takes the launcher's place: one way in, one way out. */
body.aic-widget-open #aic-floating-btn.aic-theme-sami { display: none; }
@media (max-width: 768px) {
    #aic-floating-btn.aic-theme-sami.aic-mobile-left {
        right: auto;
        left: 16px;
    }
}

/* ─── Panel: on a phone the whole screen, like a page ───────────── */
#aic-floating-widget.aic-theme-sami {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}
@media (max-width: 520px) {
    /* The page under it does not scroll while it is open. */
    body.aic-widget-open:has(#aic-floating-widget.aic-theme-sami) { overflow: hidden; }
}
#aic-floating-widget.aic-theme-sami #aic-chat-widget {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
#aic-floating-widget.aic-theme-sami #aic-messages,
#aic-floating-widget.aic-theme-sami #aic-suggestions { overscroll-behavior: contain; }

/* Header: avatar, name and status on the left; "New chat" and the X. */
#aic-floating-widget.aic-theme-sami .aic-header { padding: 8px 56px 8px 16px; }
#aic-floating-widget.aic-theme-sami .aic-header .aic-title {
    display: grid;
    grid-template-columns: 36px auto;
    column-gap: 10px;
    row-gap: 1px;
    align-items: center;
}
#aic-floating-widget.aic-theme-sami .aic-header .aic-title::before {
    content: "";
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1B1720 url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M12 2l2.2 6.8L21 11l-6.8 2.2L12 20l-2.2-6.8L3 11l6.8-2.2z'/%3E%3C/svg%3E") no-repeat center / 18px;
}
#aic-floating-widget.aic-theme-sami .aic-header .aic-logo,
#aic-floating-widget.aic-theme-sami .aic-header .aic-tagline { display: none; }
#aic-floating-widget.aic-theme-sami .aic-header .aic-name {
    display: block;
    grid-column: 2;
    align-self: end;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: #1F1A28;
}
#aic-floating-widget.aic-theme-sami .aic-header .aic-status {
    grid-column: 2;
    align-self: start;
}
/* "New chat" in the panel: small and white, so that it does not weigh as
   much as the name beside it. Its area to tap stays 44px tall. */
#aic-floating-widget.aic-theme-sami #aic-new-chat-btn {
    position: relative;
    min-height: 32px;
    padding: 0 12px;
    gap: 5px;
    background: #fff;
    font-size: 11px;
}
#aic-floating-widget.aic-theme-sami #aic-new-chat-btn::before {
    width: 12px;
    height: 12px;
}
#aic-floating-widget.aic-theme-sami #aic-new-chat-btn::after {
    content: "";
    position: absolute;
    inset: -6px 0;
}
#aic-floating-widget.aic-theme-sami #aic-new-chat-btn:hover { background: var(--aic-chip, #F6F3FA); }
#aic-floating-widget.aic-theme-sami > #aic-floating-close {
    display: block !important;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231F1A28' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 20px;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
}
#aic-floating-widget.aic-theme-sami > #aic-floating-close:hover { background-color: #fff; }
#aic-floating-widget.aic-theme-sami > #aic-floating-close:focus-visible {
    outline: 2px solid #6B34D6;
    outline-offset: 2px;
}

/* Sami's first words, until the conversation starts. */
#aic-floating-widget.aic-theme-sami .aic-welcome {
    flex: none;
    margin: 16px 12px 0;
    padding: 12px 14px;
    background: #F6F3FA;
    border-radius: 18px 18px 18px 4px;
    color: #1F1A28;
    font-size: 15px;
    line-height: 1.5;
}
#aic-floating-widget.aic-theme-sami #aic-chat-widget:has(#aic-messages:empty) .aic-welcome { display: block; }

/* ─── Panel from 521px: a window in the corner ──────────────────── */
@media (min-width: 521px) {
    #aic-floating-btn.aic-theme-sami {
        right: 24px;
        bottom: calc(24px + var(--aic-bar-offset, 0px) + var(--aic-corner-offset, 0px));
    }

    /* Above the same things the launcher stands above, so that a button
       the site keeps in the corner is neither half covered nor lost. */
    #aic-floating-widget.aic-theme-sami {
        top: auto;
        right: 24px;
        bottom: calc(24px + var(--aic-bar-offset, 0px) + var(--aic-corner-offset, 0px));
        left: auto;
        box-sizing: border-box;
        width: 400px;
        max-width: calc(100vw - 48px);
        height: min(640px, calc(100vh - 48px - var(--aic-bar-offset, 0px) - var(--aic-corner-offset, 0px)));
        height: min(640px, calc(100dvh - 48px - var(--aic-bar-offset, 0px) - var(--aic-corner-offset, 0px)));
        border: 1px solid #E7E0F1;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(27, 23, 32, 0.22);
    }
    #aic-floating-widget.aic-theme-sami .aic-header { padding: 10px 56px 10px 16px; }
    #aic-floating-widget.aic-theme-sami > #aic-floating-close { top: 10px; }
    #aic-floating-widget.aic-theme-sami .aic-welcome { margin: 16px 16px 0; }
    #aic-floating-widget.aic-theme-sami #aic-suggestions { padding: 14px 16px; }
    #aic-floating-widget.aic-theme-sami .aic-suggestion-chip {
        min-height: 48px;
        font-size: 14px;
    }
    #aic-floating-widget.aic-theme-sami .aic-suggestion-chip::before {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
        background-size: 15px 15px;
    }
    #aic-floating-widget.aic-theme-sami #aic-messages { padding: 16px 16px 6px; }
    #aic-floating-widget.aic-theme-sami .aic-input-area { margin: 12px 16px 0; }
    #aic-floating-widget.aic-theme-sami .aic-input-note { margin: 8px 16px 0; }
}
