/* Šape AI storefront widget.
   WoodMart base.css styles every button via :is(.btn,.button,button,[type=button]).
   Beat that with .sape-ai-root + element selectors (0,1,1 vs 0,1,0). */

.sape-ai-root {
    --sape-ai-pink: #df2d77;
    --sape-ai-pink-2: #4C2947;
    --sape-ai-pink-dark: var(--sape-ai-pink-2);
    --sape-ai-gradient: linear-gradient(135deg, var(--sape-ai-pink), var(--sape-ai-pink-2), var(--sape-ai-pink), var(--sape-ai-pink-2), var(--sape-ai-pink));
    --sape-ai-atc-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round' d='M6 6h15l-1.4 8.2a2 2 0 0 1-2 1.6H9.2a2 2 0 0 1-2-1.6L6 6Z'/%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' d='M6 6 5 3H2'/%3E%3Ccircle cx='10' cy='20' r='1.5' fill='%23000'/%3E%3Ccircle cx='17' cy='20' r='1.5' fill='%23000'/%3E%3C/svg%3E");
    --sape-ai-text: #24202a;
    --sape-ai-muted: #716a77;
    --sape-ai-bg: #fff;
    --sape-ai-surface: #f6f7fb;
    --sape-ai-z: 10000;
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    top: auto !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    z-index: var(--sape-ai-z);
    pointer-events: none;
    font-family: inherit;
    color: var(--sape-ai-text);
}

.sape-ai-root .sape-ai-bubble,
.sape-ai-root .sape-ai-panel {
    pointer-events: auto;
}

.sape-ai-root button,
.sape-ai-root [type="button"],
.sape-ai-root [type="submit"] {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-style: normal;
    font-family: inherit;
    letter-spacing: normal;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    text-decoration: none;
    text-shadow: none;
    min-height: 0;
    min-width: 0;
    height: auto;
    width: auto;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.sape-ai-root button:hover:not(.sape-ai-send):not(.sape-ai-chip):not(.sape-ai-atc):not(.sape-ai-account-dismiss),
.sape-ai-root button:focus:not(.sape-ai-send):not(.sape-ai-chip):not(.sape-ai-atc):not(.sape-ai-account-dismiss),
.sape-ai-root button:active:not(.sape-ai-send):not(.sape-ai-chip):not(.sape-ai-atc):not(.sape-ai-account-dismiss),
.sape-ai-root [type="button"]:hover:not(.sape-ai-send):not(.sape-ai-chip):not(.sape-ai-atc):not(.sape-ai-account-dismiss),
.sape-ai-root [type="submit"]:hover:not(.sape-ai-send):not(.sape-ai-chip):not(.sape-ai-atc):not(.sape-ai-account-dismiss) {
    background: transparent;
    color: inherit;
    border-color: transparent;
    box-shadow: none;
}

.sape-ai-root .sape-ai-bubble {
    position: absolute !important;
    right: 20px !important;
    bottom: 20px !important;
    left: auto !important;
    top: auto !important;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible !important;
    text-transform: none;
    transform-origin: 100% 100%;
    transition: opacity 240ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1), visibility 240ms ease;
}

.sape-ai-root.is-open .sape-ai-bubble {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.45) translate3d(10px, 14px, 0);
}

.sape-ai-root .sape-ai-bubble-avatar {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(223, 45, 119, 0.35);
    border: 2px solid #fff;
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 280ms ease;
}

.sape-ai-root .sape-ai-bubble:hover .sape-ai-bubble-avatar,
.sape-ai-root .sape-ai-bubble:focus .sape-ai-bubble-avatar {
    transform: scale(1.06);
    box-shadow: 0 12px 28px rgba(223, 45, 119, 0.42);
}

.sape-ai-root .sape-ai-bubble-prompt {
    position: absolute;
    right: calc(100% + 12px);
    bottom: 4px;
    left: auto;
    top: auto;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(10px, 8px, 0) scale(0.86);
    transform-origin: 100% 80%;
    pointer-events: none;
    background: #fff;
    color: var(--sape-ai-text);
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 10px 28px rgba(36, 32, 42, 0.14);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    white-space: normal;
    width: max-content;
    max-width: min(240px, calc(100vw - 100px));
}

