.ncr-chat-shell{
    --ncr-accent:#8F3A8D;
    --ncr-ink:#24222a;
    --ncr-soft:#f7f3f8;
    --ncr-border:#e8e2ea;
    --ncr-muted:#77707c;
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color:var(--ncr-ink);
    line-height:1.4;
}

.ncr-chat-shell,
.ncr-chat-shell *{
    box-sizing:border-box;
}

.ncr-chat-shell *{
    max-width:100%;
}

.ncr-panel{
    background:#fff;
    border:1px solid var(--ncr-border);
    border-radius:24px;
    overflow:hidden;
    box-shadow:0 24px 80px rgba(31,19,37,.16);
    min-width:0;
}

.ncr-chat-shell--inline .ncr-panel{
    width:100%;
    max-width:760px;
    margin:24px auto;
}

.ncr-chat-shell--floating{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:99999;
    width:auto;
    max-width:none;
}

.ncr-chat-shell--floating .ncr-panel{
    position:absolute;
    right:0;
    bottom:72px;
    width:440px;
    max-width:calc(100vw - 32px);
    max-height:min(760px,calc(100dvh - 110px));
    display:flex;
    flex-direction:column;
}

.ncr-chat-shell--floating .ncr-panel[hidden]{
    display:none!important;
}

/* Reset fuerte para evitar estilos del theme sobre botones del chat */
.ncr-chat-shell button{
    appearance:none;
    -webkit-appearance:none;
    font-family:inherit;
    text-transform:none;
    letter-spacing:normal;
    line-height:1.25;
    margin:0;
}

.ncr-launcher{
    border:0!important;
    border-radius:999px!important;
    padding:14px 20px!important;
    background:var(--ncr-accent)!important;
    color:#fff!important;
    font-size:14px!important;
    font-weight:750!important;
    display:flex!important;
    align-items:center;
    justify-content:center;
    gap:9px;
    min-height:54px;
    box-shadow:0 12px 30px rgba(80,40,90,.25);
    cursor:pointer;
}

.ncr-launcher:hover{
    transform:translateY(-1px);
    box-shadow:0 16px 34px rgba(80,40,90,.28);
}

.ncr-launcher__spark{
    width:28px;
    height:28px;
    border-radius:50%;
    background:rgba(255,255,255,.16);
    display:grid;
    place-items:center;
    flex:0 0 28px;
}

