/* =========================
   INDEBOT · Panel responsive
   (botón lo controla tu layout en site.css)
========================= */

:root {
    --ib-bg: rgba(10, 10, 18, .84);
    --ib-border: rgba(255, 255, 255, .12);
    --ib-border2: rgba(255, 255, 255, .10);
    --ib-shadow: 0 22px 60px rgba(0, 0, 0, .55);
    --ib-blur: blur(14px);

    --ib-text: rgba(255, 255, 255, .92);
    --ib-dim: rgba(255, 255, 255, .72);

    --ib-accentA: rgba(34, 211, 238, .18);
    --ib-accentB: rgba(255, 46, 166, .12);
}

/* ✅ Botón: solo “skin”, sin position */
.indebot-fab {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;

    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    backdrop-filter: blur(8px);

    font-size: 20px;
    line-height: 1;
    cursor: pointer;

    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.indebot-fab:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .20);
    transform: translateY(-1px);
}

/* ✅ Panel overlay (flotante), responsive */
.indebot {
    position: fixed;
    z-index: 99999;
    display: none;
    overflow: hidden;

    background: var(--ib-bg);
    border: 1px solid var(--ib-border);
    box-shadow: var(--ib-shadow);
    backdrop-filter: var(--ib-blur);
}

/* Abierto */
.indebot.is-open {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* ===== Desktop default: card centrada ===== */
.indebot {
    top: 18vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 24vh));
    border-radius: 18px;
}

/* ===== Tablet: más ancho, más alto ===== */
@media (max-width: 1024px) {
    .indebot {
        top: 14vh;
        width: min(520px, calc(100vw - 28px));
        height: min(560px, calc(100vh - 20vh));
    }
}

/* ===== Mobile: bottom sheet (comodísimo) ===== */
@media (max-width: 640px) {
    .indebot {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;

        width: 100%;
        height: min(78vh, 560px);

        border-radius: 18px 18px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;

        /* Safe area iPhone */
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Header */
.indebot__header {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    background:
        radial-gradient(520px 140px at 20% 0%, var(--ib-accentB), transparent 60%),
        radial-gradient(520px 140px at 80% 0%, var(--ib-accentA), transparent 55%),
        linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .12));

    border-bottom: 1px solid var(--ib-border2);
}

.indebot__title {
    display: flex;
    gap: 10px;
    align-items: baseline;
    color: #fff;
}

.indebot__title small {
    opacity: .75;
    font-size: 12px;
}

.indebot__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, .95);
    box-shadow: 0 0 16px rgba(34, 211, 238, .55);
    display: inline-block;
    margin-right: 2px;
}

/* Actions */
.indebot__actions {
    display: flex;
    gap: 8px;
}

.indebot__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--ib-border);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.indebot__icon:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .16);
}

/* Body */
.indebot__body {
    padding: 12px;
    overflow: auto;
    color: var(--ib-text);
}

/* Messages */
.ib-msg {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 14px;
    margin: 8px 0;
    border: 1px solid var(--ib-border2);
    line-height: 1.3;
    font-size: 14px;
    background: rgba(255, 255, 255, .05);
    color: var(--ib-text);
}

.ib-msg.user {
    margin-left: auto;
    border-color: rgba(34, 211, 238, .20);
    background: rgba(34, 211, 238, .10);
}

/* Quick actions */
.ib-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 2px;
}

.ib-btn {
    border: 1px solid var(--ib-border);
    background: rgba(255, 255, 255, .06);
    color: var(--ib-text);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.ib-btn:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .16);
    transform: translateY(-1px);
}

/* Code box */
.ib-code {
    display: block;
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .32);
    border: 1px solid var(--ib-border2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    color: rgba(255, 255, 255, .88);
}

/* Footer */
.indebot__footer {
    padding: 10px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    border-top: 1px solid var(--ib-border2);
    background: rgba(0, 0, 0, .18);
}

.indebot__quick {
    flex: 1;
    border: 1px solid var(--ib-border);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.indebot__quick:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .16);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {

    .indebot-fab,
    .ib-btn,
    .indebot__icon {
        transition: none !important;
    }
}