.sape-ai-root .sape-ai-bubble-prompt::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 14px;
    border: 7px solid transparent;
    border-left-color: #fff;
    filter: drop-shadow(2px 1px 2px rgba(36, 32, 42, 0.08));
}

.sape-ai-root .sape-ai-bubble-prompt.is-visible {
    visibility: visible;
    pointer-events: auto;
    animation: sape-ai-teaser-in 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sape-ai-root.is-open .sape-ai-bubble-prompt {
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
    pointer-events: none !important;
}

@keyframes sape-ai-teaser-in {
    0% {
        opacity: 0;
        transform: translate3d(14px, 10px, 0) scale(0.78);
    }
    62% {
        opacity: 1;
        transform: translate3d(-3px, -2px, 0) scale(1.045);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.sape-ai-panel {
    --sape-ai-edge: 20px;
    --sape-ai-topbar: 0px;
    position: absolute !important;
    right: var(--sape-ai-edge) !important;
    bottom: var(--sape-ai-edge) !important;
    left: auto !important;
    top: auto !important;
    z-index: calc(var(--sape-ai-z) + 1);
    width: min(400px, calc(100vw - 24px));
    height: calc(100dvh - (2 * var(--sape-ai-edge)) - var(--sape-ai-topbar));
    max-height: calc(100dvh - (2 * var(--sape-ai-edge)) - var(--sape-ai-topbar));
    box-sizing: border-box;
    background: var(--sape-ai-bg);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(36, 32, 42, 0.18);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #f0dfe8;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(12px, 28px, 0) scale(0.92);
    transform-origin: right bottom;
    transition:
        opacity 280ms ease,
        transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 420ms;
}

body.admin-bar .sape-ai-panel {
    --sape-ai-topbar: var(--wp-admin--admin-bar--height, 32px);
}

.sape-ai-root.is-open .sape-ai-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition:
        opacity 280ms ease,
        transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 0s;
}

.sape-ai-panel[hidden] {
    display: none !important;
}

.sape-ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    color: #fff;
}

.sape-ai-header img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    background: #fff;
}

.sape-ai-header strong {
    flex: 1;
    min-width: 0;
}

.sape-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.sape-ai-root .sape-ai-close,
.sape-ai-root .sape-ai-newchat {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    line-height: 0;
    cursor: pointer;
    overflow: visible;
    transition: background 180ms ease, transform 180ms ease;
}

.sape-ai-root .sape-ai-close svg,
.sape-ai-root .sape-ai-newchat svg {
    display: block;
    width: 20px;
    height: 20px;
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sape-ai-root .sape-ai-close:hover,
.sape-ai-root .sape-ai-close:focus,
.sape-ai-root .sape-ai-newchat:hover,
.sape-ai-root .sape-ai-newchat:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sape-ai-root .sape-ai-newchat:hover svg,
.sape-ai-root .sape-ai-newchat:focus svg {
    transform: scale(1.12) rotate(-12deg);
}

.sape-ai-root .sape-ai-newchat:active {
    transform: scale(0.94);
}

.sape-ai-root .sape-ai-newchat.is-spinning svg {
    animation: sape-ai-newchat-spin 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sape-ai-root .sape-ai-tip {
    position: absolute;
    top: 50%;
    right: calc(100% + 8px);
    transform: translate(6px, -50%);
    padding: 6px 10px;
    border-radius: 8px;
    background: #24202a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(36, 32, 42, 0.22);
    transition:
        opacity 180ms ease,
        transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 180ms;
    z-index: 2;
}

.sape-ai-root .sape-ai-newchat:hover .sape-ai-tip,
.sape-ai-root .sape-ai-newchat:focus .sape-ai-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
    transition:
        opacity 180ms ease,
        transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 0s;
}

.sape-ai-thread.is-resetting > * {
    animation: sape-ai-thread-out 300ms ease forwards;
}

@keyframes sape-ai-newchat-spin {
    0% { transform: scale(1) rotate(0deg); }
    35% { transform: scale(0.86) rotate(-28deg); }
    100% { transform: scale(1) rotate(360deg); }
}

@keyframes sape-ai-thread-out {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }
}