.ncr-header{
    padding:16px 18px;
    display:flex;
    align-items:center;
    gap:12px;
    border-bottom:1px solid var(--ncr-border);
    background:linear-gradient(180deg,#fff,#fcfafc);
    flex:0 0 auto;
    min-width:0;
}

.ncr-brandmark,
.ncr-avatar{
    width:38px;
    height:38px;
    border-radius:13px;
    background:#f4eaf4;
    color:var(--ncr-accent);
    display:grid;
    place-items:center;
    font-weight:900;
    flex:0 0 38px;
}

.ncr-heading{
    display:flex;
    flex-direction:column;
    line-height:1.15;
    min-width:0;
}

.ncr-heading strong{
    font-size:15px;
    font-weight:800;
    color:var(--ncr-ink);
}

.ncr-heading span{
    font-size:12px;
    color:#88808d;
    margin-top:4px;
}

.ncr-close{
    margin-left:auto!important;
    border:0!important;
    background:transparent!important;
    color:#7a737d!important;
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    padding:0!important;
    border-radius:50%!important;
    font-size:26px!important;
    font-weight:400!important;
    line-height:1!important;
    display:grid!important;
    place-items:center;
    cursor:pointer;
    flex:0 0 36px;
}

.ncr-close:hover{
    background:#f5f1f6!important;
    color:var(--ncr-accent)!important;
}

.ncr-body{
    padding:18px;
    overflow-x:hidden;
    overflow-y:auto;
    min-width:0;
    width:100%;
}

.ncr-chat-shell--floating .ncr-body{
    display:flex;
    flex-direction:column;
    min-height:0;
}

.ncr-welcome{
    padding:4px 0 14px;
    width:100%;
    min-width:0;
}

.ncr-eyebrow{
    display:block;
    font-size:11px;
    font-weight:800;
    color:var(--ncr-accent);
    text-transform:uppercase;
    letter-spacing:.06em;
}

.ncr-welcome h3{
    display:block;
    width:100%;
    max-width:100%;
    font-family:inherit;
    font-size:24px;
    line-height:1.18;
    font-weight:800;
    color:var(--ncr-ink);
    text-align:left;
    margin:6px 0 7px!important;
    padding:0!important;
    transform:none!important;
    word-break:normal;
    overflow-wrap:anywhere;
}

.ncr-welcome p{
    display:block;
    width:100%;
    max-width:100%;
    margin:0!important;
    padding:0!important;
    color:#6f6873;
    font-size:14px;
    line-height:1.55;
    text-align:left;
    overflow-wrap:anywhere;
}

/* OPCIONES SIEMPRE VERTICALES */
.ncr-mode-grid{
    display:flex;
    flex-direction:column;
    width:100%;
    min-width:0;
    gap:10px;
    margin:5px 0 16px;
}

.ncr-mode-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:74px;
    border:1px solid var(--ncr-border)!important;
    background:#fff!important;
    color:var(--ncr-ink)!important;
    border-radius:17px!important;
    padding:13px 14px!important;
    text-align:left!important;
    display:flex!important;
    flex-direction:row!important;
    gap:12px!important;
    align-items:center!important;
    justify-content:flex-start!important;
    cursor:pointer;
    transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease,background .2s ease;
    overflow:hidden;
}

.ncr-mode-card:hover{
    transform:translateY(-1px);
    border-color:#ceb8cf!important;
    background:#fff!important;
    box-shadow:0 8px 22px rgba(40,25,44,.06);
}

.ncr-mode-card.is-active{
    border-color:var(--ncr-accent)!important;
    background:#fbf6fb!important;
    box-shadow:inset 0 0 0 1px rgba(143,58,141,.10),0 7px 20px rgba(68,34,70,.06);
}

.ncr-mode-card__icon{
    width:42px;
    height:42px;
    border-radius:13px;
    background:var(--ncr-soft);
    display:grid;
    place-items:center;
    flex:0 0 42px;
    font-size:18px;
}

.ncr-mode-card.is-active .ncr-mode-card__icon{
    background:#f2e4f2;
}

.ncr-mode-card span:last-child{
    display:flex;
    flex-direction:column;
    min-width:0;
    flex:1 1 auto;
}

.ncr-mode-card strong{
    display:block;
    font-size:13px;
    line-height:1.3;
    font-weight:800;
    text-transform:none!important;
    letter-spacing:0!important;
    white-space:normal;
    overflow-wrap:anywhere;
}

.ncr-mode-card small{
    display:block;
    font-size:11px;
    line-height:1.4;
    color:#837b86;
    margin-top:3px;
    text-transform:none!important;
    letter-spacing:0!important;
    white-space:normal;
    overflow-wrap:anywhere;
}

.ncr-chat-stream{
    display:flex;
    flex-direction:column;
    gap:14px;
    width:100%;
    min-width:0;
    max-height:390px;
    overflow-x:hidden;
    overflow-y:auto;
    padding:2px 0 10px;
}

.ncr-message{
    display:flex;
    gap:9px;
    align-items:flex-start;
    min-width:0;
    width:100%;
}

.ncr-message--user{
    justify-content:flex-end;
}

.ncr-message--user .ncr-bubble{
    background:var(--ncr-accent);
    color:#fff;
    border-radius:18px 18px 5px 18px;
    max-width:82%;
}

.ncr-message--assistant .ncr-bubble{
    background:#f6f4f7;
    border:1px solid #eee9ef;
    border-radius:18px 18px 18px 5px;
}

