/* ILOVEPDF.IO: clean up the popup chat. AIPKit renders the popup panel with aria-hidden/inert,
   but WITHOUT a 'hidden' attribute; the plugin's own [hidden] hide rule then does not apply and
   the fixed panel appears as a (black-bordered) box at the shortcode position (mainly in the footer).
   1) Closed: hide the panel completely; the wrapper creates no box of its own (trigger is fixed). */
.aipkit_popup_wrapper:not(.aipkit-popup-open) .aipkit_popup_content{display:none !important;}
.aipkit_popup_wrapper:not(.aipkit-popup-open){display:contents !important;}
/* 2) On click: open the panel CENTERED on the page, white & clean (instead of at the footer position, black-bordered). */
.aipkit_popup_wrapper.aipkit-popup-open .aipkit_popup_content{
    position:fixed !important;
    top:50% !important; left:50% !important; right:auto !important; bottom:auto !important;
    transform:translate(-50%,-50%) !important;
    margin:0 !important;
    background:#ffffff !important;
    border:1px solid #e5e5e5 !important;
    border-radius:14px !important;
    box-shadow:0 12px 48px rgba(0,0,0,.28) !important;
    /* Fixed height -> messages scroll internally, the popup does NOT grow with the content. */
    height:min(600px, 80vh) !important;
    max-height:80vh !important;
}
/* Ensure the message area inside the popup scrolls internally. */
.aipkit_popup_wrapper.aipkit-popup-open .aipkit_popup_content .aipkit_chat_messages{overflow-y:auto !important;min-height:0 !important;}
/* 3) Popup trigger (bubble): keep the chosen size on hover too. The plugin has a
   generic :hover{width:64px} rule that shrinks every non-medium size down to medium. */
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-small:hover,
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-small:focus,
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-small:active{width:48px !important;height:48px !important;}
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-large:hover,
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-large:focus,
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-large:active{width:80px !important;height:80px !important;}
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-xlarge:hover,
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-xlarge:focus,
div.aipkit_popup_wrapper button.aipkit_popup_trigger--size-xlarge:active{width:96px !important;height:96px !important;}
/* 4) Show only the graphic: transparent background, no padding/blur, NO circular clipping
   (otherwise the tip of the graphic gets cut off). Shadow sits directly on the graphic (follows its shape). */
div.aipkit_popup_wrapper{--aipkit-chat-popup-trigger-bg-color:transparent !important;--aipkit-chat-popup-trigger-hover-bg-color:transparent !important;}
div.aipkit_popup_wrapper button.aipkit_popup_trigger{padding:0 !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important;border-radius:0 !important;overflow:visible !important;box-shadow:none !important;}
div.aipkit_popup_wrapper button.aipkit_popup_trigger img.aipkit_popup_custom_icon{filter:drop-shadow(0 3px 6px rgba(0,0,0,.35)) !important;}