.sape-ai-thread {
    flex: 1;
    overflow-y: auto;
    overflow-anchor: none;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.sape-ai-thread > * {
    flex-shrink: 0;
}

.sape-ai-account {
    position: relative;
    flex: 0 0 auto;
    padding: 10px 38px 12px 14px;
    border-top: 1px solid #f0dfe8;
    background: #fdf7fa;
}

.sape-ai-account[hidden],
.sape-ai-account-form[hidden],
.sape-ai-account-prompt[hidden] {
    display: none !important;
}

.sape-ai-root .sape-ai-account-dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sape-ai-muted);
    line-height: 0;
    cursor: pointer;
}

.sape-ai-root .sape-ai-account-dismiss svg {
    display: block;
    width: 16px;
    height: 16px;
}

.sape-ai-root button.sape-ai-account-dismiss:hover,
.sape-ai-root button.sape-ai-account-dismiss:focus {
    background: rgba(76, 41, 71, 0.08);
    color: var(--sape-ai-pink-2);
}

.sape-ai-account-prompt p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--sape-ai-text);
}

.sape-ai-account-prompt p + p {
    margin-top: 6px;
}

.sape-ai-root .sape-ai-account-link,
.sape-ai-root .sape-ai-account-back {
    display: inline;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sape-ai-pink);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.sape-ai-root .sape-ai-account-link:hover,
.sape-ai-root .sape-ai-account-link:focus,
.sape-ai-root .sape-ai-account-back:hover,
.sape-ai-root .sape-ai-account-back:focus {
    background: transparent;
    color: var(--sape-ai-pink-dark);
    text-decoration: underline;
}

.sape-ai-account-faq {
    color: var(--sape-ai-pink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sape-ai-account-faq:hover,
.sape-ai-account-faq:focus {
    color: var(--sape-ai-pink-dark);
}

.sape-ai-account-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sape-ai-account-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sape-ai-muted);
}

.sape-ai-root .sape-ai-account input[type="text"],
.sape-ai-root .sape-ai-account input[type="email"],
.sape-ai-root .sape-ai-account input[type="password"] {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0;
    border: 1.5px solid #f0dfe8;
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    box-shadow: none;
    color: var(--sape-ai-text);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
}

.sape-ai-root .sape-ai-account input[type="text"]:focus,
.sape-ai-root .sape-ai-account input[type="email"]:focus,
.sape-ai-root .sape-ai-account input[type="password"]:focus {
    outline: none;
    border-color: var(--sape-ai-pink);
}

.sape-ai-account-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    font-weight: 500 !important;
}

.sape-ai-root .sape-ai-account input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--sape-ai-pink);
}

.sape-ai-account-msg {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: #b91c1c;
}

.sape-ai-account-msg.is-ok {
    color: #166534;
}