.ncr-bubble{
    min-width:0;
    max-width:100%;
    padding:11px 13px;
    font-size:13px;
    line-height:1.55;
    overflow-wrap:anywhere;
    word-break:normal;
}

.ncr-bubble--caution{
    background:#fff9eb!important;
    border-color:#f1dfaa!important;
}

.ncr-response{
    min-width:0;
    flex:1 1 auto;
    max-width:calc(100% - 47px);
}

.ncr-message--typing .ncr-bubble{
    display:flex;
    gap:4px;
    padding:15px;
}

.ncr-message--typing .ncr-bubble span{
    width:6px;
    height:6px;
    background:#9f98a2;
    border-radius:50%;
    animation:ncr-dot 1.1s infinite;
}

.ncr-message--typing .ncr-bubble span:nth-child(2){animation-delay:.15s}
.ncr-message--typing .ncr-bubble span:nth-child(3){animation-delay:.3s}

@keyframes ncr-dot{
    0%,60%,100%{transform:translateY(0);opacity:.45}
    30%{transform:translateY(-4px);opacity:1}
}

.ncr-result-title{
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.05em;
    color:#8b838e;
    font-weight:800;
    margin:12px 0 7px;
}

/* Resultados también en una sola columna dentro del chat flotante */
.ncr-product-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    width:100%;
}

.ncr-product-card{
    display:flex;
    width:100%;
    min-width:0;
    gap:10px;
    padding:9px;
    border:1px solid var(--ncr-border);
    border-radius:14px;
    text-decoration:none!important;
    color:inherit!important;
    background:#fff;
    transition:.2s;
}

.ncr-product-card:hover{
    border-color:#cdb4cd;
    transform:translateY(-1px);
}

.ncr-product-card img{
    width:68px;
    height:68px;
    min-width:68px;
    object-fit:cover;
    border-radius:10px;
    background:#f4f4f4;
}

.ncr-product-card__content{
    min-width:0;
    display:flex;
    flex-direction:column;
    flex:1;
}

.ncr-product-card strong{
    font-size:12px;
    line-height:1.3;
    overflow-wrap:anywhere;
}

.ncr-product-card small{
    font-size:10px;
    color:#7b747d;
    line-height:1.35;
    margin-top:3px;
    overflow-wrap:anywhere;
}

.ncr-product-price{
    font-size:12px;
    font-weight:800;
    color:var(--ncr-accent);
    margin-top:3px;
}

.ncr-product-card em{
    font-size:10px;
    font-style:normal;
    color:#6b9465;
    margin-top:auto;
}

.ncr-article-list{
    display:flex;
    flex-direction:column;
    gap:8px;
    width:100%;
}

.ncr-article-card{
    display:grid;
    grid-template-columns:66px minmax(0,1fr);
    gap:10px;
    width:100%;
    min-width:0;
    padding:9px;
    border:1px solid var(--ncr-border);
    border-radius:14px;
    text-decoration:none!important;
    color:inherit!important;
    background:#fff;
}

.ncr-article-card img,
.ncr-article-placeholder{
    width:66px;
    height:66px;
    border-radius:10px;
    object-fit:cover;
    background:var(--ncr-soft);
    display:grid;
    place-items:center;
    color:var(--ncr-accent);
    font-size:22px;
}