/* Chat input field: white background + dark text, theme-independent via variable (admin can override) */
.aipkit_chat_container .aipkit_chat_input_wrapper{--aipkit-chat-input-wrapper-bg-color:#ffffff;--aipkit-chat-input-text-color:#111111;--aipkit-chat-input-placeholder-color:#888888;}
/* ILOVEPDF.IO: content area (messages) + footer forced WHITE (header is already white).
   Container variables white -> our footer rule (uses --aipkit-chat-messages-bg-color) automatically turns white. */
.aipkit_chat_container{--aipkit-chat-container-bg-color:#ffffff !important;--aipkit-chat-messages-bg-color:#ffffff !important;--aipkit-chat-input-area-bg-color:#ffffff !important;}
.aipkit_chat_container .aipkit_chat_messages{background-color:#ffffff !important;}
/* Input area behind the input box also white (its own variable, was light gray). */
.aipkit_chat_container .aipkit_chat_input{background-color:#ffffff !important;}

/* File upload icon -> PDF icon */
.aipkit_chat_input_actions_left svg.icon-tabler-file-upload>*{display:none !important;}
.aipkit_chat_input_actions_left svg.icon-tabler-file-upload{background-color:#e5322d;width:30px !important;height:30px !important;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%203v4a1%201%200%200%200%201%201h4%22%2F%3E%3Cpath%20d%3D%22M5%2012v-7a2%202%200%200%201%202%20-2h7l5%205v4%22%2F%3E%3Cpath%20d%3D%22M5%2018h1.5a1.5%201.5%200%200%200%200%20-3h-1.5v6%22%2F%3E%3Cpath%20d%3D%22M17%2018h2%22%2F%3E%3Cpath%20d%3D%22M20%2015h-3v6%22%2F%3E%3Cpath%20d%3D%22M11%2015v6h1a2%202%200%200%200%202%20-2v-2a2%202%200%200%200%20-2%20-2h-1z%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%203v4a1%201%200%200%200%201%201h4%22%2F%3E%3Cpath%20d%3D%22M5%2012v-7a2%202%200%200%201%202%20-2h7l5%205v4%22%2F%3E%3Cpath%20d%3D%22M5%2018h1.5a1.5%201.5%200%200%200%200%20-3h-1.5v6%22%2F%3E%3Cpath%20d%3D%22M17%2018h2%22%2F%3E%3Cpath%20d%3D%22M20%2015h-3v6%22%2F%3E%3Cpath%20d%3D%22M11%2015v6h1a2%202%200%200%200%202%20-2v-2a2%202%200%200%200%20-2%20-2h-1z%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;}


/* AI-BUBBLE-LIKE-USER: AI reply styled like the sent message — white background, black text, same pill shape. */
.aipkit_chat_container .aipkit_chat_message-bot:not(.aipkit_initial_greeting):not(.aipkit_chat_message-error):not(.aipkit_typing-indicator):not(.aipkit_image_loading_indicator):not(.aipkit_chat_form_message) .aipkit_chat_bubble{background-color:#ffffff !important;color:#000000 !important;border-radius:var(--aipkit-chat-bubble-border-radius,18px) !important;padding:10px 14px !important;max-width:80% !important;box-shadow:0 1px 2px #00000014 !important;}

/* FOOTER-LIKE-CHAT: chat footer takes the same color as the chat surface (via variable -> follows automatically when the custom color is changed). */
.aipkit_chat_container .aipkit_chat_footer{background-color:var(--aipkit-chat-messages-bg-color, var(--aipkit-chat-container-bg-color, var(--aipkit_bg-primary, #f7f7f7))) !important;border-top-color:var(--aipkit-chat-messages-bg-color, var(--aipkit-chat-container-bg-color, var(--aipkit_bg-primary, #f7f7f7))) !important;padding-top:7px !important;padding-bottom:7px !important;align-items:center !important;}

/* AI-BUBBLE-LINKS: links in AI replies black; on hover without underline (color stays black). */
.aipkit_chat_container .aipkit_chat_message-bot .aipkit_chat_bubble a,
.aipkit_chat_container .aipkit_chat_message-bot .aipkit_chat_bubble a:hover,
.aipkit_chat_container .aipkit_chat_message-bot .aipkit_chat_bubble a:focus{color:#000000 !important;}
.aipkit_chat_container .aipkit_chat_message-bot .aipkit_chat_bubble a:hover{text-decoration:none !important;}

/* WEB SEARCH: hide the toggle icon — web search runs automatically (Auto) in the background, no user switch. */
body .aipkit_chat_container button.aipkit_web_search_toggle,
body .aipkit_chat_container button.aipkit_google_search_grounding_toggle{display:none !important;}

/* CHAT WIDTH: fixed 1000px instead of the plugin default 56rem/896px. Also overrides the
   inline variable of the custom theme set via JS (hence !important). */
.aipkit_chat_container {
    --aipkit-chat-container-max-width: 1000px !important;
    max-width: 1000px !important;
}