.sape-ai-root .sape-ai-account-submit {
    width: 100%;
    height: 38px;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sape-ai-root .sape-ai-account-submit:hover,
.sape-ai-root .sape-ai-account-submit:focus {
    filter: brightness(1.06);
    color: #fff;
}

.sape-ai-root .sape-ai-account-submit:disabled {
    opacity: 0.55;
    cursor: wait;
}

.sape-ai-root .sape-ai-account-back {
    align-self: center;
    margin-top: 2px;
}

.sape-ai-msg {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
}

.sape-ai-msg.assistant {
    align-self: flex-start;
    background: var(--sape-ai-surface);
    border: 1px solid #eceef5;
    animation: sape-ai-msg-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sape-ai-msg.user {
    align-self: flex-end;
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    color: #fff;
}

.sape-ai-msg.sape-ai-msg-pop {
    animation: sape-ai-msg-in-user 280ms cubic-bezier(0.16, 1, 0.3, 1) both, sape-ai-brand-flow 8s linear infinite;
}

.sape-ai-msg.is-typing {
    overflow: hidden;
}

.sape-ai-msg.is-typing .sape-ai-msg-body {
    display: block;
}

.sape-ai-msg.is-typing-grow {
    transition: height 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sape-ai-msg.is-typing .sape-ai-msg-body::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 0.95em;
    margin-left: 2px;
    background: currentColor;
    opacity: 0.55;
    vertical-align: -0.12em;
    animation: sape-ai-caret 0.9s steps(1) infinite;
}

@keyframes sape-ai-msg-in {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes sape-ai-msg-in-user {
    from { opacity: 0; transform: translate3d(10px, 8px, 0) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes sape-ai-caret {
    0%, 49% { opacity: 0.7; }
    50%, 100% { opacity: 0; }
}

.sape-ai-root .sape-ai-msg-link {
    color: var(--sape-ai-pink);
    font-weight: 600;
    text-decoration: underline;
}

.sape-ai-msg.user .sape-ai-msg-link {
    color: #fff;
}

.sape-ai-starter {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 92%;
    width: auto;
    margin: 2px 0 0;
}

.sape-ai-root button.sape-ai-chip {
    --starter-fill: #fff;
    --chip-ease: 220ms ease;
    appearance: none;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    max-width: 100%;
    min-height: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    background:
        linear-gradient(var(--starter-fill), var(--starter-fill)) padding-box,
        var(--sape-ai-gradient) border-box;
    background-size: 100% 100%, 200% 200%;
    background-position: 0 0, 0% 0%;
    animation: sape-ai-chip-in 280ms ease both, sape-ai-brand-border-flow 8s linear infinite;
    color: var(--sape-ai-text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
    box-shadow: 0 8px 20px rgba(223, 45, 119, 0.14);
    cursor: pointer;
    animation-delay: var(--starter-delay, 0ms), 0s;
    transition:
        color var(--chip-ease),
        border-color var(--chip-ease),
        box-shadow var(--chip-ease),
        transform var(--chip-ease);
}

.sape-ai-root button.sape-ai-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity var(--chip-ease);
}

.sape-ai-root button.sape-ai-chip .sape-ai-chip-label {
    position: relative;
    z-index: 1;
    color: inherit;
    transition: color var(--chip-ease);
}

.sape-ai-root button.sape-ai-chip:hover,
.sape-ai-root button.sape-ai-chip:focus {
    --starter-fill: transparent;
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(223, 45, 119, 0.28);
}

.sape-ai-root button.sape-ai-chip:hover .sape-ai-chip-label,
.sape-ai-root button.sape-ai-chip:focus .sape-ai-chip-label {
    color: #fff;
}

.sape-ai-root button.sape-ai-chip:hover::before,
.sape-ai-root button.sape-ai-chip:focus::before {
    opacity: 1;
}

@keyframes sape-ai-chip-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sape-ai-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px 12px;
    align-self: flex-start;
    animation: sape-ai-msg-in 280ms ease both;
}

.sape-ai-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sape-ai-pink);
    animation: sape-ai-dot 1s infinite ease-in-out;
}

.sape-ai-typing i:nth-child(1) { background: var(--sape-ai-pink); }
.sape-ai-typing i:nth-child(2) { background: var(--sape-ai-pink-2); }
.sape-ai-typing i:nth-child(3) { background: var(--sape-ai-pink); }

.sape-ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.sape-ai-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes sape-ai-dot {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.sape-ai-typing-note {
    font-size: 12px;
    color: var(--sape-ai-muted);
}

.sape-ai-carousel {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 2px 2px 8px;
    cursor: grab;
    touch-action: pan-x pan-y;
}

.sape-ai-carousel a,
.sape-ai-carousel img {
    -webkit-user-drag: none;
    user-select: none;
}

.sape-ai-carousel.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.sape-ai-carousel::-webkit-scrollbar {
    height: 4px;
}

.sape-ai-carousel::-webkit-scrollbar-thumb {
    background: #e4d0da;
    border-radius: 99px;
}

.sape-ai-root .sape-ai-carousel .sape-ai-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 80%;
    width: 80%;
    max-width: 80%;
    min-height: 148px;
    border: 1px solid #f0dfe8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 18px rgba(36, 32, 42, 0.06);
}

.sape-ai-root .sape-ai-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    max-width: 88%;
    min-height: 148px;
    border: 1px solid #f0dfe8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 18px rgba(36, 32, 42, 0.06);
}

.sape-ai-card-enter,
.sape-ai-confirm.sape-ai-card-enter {
    animation: sape-ai-card-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--card-delay, 0ms);
}

@keyframes sape-ai-card-in {
    from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.sape-ai-root .sape-ai-card-top {
    display: flex !important;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 12px 0;
    flex: 0 0 auto;
}

.sape-ai-root .sape-ai-card-media {
    flex: 0 0 88px;
    display: block !important;
    width: 88px !important;
    height: 88px !important;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    text-decoration: none !important;
}

.sape-ai-root .sape-ai-card-media img,
.sape-ai-root .sape-ai-card-ph {
    width: 88px !important;
    height: 88px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    display: block !important;
    border-radius: 10px;
    background: #f6f7fb;
}

.sape-ai-root .sape-ai-card-body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px 0 0;
}