.ncr-article-card div{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.ncr-article-card strong{
    font-size:12px;
    overflow-wrap:anywhere;
}

.ncr-article-card small{
    font-size:10px;
    color:#77707a;
    line-height:1.35;
    margin-top:3px;
    overflow-wrap:anywhere;
}

.ncr-article-card em{
    font-size:10px;
    color:var(--ncr-accent);
    font-style:normal;
    font-weight:800;
    margin-top:5px;
}

.ncr-composer{
    width:100%;
    min-width:0;
    padding-top:12px;
    border-top:1px solid var(--ncr-border);
    margin-top:6px;
}

.ncr-composer__row{
    width:100%;
    min-width:0;
    display:flex;
    align-items:flex-end;
    gap:8px;
    background:#f8f6f8;
    border:1px solid #e7e1e8;
    border-radius:17px;
    padding:7px 7px 7px 13px;
}

.ncr-input{
    border:0!important;
    outline:0!important;
    box-shadow:none!important;
    background:transparent!important;
    resize:none!important;
    width:100%!important;
    min-width:0!important;
    min-height:38px;
    max-height:120px;
    padding:9px 0!important;
    margin:0!important;
    font-family:inherit!important;
    font-size:14px!important;
    font-weight:400!important;
    line-height:1.4!important;
    color:inherit!important;
}

.ncr-send{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    min-height:42px!important;
    border:0!important;
    border-radius:13px!important;
    padding:0!important;
    background:var(--ncr-accent)!important;
    color:#fff!important;
    display:grid!important;
    place-items:center;
    cursor:pointer;
    flex:0 0 42px;
}

.ncr-send svg{
    width:19px;
    height:19px;
}

.ncr-send:disabled{
    opacity:.5;
    cursor:wait;
}

.ncr-hint{
    font-size:10px;
    line-height:1.35;
    color:#99929c;
    text-align:center;
    margin-top:7px;
    padding:0 6px;
}

/* TABLET / MOBILE */
@media(max-width:700px){
    .ncr-chat-shell--floating{
        right:12px;
        bottom:12px;
    }

    .ncr-chat-shell--floating .ncr-panel{
        position:fixed;
        left:12px;
        right:12px;
        top:max(12px,env(safe-area-inset-top));
        bottom:82px;
        width:auto;
        max-width:none;
        max-height:none;
        border-radius:22px;
    }

    .ncr-chat-shell--floating .ncr-body{
        flex:1 1 auto;
        overflow-y:auto;
        overflow-x:hidden;
    }

    .ncr-body{
        padding:14px;
    }

    .ncr-header{
        padding:14px 15px;
    }

    .ncr-welcome h3{
        font-size:21px;
    }

    .ncr-welcome p{
        font-size:13px;
    }

    .ncr-mode-card{
        min-height:70px;
        padding:12px!important;
    }

    .ncr-chat-stream{
        max-height:none;
        flex:1 1 auto;
    }

    /* Evita zoom automático en Safari iOS */
    .ncr-input{
        font-size:16px!important;
    }
}

@media(max-width:420px){
    .ncr-chat-shell--floating{
        right:10px;
        bottom:10px;
    }

    .ncr-chat-shell--floating .ncr-panel{
        left:8px;
        right:8px;
        top:max(8px,env(safe-area-inset-top));
        bottom:78px;
        border-radius:20px;
    }

    .ncr-launcher{
        min-height:50px;
        padding:12px 16px!important;
        font-size:13px!important;
    }

    .ncr-launcher__spark{
        width:26px;
        height:26px;
        flex-basis:26px;
    }

    .ncr-header{
        padding:12px 13px;
    }

    .ncr-brandmark,
    .ncr-avatar{
        width:34px;
        height:34px;
        flex-basis:34px;
        border-radius:11px;
    }

    .ncr-body{
        padding:12px;
    }

    .ncr-welcome{
        padding-bottom:12px;
    }

    .ncr-welcome h3{
        font-size:20px;
    }

    .ncr-mode-grid{
        gap:8px;
        margin-bottom:12px;
    }

    .ncr-mode-card{
        min-height:66px;
        border-radius:15px!important;
    }

    .ncr-mode-card__icon{
        width:38px;
        height:38px;
        flex-basis:38px;
        border-radius:11px;
        font-size:16px;
    }

    .ncr-mode-card strong{
        font-size:12px;
    }

    .ncr-mode-card small{
        font-size:10.5px;
    }

    .ncr-product-card img{
        width:60px;
        height:60px;
        min-width:60px;
    }

    .ncr-composer__row{
        border-radius:15px;
        padding-left:11px;
    }

    .ncr-send{
        width:40px!important;
        height:40px!important;
        min-width:40px!important;
        min-height:40px!important;
        flex-basis:40px;
    }
}
