.pims-widget-container {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.pims-trigger-btn {
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}

.pims-trigger-btn:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.55) !important;
}

.pims-trigger-btn svg {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
}

.pims-chat-box {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    z-index: 999999;
}

.pims-header {
    background: #0f172a;
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.pims-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pims-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.pims-msg.user {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.pims-msg.pims {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.pims-input-area {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.pims-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}
.pims-input:focus {
    border-color: #2563eb;
}

.pims-send-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}
.pims-send-btn:hover {
    background: #1d4ed8;
}
/* Pims Modal Overlay & Iframe Container */
.pims-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.pims-modal-card {
    background: #ffffff;
    width: 900px;
    max-width: 95vw;
    height: 650px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pimsFadeIn 0.2s ease-out;
}

.pims-modal-header {
    background: #f8fafc;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pims-modal-body {
    flex: 1;
    background: #ffffff;
    overflow: hidden;
}

@keyframes pimsFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Pims Teaser Speech Bubble */
.pims-teaser-bubble {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    font-size: 0.88rem;
    line-height: 1.4;
    width: 230px;
    cursor: pointer;
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999998;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pims-teaser-bubble.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Chat bubble arrow */
.pims-teaser-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #0f172a;
}

.pims-teaser-bubble .pims-teaser-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    line-height: 1;
}
.pims-teaser-bubble .pims-teaser-close:hover {
    color: #ffffff;
}
/* --- PIMS Input & Autofill Contrast Fix --- */
#pims-chat-input,
.pims-chat-input,
#pimsChatInput,
.pims-input,
input[name="pims_message"],
textarea[name="pims_message"] {
    background-color: #1a1a1e !important;
    color: #f1f1f1 !important;
    border: 1px solid #3a3a45 !important;
    outline: none !important;
    box-shadow: none !important;
}

#pims-chat-input:focus,
.pims-chat-input:focus,
#pimsChatInput:focus,
.pims-input:focus {
    background-color: #1a1a1e !important;
    color: #ffffff !important;
    border-color: #5c5c70 !important;
}

/* Fix autofill turning background white */
#pims-chat-input:-webkit-autofill,
.pims-chat-input:-webkit-autofill,
#pimsChatInput:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1a1a1e inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Global PIMS Input Contrast Override */
#pims-input-field,
.pims-input-area input,
.pims-chat-input {
    background-color: #1a1a24 !important;
    color: #ffffff !important;
    border: 1px solid #3b82f6 !important;
    -webkit-text-fill-color: #ffffff !important;
}

#pims-input-field:focus,
.pims-input-area input:focus {
    background-color: #1a1a24 !important;
    color: #ffffff !important;
}

#pims-input-field:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1a1a24 inset !important;
}