.sape-ai-root .sape-ai-card-actions {
    flex: 0 0 auto;
    padding: 10px 12px 12px;
}

.sape-ai-root .sape-ai-card-name,
.sape-ai-root a.sape-ai-card-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 6px;
    line-height: 1.35;
    color: var(--sape-ai-text);
    text-decoration: none !important;
    text-transform: none;
}

.sape-ai-root a.sape-ai-card-name:hover,
.sape-ai-root a.sape-ai-card-name:focus {
    color: var(--sape-ai-pink);
}

.sape-ai-root .sape-ai-card-price {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline;
    gap: 8px;
    color: var(--sape-ai-pink);
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
}

.sape-ai-root .sape-ai-card-price .screen-reader-text {
    display: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

.sape-ai-root .sape-ai-card-price del,
.sape-ai-root .sape-ai-card-price ins,
.sape-ai-root .sape-ai-card-price .amount,
.sape-ai-root .sape-ai-card-price bdi {
    display: inline !important;
    white-space: nowrap;
}

.sape-ai-root .sape-ai-card-price del,
.sape-ai-root .sape-ai-card-price del .amount,
.sape-ai-root .sape-ai-card-price del bdi {
    color: var(--sape-ai-muted) !important;
    font-weight: 500 !important;
    text-decoration: line-through !important;
    background: none !important;
}

.sape-ai-root .sape-ai-card-price ins,
.sape-ai-root .sape-ai-card-price ins .amount,
.sape-ai-root .sape-ai-card-price ins bdi {
    color: var(--sape-ai-pink) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    background: none !important;
    padding: 0 !important;
}

.sape-ai-card-row {
    margin-top: 8px;
}

.sape-ai-card-row select {
    width: 100%;
    height: 32px;
    border: 1px solid #f0dfe8;
    border-radius: 8px;
    padding: 0 8px;
}

.sape-ai-root .sape-ai-atc,
.sape-ai-root a.sape-ai-atc {
    --atc-ease: 280ms ease;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    touch-action: manipulation;
    border-radius: 8px;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    background: transparent;
    color: #fff !important;
    font-weight: 600;
    font-size: 13px;
    text-transform: none;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform var(--atc-ease), box-shadow var(--atc-ease);
}

.sape-ai-root .sape-ai-atc::before,
.sape-ai-root a.sape-ai-atc::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity var(--atc-ease);
}

.sape-ai-root .sape-ai-atc-icon-wrap,
.sape-ai-root .sape-ai-atc-label {
    position: relative;
    z-index: 1;
}

