/* Botón flotante */
#wiblion-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0061ff;
    color: #fff;
    font-size: 22px;
    border: none;
    cursor: pointer;
    z-index: 100000;
}

/* Contenedor del chat (cerrado por defecto) */
#wiblion-chat-container {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 650px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    z-index: 99999;

    display: none;              /* CERRADO */
    flex-direction: column;
    overflow: hidden;
}

/* Estado abierto */
#wiblion-chat-container.is-open {
    display: flex;              /* ABIERTO */
}

/* Header */
.wiblion-chat-header {
    padding: 14px 16px;
    background: #fff;
    color: #111;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    position: relative;
}

.wiblion-chat-close {
    position: absolute;
    right: 16px;
    top: 14px;
    cursor: pointer;
    font-size: 14px;
    color: #777;
}


/* Body (contenido navegable entre vistas) */
.wiblion-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f9f9f9;
}

/* Tabs */
.wiblion-chat-tabs {
    display: flex;
    border-top: 1px solid #eee;
    background: #fff;
}

.wiblion-chat-tab {
    flex: 1;
    padding: 10px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: #555;
}

.wiblion-chat-tab.is-active {
    color: #0061ff;
    font-weight: 600;
}

/* Vistas */
.wiblion-view {
    height: 100%;
}

.wiblion-home-view,
.wiblion-empty-view,
.wiblion-messages-view {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
}


.wiblion-home-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.wiblion-home-subtitle {
    font-size: 14px;
    color: #444;
}

.wiblion-primary-btn {
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px;
    background: #0061ff;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.wiblion-empty-state {
    color: #666;
    font-size: 13px;
}

.wiblion-conv-list {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.wiblion-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #fff;
    cursor: pointer;
}

.wiblion-conv-item:hover {
    background: #f7f7f7;
}


.wiblion-conv-item.is-active {
    border-color: #0061ff;
}

.wiblion-conv-title {
    font-size: 13px;
    font-weight: 600;
    color: #111;
}

.wiblion-conv-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #777;
}

/* Mensajes */
.wiblion-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
    background: #f9f9f9;
}

/* Input */
.wiblion-chat-input {
    display: flex;
    border-top: 1px solid #eee;
    background: #fff;
}

.wiblion-chat-input input {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 14px;
}

.wiblion-chat-input button {
    padding: 0 16px;
    border: none;
    background: #0061ff;
    color: #fff;
    cursor: pointer;
}

.wiblion-typing {
    font-size: 13px;
    color: #666;
    padding: 6px 12px;
    font-style: italic;
}

/* Vista chat: layout interno */
.wiblion-chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}


.wiblion-conv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.wiblion-conv-content {
    flex: 1;
    min-width: 0;
}

.wiblion-conv-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.wiblion-conv-meta {
    margin-top: 2px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiblion-conv-time {
    font-size: 12px;
    color: #999;
}

.wiblion-messages-cta {
    padding: 14px;
    border-top: 1px solid #eee;
    background: #fff;
}

.wiblion-messages-cta button {
    width: 100%;
    padding: 14px;
    border-radius: 999px;
    border: none;
    background: #0061ff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
