#isai-widget-root {
    margin: 10px 0 18px;
    width: 100%;
}

#isai-open-btn {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(90deg, #eb5b3c, #c93a1f);
    color: #fff !important;
    border: none;
    border-radius: 30px;
    padding: 6px 22px 6px 6px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(226,72,42,.3);
    transition: box-shadow .25s ease, transform .12s ease;
}
#isai-open-btn:hover { box-shadow: 0 5px 16px rgba(226,72,42,.45); }
#isai-open-btn:active { transform: scale(.98); }

.isai-btn-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}
.isai-btn-icon img { width: 34px; height: 34px; object-fit: contain; }

.isai-btn-text { flex: 1; text-align: center; color: #fff !important; }

.isai-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99998;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.isai-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.isai-modal {
    background: #fff;
    width: 100%; max-width: 640px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    overflow: hidden;
    font-family: -apple-system, Arial, sans-serif;
    transform: translateY(-24px) scale(.96);
    opacity: 0;
    transition: transform .32s cubic-bezier(.34,1.56,.64,1), opacity .28s ease;
}
.isai-overlay.open .isai-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.isai-header {
    background: #0d2b4e;
    color: #fff;
    border-bottom: 3px solid #e2482a;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    font-weight: 700; font-size: 17px;
}
.isai-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }

.isai-body { padding: 18px; max-height: 65vh; overflow-y: auto; }

.isai-note-preview { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.isai-note-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.isai-note-preview span { font-weight: 600; color: #222; font-size: 14px; }

.isai-msg {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    animation: isaiMsgIn .25s ease;
}
@keyframes isaiMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.isai-msg.user { background: #0d2b4e; color: #fff; margin-left: 40px; }
.isai-msg.bot  { background: #f1f3f6; color: #222; margin-right: 20px; }
.isai-msg.loading { color: #777; font-style: italic; }
.isai-loading-text { transition: opacity .2s ease; }
.isai-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 9px;
    vertical-align: middle;
    border-radius: 50%;
    border: 2px solid rgba(226,72,42,.18);
    border-top-color: #e2482a;
    border-right-color: #e2482a;
    animation: isaiSpin .7s linear infinite;
}
@keyframes isaiSpin {
    to { transform: rotate(360deg); }
}

.isai-msg-text { display: block; }
.isai-listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: none;
    border: 1.5px solid #0d2b4e;
    color: #0d2b4e;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.isai-listen-btn:hover { background: #e2482a; border-color: #e2482a; color: #fff; }

/* ===== Botón flotante "Modo IA" (portada) ===== */
#isai-home-widget-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99990;
}
#isai-home-open-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #eb5b3c, #c93a1f);
    color: #fff;
    border: none;
    border-radius: 34px;
    padding: 8px 26px 8px 8px;
    font-family: -apple-system, Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.28);
    transition: box-shadow .25s ease, transform .12s ease;
}
#isai-home-open-btn:hover { box-shadow: 0 6px 20px rgba(226,72,42,.45); }
#isai-home-open-btn:active { transform: scale(.97); }

.isai-chips-label { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #666; margin: 10px 0 8px; }
.isai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.isai-chip {
    border: 1.5px solid #0d2b4e;
    color: #0d2b4e;
    background: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.isai-chip:hover { background: #e2482a; color: #fff; border-color: #e2482a; }

.isai-related-list a { display: block; color: #0d2b4e; font-weight: 600; margin-bottom: 6px; text-decoration: underline; font-size: 14px; }

.isai-input-row {
    display: flex; gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid #e5e5e5;
}
.isai-input-row input {
    flex: 1;
    border: 1.5px solid #ccc;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
}
.isai-input-row button {
    background: #e2482a;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px; height: 40px;
    cursor: pointer;
    font-size: 16px;
}
.isai-input-row button:hover { background: #c93a1f; }

.isai-disclaimer {
    text-align: center;
    font-size: 10.5px;
    color: #aaa;
    padding: 0 18px 12px;
    font-family: -apple-system, Arial, sans-serif;
}