.sape-ai-root .sape-ai-atc-icon-wrap {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.sape-ai-root .sape-ai-atc-icon {
    display: block;
    width: 16px;
    height: 16px;
    color: #fff;
}

.sape-ai-root .sape-ai-atc-label {
    -webkit-text-fill-color: #fff;
    color: #fff;
}

.sape-ai-root .sape-ai-atc:hover:not(:disabled),
.sape-ai-root .sape-ai-atc:focus:not(:disabled),
.sape-ai-root a.sape-ai-atc:hover,
.sape-ai-root a.sape-ai-atc:focus {
    background: transparent !important;
    color: #fff !important;
    filter: none;
    transform: translateY(-1px);
    box-shadow: none;
}

.sape-ai-root .sape-ai-atc:hover:not(:disabled)::before,
.sape-ai-root .sape-ai-atc:focus:not(:disabled)::before,
.sape-ai-root a.sape-ai-atc:hover::before,
.sape-ai-root a.sape-ai-atc:focus::before {
    opacity: 0;
}

.sape-ai-root .sape-ai-atc:hover:not(:disabled) .sape-ai-atc-label,
.sape-ai-root .sape-ai-atc:focus:not(:disabled) .sape-ai-atc-label,
.sape-ai-root a.sape-ai-atc:hover .sape-ai-atc-label,
.sape-ai-root a.sape-ai-atc:focus .sape-ai-atc-label {
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.sape-ai-root .sape-ai-atc:hover:not(:disabled) .sape-ai-atc-icon-wrap,
.sape-ai-root .sape-ai-atc:focus:not(:disabled) .sape-ai-atc-icon-wrap,
.sape-ai-root a.sape-ai-atc:hover .sape-ai-atc-icon-wrap,
.sape-ai-root a.sape-ai-atc:focus .sape-ai-atc-icon-wrap {
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    -webkit-mask-image: var(--sape-ai-atc-mask);
    mask-image: var(--sape-ai-atc-mask);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.sape-ai-root .sape-ai-atc:hover:not(:disabled) .sape-ai-atc-icon,
.sape-ai-root .sape-ai-atc:focus:not(:disabled) .sape-ai-atc-icon,
.sape-ai-root a.sape-ai-atc:hover .sape-ai-atc-icon,
.sape-ai-root a.sape-ai-atc:focus .sape-ai-atc-icon {
    opacity: 0;
}

.sape-ai-atc:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sape-ai-confirm {
    align-self: flex-start;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}

.sape-ai-confirm a {
    color: var(--sape-ai-pink);
    font-weight: 600;
}

.sape-ai-error {
    color: #b91c1c;
    font-size: 13px;
}

.sape-ai-composer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid #f0dfe8;
    background: #fff;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.sape-ai-composer-row {
    display: flex;
    gap: 8px;
}

.sape-ai-root .sape-ai-composer input {
    flex: 1;
    width: auto;
    max-width: none;
    height: 42px;
    min-height: 42px;
    border: 1.5px solid #f0dfe8;
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    box-shadow: none;
    text-transform: none;
}

.sape-ai-root .sape-ai-composer-footer {
    padding: 0 2px 2px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    cursor: grab;
}

.sape-ai-root .sape-ai-composer-footer::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.sape-ai-root .sape-ai-composer-footer.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.sape-ai-root p.sape-ai-secure-note {
    display: inline-block;
    width: max-content;
    max-width: none;
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--sape-ai-muted);
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    overflow: visible;
}

.sape-ai-root .sape-ai-secure-note-track {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

.sape-ai-privacy-link {
    color: var(--sape-ai-pink);
    text-decoration: underline;
}

.sape-ai-composer input:focus {
    outline: none;
    border-color: var(--sape-ai-pink);
}

.sape-ai-root button.sape-ai-send {
    flex: 0 0 42px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    background-image: var(--sape-ai-gradient), var(--sape-ai-gradient);
    background-size: 200% 200%, 200% 200%;
    background-position: 0% 0%, 0% 0%;
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: sape-ai-brand-border-flow 8s linear infinite;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    text-transform: none;
    transition:
        box-shadow 280ms ease,
        transform 280ms ease,
        filter 280ms ease;
}

.sape-ai-send-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 1em;
    height: 1em;
    line-height: 1;
}

.sape-ai-send-glyph {
    grid-area: 1 / 1;
    line-height: 1;
    transition: opacity 280ms ease;
}

.sape-ai-send-glyph-solid {
    color: #fff;
    opacity: 1;
}

.sape-ai-send-glyph-grad {
    background-image: var(--sape-ai-gradient);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sape-ai-brand-flow 8s linear infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: 0;
}

.sape-ai-root button.sape-ai-send:hover,
.sape-ai-root button.sape-ai-send:focus {
    background-image: linear-gradient(#fff, #fff), var(--sape-ai-gradient);
    background-size: 100% 100%, 200% 200%;
    color: #fff;
    filter: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(223, 45, 119, 0.22);
}

.sape-ai-root button.sape-ai-send:hover .sape-ai-send-glyph-solid,
.sape-ai-root button.sape-ai-send:focus .sape-ai-send-glyph-solid {
    opacity: 0;
}

.sape-ai-root button.sape-ai-send:hover .sape-ai-send-glyph-grad,
.sape-ai-root button.sape-ai-send:focus .sape-ai-send-glyph-grad {
    opacity: 1;
}

.sape-ai-root button.sape-ai-send:active {
    transform: translateY(0) scale(0.98);
}

.sape-ai-send:disabled {
    opacity: 0.55;
    cursor: wait;
}

@keyframes sape-ai-brand-flow {
    from { background-position: 0% 0%; }
    to { background-position: 100% 100%; }
}

@keyframes sape-ai-brand-border-flow {
    from { background-position: 0 0, 0% 0%; }
    to { background-position: 0 0, 100% 100%; }
}

@media (max-width: 640px) {
    .sape-ai-root .sape-ai-bubble {
        right: 12px !important;
        bottom: 50px !important;
    }

    .sape-ai-root .sape-ai-bubble-prompt {
        max-width: min(220px, calc(100vw - 88px));
        font-size: 13px;
        padding: 9px 12px;
    }

    .sape-ai-panel {
        right: 8px !important;
        left: auto !important;
        width: calc(100vw - 16px);
        bottom: 8px !important;
        height: 75vh;
        max-height: 75vh;
    }

    .sape-ai-root .sape-ai-close,
    .sape-ai-root .sape-ai-newchat {
        width: 43px;
        height: 43px;
    }

    .sape-ai-root .sape-ai-close svg,
    .sape-ai-root .sape-ai-newchat svg {
        width: 27px;
        height: 27px;
    }

    .sape-ai-root .sape-ai-account input[type="text"],
    .sape-ai-root .sape-ai-account input[type="email"],
    .sape-ai-root .sape-ai-account input[type="password"],
    .sape-ai-root .sape-ai-account-submit,
    .sape-ai-msg,
    .sape-ai-root .sape-ai-card-name,
    .sape-ai-root a.sape-ai-card-name,
    .sape-ai-confirm,
    .sape-ai-root .sape-ai-composer input {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sape-ai-chip,
    .sape-ai-typing i,
    .sape-ai-msg.assistant,
    .sape-ai-msg.sape-ai-msg-pop,
    .sape-ai-msg.user,
    .sape-ai-card-enter,
    .sape-ai-confirm.sape-ai-card-enter,
    .sape-ai-msg.is-typing .sape-ai-msg-body::after,
    .sape-ai-root .sape-ai-bubble-prompt.is-visible,
    .sape-ai-header,
    .sape-ai-root .sape-ai-send,
    .sape-ai-send-glyph-grad,
    .sape-ai-root .sape-ai-account-submit,
    .sape-ai-root .sape-ai-atc,
    .sape-ai-root a.sape-ai-atc,
    .sape-ai-root .sape-ai-atc::before,
    .sape-ai-root a.sape-ai-atc::before,
    .sape-ai-root .sape-ai-atc-label,
    .sape-ai-root .sape-ai-atc-icon-wrap,
    .sape-ai-root button.sape-ai-chip,
    .sape-ai-root button.sape-ai-chip::before,
    .sape-ai-root .sape-ai-newchat.is-spinning svg,
    .sape-ai-thread.is-resetting > * {
        animation: none !important;
    }

    .sape-ai-header,
    .sape-ai-msg.user,
    .sape-ai-root .sape-ai-send,
    .sape-ai-send-glyph-grad,
    .sape-ai-root .sape-ai-account-submit,
    .sape-ai-root .sape-ai-atc,
    .sape-ai-root a.sape-ai-atc,
    .sape-ai-root .sape-ai-atc::before,
    .sape-ai-root a.sape-ai-atc::before,
    .sape-ai-root .sape-ai-atc-label,
    .sape-ai-root .sape-ai-atc-icon-wrap,
    .sape-ai-root button.sape-ai-chip,
    .sape-ai-root button.sape-ai-chip::before {
        background-size: 100% 100% !important;
        background-position: 0 0 !important;
    }

    .sape-ai-msg.is-typing-grow {
        transition: none !important;
    }

    .sape-ai-root .sape-ai-bubble-prompt.is-visible {
        opacity: 1;
        transform: none;
        visibility: visible;
    }

    .sape-ai-root .sape-ai-bubble,
    .sape-ai-bubble-avatar,
    .sape-ai-panel,
    .sape-ai-root.is-open .sape-ai-panel,
    .sape-ai-root .sape-ai-newchat,
    .sape-ai-root .sape-ai-newchat svg,
    .sape-ai-root .sape-ai-tip {
        transition: none !important;
        transform: none !important;
    }

    .sape-ai-root .sape-ai-newchat:hover .sape-ai-tip,
    .sape-ai-root .sape-ai-newchat:focus .sape-ai-tip {
        opacity: 1;
        visibility: visible;
        transform: translate(0, -50%) !important;
    }
}
