body > * {
    position: relative;
    z-index: 1;
}

.sfc-ai-fab {
    position: fixed;
    right: 24px;
    bottom: 150px;
    z-index: 999999;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #020617);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.sfc-ai-modal {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.45);
    padding: 16px;
}

.sfc-ai-modal.is-open {
    display: flex;
}

.sfc-ai-card {
    width: 100%;
    max-width: 420px;
    height: 600px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0,0,0,.45);
}

.sfc-ai-head {
    background: linear-gradient(135deg, #0C5367, #36A9B9);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sfc-ai-fab.has-avatar{
    background-color: transparent !important;
    color: transparent !important;
}

.sfc-ai-fab{
    position: fixed;
}

.sfc-ai-fab::after{
    content: attr(data-title);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;

    font-size: 11px;
    line-height: 1.15;
    font-weight: 700;
    white-space: pre-line;

    background: linear-gradient(135deg, #0C5367, #36A9B9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    pointer-events: none;
}

.sfc-ai-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.2);
}

.sfc-ai-meta {
    flex: 1;
}

.sfc-ai-name {
    font-weight: 800;
    line-height: 1.2;
}

.sfc-ai-title {
    font-size: 12px;
    opacity: .8;
}

.sfc-ai-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

.sfc-ai-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f8fafc;
}

.sfc-ai-bubble {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.sfc-ai-bubble--bot {
    background: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.sfc-ai-bubble--me {
    background: #0f172a;
    color: #fff;
    margin-left: auto;
}

.sfc-ai-foot {
    padding: 12px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.sfc-ai-input {
    flex: 1;
    width: 100%;
    box-sizing: border-box;

    resize: none;
    min-height: 44px;
    max-height: 140px;
    overflow-y: auto;

    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 12px;

    font: inherit;
    line-height: 1.4;
    outline: none;
}

.sfc-ai-input:focus {
    border-color: #2563eb;
}

.sfc-ai-send {
    flex: 0 0 auto;
    border-radius: 12px;
    border: none;
    background: #f97316;
    color: #fff;
    font-weight: 800;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .sfc-ai-card {
        height: 90vh;
        max-width: 100%;
        border-radius: 16px;
    }
}

.sfc-ai-bubble--bot {
    white-space: pre-line;
}

.sfc-ai-cta-wrap { margin-top: 10px; }

.sfc-ai-cta{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:12px;
    padding:12px 14px;
    border-radius:14px;
    background:#f97316;
    color:#fff;
    font-weight:800;
    text-decoration:none;
    cursor:pointer;
}

.sfc-ai-cta:hover{
    opacity:.9;
}

.sfc-ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sfc-ai-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(15,23,42,.25);
    border-top-color: rgba(15,23,42,1);
    border-radius: 50%;
    animation: sfcSpin .8s linear infinite;
}

@keyframes sfcSpin { to { transform: rotate(360deg); } }

sfc-ai-chip.is-selected {
    border-color: currentColor;
    box-shadow: inset 0 0 0 9999px rgba(0,0,0,0.06);
    font-weight: 600;
}

.sfc-ai-chip:focus-visible {
    outline: 2px solid rgba(0,0,0,0.35);
    outline-offset: 2px;
}

.sfc-ai-chip.is-selected::before {
    content: "✓";
    margin-right: 6px;
}

#sfc-ai-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

#sfc-ai-modal .sfc-ai-card {
    width: min(420px, 100%);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
}

#sfc-ai-modal .sfc-ai-head {
    flex: 0 0 auto;
}

#sfc-ai-modal .sfc-ai-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
}

#sfc-ai-modal .sfc-ai-foot {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: inherit;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 2;
}

#sfc-ai-modal.is-open ~ #sfc-ai-fab,
#sfc-ai-modal.is-open + #sfc-ai-fab {
    display: none !important;
}

body.sfc-ai-open #sfc-ai-fab {
    display: none !important;
}

.sfc-ai-actions{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:12px;
}

.sfc-ai-btn{
    width:100%;
    border-radius:14px;
    padding:14px 14px;
    font-size:16px;
    line-height:1.2;
    font-weight:600;
    border:1px solid transparent;
    cursor:pointer;
    text-align:left;
    transition: transform .08s ease, filter .15s ease;
}

.sfc-ai-btn:active{
    transform: scale(0.99);
}

.sfc-ai-btn--option{
    background:#fff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.sfc-ai-btn--option:hover{
    filter: brightness(0.98);
}

.sfc-ai-btn--option.is-selected{
    border-color: #36A9B9;
    box-shadow: 0 0 0 1px rgba(54,169,185,0.35);
    background: #fff;
    color: #0C5367;
}

.sfc-ai-btn--option.is-selected::before{
    content:"✓";
    display:inline-block;
    margin-right:10px;
    font-weight:800;
    color:#36A9B9;
}

.sfc-ai-btn--option.is-selected{
    background: rgba(54,169,185,0.06);
}

.sfc-ai-btn--primary{
    background:#f97316 !important;
    color:#fff !important;
    box-shadow: 0 10px 24px rgba(11,19,42,0.25);
}

.sfc-ai-btn--secondary{
    background:transparent;
    border-color: rgba(11,19,42,0.25);
    color:#0C5367;
}

@media (max-width: 420px){
    .sfc-ai-btn{
        font-size:15px;
        padding:13px 13px;
    }
}

.sfc-ai-bubble-text { white-space: pre-wrap; }

.sfc-ai-bubble--bot,
.sfc-ai-bubble--bot .sfc-ai-bubble-text {
    color: #0C5367;
}

.sfc-ai-bubble--me {
    background: #0C5367;
    color: #ffffff;
}

.sfc-ai-bubble--me .sfc-ai-bubble-text {
    color: #ffffff;
}
