﻿/* ==========================================================================
   AVIE CORE STYLES
   ========================================================================== */





/*used to style the AI popup box*/
.AIFormat{min-height:115px;}
.AIFormat h1{color:#333333;margin-top:10px;margin-bottom:10px;font-size:18px;font-weight:bold;}
.AIFormat h2{color:#333333;margin-top:10px;margin-bottom:10px;font-size:16px;font-weight:bold;}
.AIFormat h3{color:#333333;margin-top:10px;margin-bottom:10px;font-size:14px;font-weight:bold;}
.AIFormat h4{color:#333333;margin-top:5px;margin-bottom:0px;font-size:12px;font-weight:bold;}
.AIFormat h5{color:#333333;margin-top:5px;margin-bottom:5px;font-size:10px;font-weight:bold;}
.AIFormat h6{color:#333333;margin-top:5px;margin-bottom:5px;font-size:8px;font-weight:bold;}
.AIFormat p{font-size:14px;margin-top:10px;margin-bottom:10px;padding-top:0px;padding-bottom:0px;line-height: 20px !important;}
.AIFormat b{font-size:14px;margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;}
.AIFormat strong{font-size:14px;margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;}
.AIFormat label{font-size:14px;margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;}
.AIFormat em{font-size:14px;margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;}
.AIFormat code{font-size:12px;margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;font-family: Google Sans Mono, monospace;}
.AIFormat textarea{font-size:14px;}
.AIFormat blockquote{font-size:14px;}

    .AIFormat ul {
        display: block;
        list-style: disc outside none;
        margin: 5px 0px 5px 0px;
        padding: 0px 0px 0px 30px;
        font-size: 14px;
    }
    .AIFormat ol {
        display: block;
        list-style: disc outside none;
        margin: 5px 0px 5px 0px;
        padding: 0px 0px 0px 30px;
        font-size: 14px;
    }
    .AIFormat li {
        display: block;
        list-style: disc outside none;
        margin: 8px 0px 8px 0px;
        padding: 0px 0px 0px 0px;
        display: list-item;
        font-size: 14px;
    }










/* Animations */
.BcolAI { background-color: #cdffcd; animation: Avie 2s linear infinite; }

@keyframes Avie {
    0% { background-color: rgb(146, 213, 142); }
    50% { background-color: rgb(133, 184, 222); }
    100% { background-color: rgb(146, 213, 142); }
}

@keyframes avieFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes avieSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes avieFadePop {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* UI Elements & Buttons */
.AI_Copied { font-size: 14px; position: absolute; right: 70px; bottom: -3px; }

.AI_CopyClip { float: right; cursor: pointer; font-size: 10px; color: blue; margin-top: 5px; }
.AI_EmailButton { padding: 1px 3px 0px 3px; border: 1px solid #42647F; border-radius: 2px; display: inline-block; cursor: pointer; color: black; }
.AI_EmailButton_Fixed { position: relative; top: 3px; padding: 1px 3px 0px 3px; border: 1px solid #42647F; border-radius: 2px; display: inline-block; cursor: pointer; color: black; width: 12px; height: 15px; overflow: hidden; text-align: center; }
.AI_Submit { position: absolute; right: 27px; bottom: 10px; font-size: 14px; padding: 2px 5px 2px 5px !important; border: 1px solid silver; border-radius: 5px; display: inline-block; cursor: pointer;z-index:6; }
.AI_UploadImage { position: absolute; height: 24px; width: 24px !important; border-radius: 8px; border: 1px solid silver; bottom: 7px; left: -1px; font-size: 20px !important; padding-top: 2px !important; }

/* Consolidated Hover States */
.AI_CopyClip:hover,
.AI_EmailButton:hover,
.AI_EmailButton_Fixed:hover,
.AI_Submit:hover, .AI_UploadImage:hover {background-color: #C7CDD0; color: black; cursor: pointer;}

/* Placeholders */
.AI_ClosedChat, .AI_DocumentEditor { float: left; width: 94%; height: 50px; border-radius: 10px; text-align: center; font-size: 15px; color: dimgrey; }
.AI_ClosedChat { margin-top: 30px; }
.AI_DocumentEditor { margin-top: 70px; }

/* Intro Screen */
.AI_Intro_Short { background-color: #FAFAFA; border-radius: 20px; position: absolute; top: 10px; bottom: 20px; left: 20px; right: 20px; }
.AI_Intro_Short label { display: block; text-align: center; font-size: 25px !important; color: #3D3D3D; padding-top: 50px !important; }
.AI_Intro_Short div { text-align: center; font-size: 15px; color: dimgrey; }
.AI_Intro_Short span { display: block; text-align: center; font-size: 10px !important; color: dimgrey; }

/* Chat History & Layout */
.AI_historyWrapper { border: 1px solid silver; max-height: 500px; min-height: 200px; margin-left: 0px; margin-right: 10px; margin-top: 10px; overflow: hidden; padding: 5px; border-radius: 10px; }
.AI_history { max-height: 450px; min-height: 200px; overflow: hidden; overflow-y: auto; padding-left: 50px; }
.AI_history span { font-size: 10px; color: grey; line-height: 22px; }

/* Bubbles */
.AI_Bubble { position: relative; border: 1px solid silver; padding: 0px 5px 2px 5px; border-radius: 5px; margin: 5px; display: inline-block; clear: both; float: left; max-width: 97%; min-width:215px; }
.AI_Bubble_Reply { background-color: #FAFAFA; }
.AI_Bubble_Question { background-color: #e8f4f8; }

.AI_Bubble i { position: absolute; margin-left: -50px; height: 30px; width: 30px; border: 1px solid silver; border-radius: 30px; overflow: hidden; background-color: #e6ffe6; }
.AI_Image_Reply { width: 25px; height: 25px; margin-top: 4px; margin-left: 2px; }
.AI_Image_Question { height: 30px; }

.AI_Bubble tag { font-weight: bold; }
.AI_Bubble label { position: absolute; margin-left: -50px; top: 33px; font-size: 10px !important; display: block !important; text-align: center !important; width: 30px !important; }

/* Bubble Arrows */
.AI_Bubble:after, .AI_Bubble:before { right: 100%; top: 30px; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; }
.AI_Bubble:after { border-color: rgba(136, 183, 213, 0); border-right-color: #e8f4f8; border-width: 4px; margin-top: -17px; }
.AI_Bubble:before { border-color: rgba(194, 225, 245, 0); border-right-color: silver; border-width: 6px; margin-top: -19px; }

/* Input Area */
.AI_AskBox { position: relative; width: 100%; }
.AI_TheMessage { font-size: 12px !important; border-radius: 10px; background-color: #e8f4f8; border: 1px solid silver; margin: 10px 0px 0px 0px; padding: 10px 120px 10px 40px !important; width: 98.7%; overflow: hidden; outline-color: green; resize: none; box-sizing: border-box; field-sizing: content;  overflow-y: auto; }


/* Tables inside Bubble */
.AI_Bubble table { font-family: Arial, Helvetica, sans-serif; border-collapse: collapse; width: auto; margin-bottom: 10px; font-size: 13px; }
.AI_Bubble table td, .AI_Bubble table th { border: 1px solid #ffffff; padding: 6px 8px; line-height: 1.4; }
.AI_Bubble table th { padding-top: 8px; padding-bottom: 8px; text-align: left; background-color: #4F81BD !important; color: #FFFFFF !important; border-bottom: 1px solid #ffffff; white-space: nowrap; }
.AI_Bubble table tr td { background-color: #DCE6F1; color: #333; }
.AI_Bubble table tr:nth-child(even) td { background-color: #EFF3F9; }
.AI_Bubble table tr:hover td { background-color: #C6D9F1; cursor: default; }

/* Links */
.AI_Bubble a { color: #1D7CF2; cursor: Pointer; }
.AI_Bubble a:hover { color: #ff6600; }

/* Examples */
.xAvie_Example { cursor: pointer; margin-left: 22px; float: left; width: 26%; height: 40px; border-radius: 3px; background-color: #DEDEDE; font-style: italic; font-size: 12px !important; color: #3D3D3D !important; border: 1px solid silver; padding: 10px; }
.xAvie_Example:hover { filter: brightness(85%); }



/* Panels */
.AI_Panels { display: flex; width: 100%; gap: 0px; align-items: flex-start; }
.AI_Twenty { width: 20%; height: 550px; overflow-y: auto; }
.AI_Eighty { width: 80%; display: flex; flex-direction: column; position: relative; }




/* Sidebar History */
#Avie_HistoryList { padding: 2px 5px; box-sizing: border-box; }
.avie-history-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 4px 10px; margin-bottom: 1px; background: transparent; border-radius: 12px; cursor: pointer; transition: background 0.1s ease; min-height: 28px; }
.avie-history-row:hover { background-color: #e9eef6; }
.avie-history-row.active { background-color: #d3e3fd; font-weight: 500; }

.avie-history-clickable { display: flex; align-items: center; flex: 1; min-width: 0; }
.avie-title-text { font-size: 13px; font-weight: 400; color: #3c4043; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

.avie-options-trigger { flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #5f6368; border-radius: 50%; opacity: 0; transition: opacity 0.1s ease, background 0.2s; }
.avie-options-trigger.is-pinned { opacity: 0.5; font-size: 11px; }
.avie-history-row:hover .avie-options-trigger { opacity: 1; }
.avie-options-trigger:hover { background-color: #dadce0; }

/* Context Menu */
.avie-context-menu { position: fixed; z-index: 99999; background: white; border: 1px solid #dadce0; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 6px 0; min-width: 120px; margin: 0; }
.avie-context-menu div { padding: 8px 16px; font-size: 13px; cursor: pointer; }
.avie-context-menu div:hover { background: #f1f3f4; }

/* New Chat Button */
.avie-new-chat-container { padding: 10px 15px 5px 5px; width: 88%; box-sizing: border-box; }
.avie-btn-new { display: flex; align-items: center; justify-content: flex-start; gap: 10px; background-color: #f0f4f9; border: none; border-radius: 12px; padding: 10px 16px; width: 100%; font-size: 13px; font-weight: 500; color: #041e49; cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s; }
.avie-btn-new:hover { background-color: #dde3ea; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.avie-plus-icon { font-size: 18px; line-height: 1; color: #041e49; font-weight: 300; }

/* Modals */
.avie-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 9999; border-radius: 12px; animation: avieFadeIn 0.2s ease-out forwards; }
.avie-confirm-box { background: #ffffff; padding: 24px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); max-width: 260px; width: 90%; text-align: center; border: 1px solid #eee; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; animation: avieFadePop 0.2s ease-out forwards; }
.avie-confirm-box h4 { margin: 0 0 10px 0; font-size: 16px; color: #1f1f1f; }
.avie-confirm-box p { margin: 0 0 20px 0; font-size: 13px; color: #5f6368; line-height: 1.4; }
.avie-confirm-buttons { display: flex; gap: 10px; justify-content: center; }

.avie-btn { padding: 10px 20px; border-radius: 20px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.avie-btn:hover { opacity: 0.8; }
.avie-btn-cancel { background: #f1f3f4; color: #3c4043; }
.avie-btn-delete { background: #d93025; color: #ffffff; }

.avie-rename-input { width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid #dadce0; border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.avie-rename-input:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,0.2); }

/* Generated Images */
.avie-generated-image { max-width: 98.5%; width: auto; image-rendering: auto; height: auto; border-radius: 12px; margin: 15px 5px; display: block; box-shadow: 0 4px 15px rgba(0,0,0,0.1); animation: avieSlideIn 0.5s ease-in; }

.avie-chat-header { position: absolute; top: 50px; right: 0px; width: 80%; text-align: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; font-weight: 600; color: #444746; }

/* ==========================================================================
   THEME & SAFETY RESETS (Overrides)
   ========================================================================== */
.AI_TextArea { white-space: normal; font-family: 'Segoe UI', sans-serif; font-size: 14px !important; line-height: 1.6 !important; overflow-x: auto; color: #333; }

.AI_Bubble h1, .AI_Bubble h2, .AI_Bubble h3, .AI_Bubble h4, .AI_Bubble h5, .AI_Bubble h6 { background-color: transparent !important; border: none !important; border-radius: 0 !important; padding: 0 !important; margin: 12px 0 6px 0 !important; color: #2c3e50 !important; font-weight: 700 !important; box-shadow: none !important; }
.AI_Bubble h1 { font-size: 20px; border-bottom: 1px solid #ddd !important; padding-bottom: 5px !important; }
.AI_Bubble h2 { font-size: 18px; }
.AI_Bubble h3 { font-size: 16px; }
.AI_Bubble h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.AI_Bubble h5 { font-size: 13px; color: #666 !important; }

.AI_Bubble ul, .AI_Bubble ol { margin: 5px 0 10px 0 !important; padding-left: 25px !important; list-style-position: outside !important; background: transparent !important; }
.AI_Bubble li { margin-bottom: 8px !important; line-height: 1.5 !important; }
.AI_Bubble pre { background-color: #f6f8fa !important; border: 1px solid #e1e4e8 !important; border-radius: 6px !important; padding: 12px !important; margin: 10px 0 !important; overflow-x: auto; }
.AI_Bubble code { font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important; font-size: 85%; color: #d63384; }
.AI_Bubble blockquote { border-left: 4px solid #dfe2e5 !important; color: #6a737d !important; padding-left: 16px !important; margin: 10px 0 !important; background: transparent !important; }
.AI_Bubble img { max-width: 100% !important; height: auto !important; border-radius: 4px; }


.AI_SystemInstruction{position:absolute; bottom:16px;background-color:white; left:0px;padding: 1px 0px 0px 0px; border: 1px solid #42647F; border-radius: 2px; display: inline-block; cursor: pointer; color: black;width:60px; text-align:center;}



/* 2. Position the Navigation Bar in the Top Right */
.AI_Email_Nav {
    position: absolute; /* Take out of flow to stop "jumping" */
    top: 0px; /* Pin to top */
    left: 100px; /* Pin to right */
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Remove previous "Bottom" styling */
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    /* Ensure it sits on top of text */
    z-index: 10;
    white-space: nowrap;
}

.AI_NavBtn {
    cursor: pointer;
    margin: 0 10px;
    color: #007bff;
    font-weight: bold;
    user-select: none;
}

    .AI_NavBtn:hover {
        text-decoration: underline;
    }





.AI_ExpandInput {

    position: absolute;
    bottom: 10px;
    right: 110px !important; 
    left: auto !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px; /* Vertically centers text */
    text-align: center; /* Horizontally centers text */
    font-size: 16px;
    cursor: pointer;
    color: #5f6368;
    z-index: 5;
    background-color: transparent; /* Ensure no background makes it look wide */
}


.AI_AskBox_Expanded .AI_ExpandInput {
    right: 10px !important; /* Move to the far corner */
    top: 10px !important;
    left: auto;
    font-weight: bold;
    color: maroon;
}


    .AI_ExpandInput:hover {
        color: red;
    }
.AI_AskBox_Expanded .AI_ExpandInput:hover {
    color: red !important;
    cursor: pointer;
}

/* [NEW] Expanded State */
.AI_AskBox.AI_AskBox_Expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    background: white;
    z-index: 100000;
    padding: 30px 12px 40px 20px;
    border-radius: 16px;
    box-shadow: 0 0 0 1000px rgba(0,0,0,0.5), 0 10px 40px rgba(0,0,0,0.3);
}

.AI_AskBox_Expanded .AI_TheMessage {
    max-height: 400px !important;
    height: 300px !important;
    padding: 15px !important;
    font-size: 14px !important;
}

.AI_AskBox_Expanded .AI_Submit {
    bottom: 8px;
    right: 20px;
    top: auto; /* Override standard positioning */
    background: #007bff;
    color: white;
    padding: 5px 20px !important;
}


/* 1. STANDARD VIEW: Limit to 100px */
.savePanel .AI_TheMessage,
.savePanel .Avie_PromptInput {
    max-height: 100px !important;
}

/* 2. STANDALONE VIEW: Limit to Half Window (50vh) */
.savePanel_standalone .AI_TheMessage,
.savePanel_standalone .Avie_PromptInput {
    max-height: 50vh !important;
}


.AI_AskBox_Expanded .AI_UploadImage {
    display: none !important;
}

/* [NEW] Input Error Animation (Shake) */
@keyframes AI_Shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.AI_InputError {
    border: 2px solid #dc3545 !important; /* Red border */
    animation: AI_Shake 0.3s ease-in-out;
}




/* ==========================================================================
   AVIE SOURCE CITATIONS
   ========================================================================== */

/* The main container for the sources section */
.Avie_Source_Container {
    margin-top: 8px;
    border-top: 1px solid #e0e0e0;
    padding-top: 5px;
}

/* The clickable "View Sources" text */
.Avie_Source_Summary {
    cursor: pointer;
    color: #5f6368;
    font-size: 11px;
    font-weight: 600;
    outline: none;
}

/* Hover effect for the summary text */
.Avie_Source_Summary:hover {
    color: #1D7CF2;
    text-decoration: underline;
}

/* The unordered list containing the links */
.Avie_Source_List {
    margin-top: 5px;
    margin-bottom: 0px;
    padding-left: 20px;
    font-size: 11px;
    color: #444;
}

/* Individual list items */
.Avie_Source_Item {
    margin-bottom: 4px;
}

/* The actual source links */
.Avie_Source_Link {
    color: #1D7CF2;
    text-decoration: none;
}

.Avie_Source_Link:hover {
    text-decoration: underline;
}

/* Optional: Smooth slide animation when opening */
details.Avie_Source_Container[open] ul {
    animation: avieSlideIn 0.2s ease-in-out;
}


/* Remove default marker in some browsers if you want a custom icon, 
   otherwise standard arrow is fine. This styles the hover state. */
details.Avie_Source_Container summary:hover {
    color: #1D7CF2 !important; /* Matches your link colour */
    text-decoration: underline;
}


/* ==========================================================================
   AVIE FINANCIAL DOCUMENT STYLES
   ========================================================================== */

.Avie_Invoice_Container {
    font-family: 'Segoe UI', sans-serif;
    border: 1px solid #ddd;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-top: 10px;
    color: #333;
}

/* Header Grid: Vendor Left, Invoice Details Right */
.Avie_Invoice_Header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.Avie_Invoice_Vendor, .Avie_Invoice_Meta {
    width: 48%;
}

.Avie_Invoice_Vendor h3 { margin: 0 0 5px 0; color: #1D7CF2; font-size: 18px; }
.Avie_Invoice_Vendor p { margin: 2px 0; font-size: 13px; color: #666; }

.Avie_Invoice_Meta table { width: 100%; font-size: 13px; }
.Avie_Invoice_Meta td { padding: 3px 0; }
.Avie_Invoice_Meta td.label { font-weight: bold; color: #555; width: 40%; text-align: right; padding-right: 10px; }
.Avie_Invoice_Meta td.val { text-align: right; color: #000; }

/* Line Items Table */
.Avie_Invoice_Table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 13px;
}

.Avie_Invoice_Table th { text-align: left; background: #f9f9f9; padding: 8px; border-bottom: 1px solid #ddd; color: #555; }
.Avie_Invoice_Table td { padding: 8px; border-bottom: 1px solid #eee; }
.Avie_Invoice_Table tr:last-child td { border-bottom: none; }
.Avie_Invoice_Table .num { text-align: right; }

/* Footer: Payment Info Left, Totals Right */
.Avie_Invoice_Footer {
    display: flex;
    justify-content: space-between;
    background: #fcfcfc;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.Avie_Pay_Details h4 { margin: 0 0 5px 0; font-size: 12px; text-transform: uppercase; color: #888; }
.Avie_Pay_Details p { margin: 2px 0; font-size: 12px; color: #444; }

.Avie_Invoice_Totals { min-width: 200px; }
.Avie_Invoice_Totals .row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 13px; }
.Avie_Invoice_Totals .total-row { font-weight: bold; font-size: 15px; border-top: 1px solid #ccc; padding-top: 5px; margin-top: 5px; color: #1D7CF2; }




.AI_InputLocked {
    background-color: #f9f9f9 !important; /* Light Grey */
    color: #999 !important;
    cursor: wait !important; /* Shows 'Wait' hourglass/spinner cursor */
    border-color: #ddd !important;
}



/* Stand Alone Popup basics */
.AI_PanelsSA { position:absolute; left:10px; right:10px; top:15px;bottom:0px;  }
.AI_LeftPanel { position:absolute; left:0px; width:220px; top:0px; bottom:0px; overflow-y: auto; }
.AI_RightPanel { position:absolute; left:220px; right:0px; top:0px; bottom:0px;   }
.AI_ChatWrapper { border: 1px solid silver; position:absolute; left:10px; right:10px; top:35px;bottom:100px; overflow: hidden; padding: 5px; border-radius: 10px; }
.xAI_PromptPanel {position:absolute; left:10px; right:0px;bottom:10px; height:80px;}
.AI_ChatTitle { position: absolute; top: 7px; right: 0px; width: 80%; text-align: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; font-weight: 600; color: #444746; }


.AI_PromptPanel {
    position: absolute; 
    left: 10px; 
    right: 0px;
    bottom: 10px;        /* 1. Anchors to bottom */
    height: auto;        /* 2. Allows growing */
    min-height: 80px;    /* 3. Maintains default size */
    display: flex;       /* 4. Flexbox setup */
    flex-direction: column;
    justify-content: flex-end; /* 5. Forces content to sit at the bottom */
}

.savePanel_standalone {
    width: 100%;
    display: flex;
    align-items: flex-end; /* critical for upward expansion */
}


.AI_PrivacyLabel {
    width: 100%; /* Force it to span full width */
    text-align: center; /* Or 'right' depending on preference */
    font-size: 10px; /* Keep it subtle */
    color: #888;
    margin-top: 5px; /* Add the spacing here instead of using fn_CLEARING */
    margin-bottom: 2px;
    align-self: center; /* Ensures it sits in the middle of the cross axis */
    padding-left: 70px;
    padding-right: 70px;
    display: block;
    box-sizing: border-box;
    white-space: normal;
}





.AI_ThinkingText { 
    position: absolute; bottom: 80px; left: 50%; transform: translate(-50%, -50%);
    text-align: center; z-index: 9999;
    background-color: rgba(255, 255, 255, 0.95); color: #333;
    padding: 8px 25px; border-radius: 30px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); border: 1px solid #ddd;
    display: none; transition: opacity 0.3s ease;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: 350px; height: 12px; line-height: 12px;
}


.AutoMapHowToPopups {
    margin-left: 5px !important;
    line-height: 20px !important;
    color: #034af3;
    cursor: pointer;
}

    .AutoMapHowToPopups:hover {
        color: #ff6600;
    }



/* ==========================================================================
   STANDALONE CHAT HISTORY (Dynamic Height)
   ========================================================================== */
.AI_history_standalone {
    /* Layout: Fill the available vertical space completely */
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    /* Scrolling: Enable vertical scroll, hide horizontal */
    overflow-y: auto;
    overflow-x: hidden;
    /* Spacing: CRITICAL FIX BELOW */
    padding-left: 50px; /* Creates space for the user icons */
    padding-right: 5px;
    padding-bottom: 20px;
}

    /* Scrollbar styling (unchanged) */
    .AI_history_standalone::-webkit-scrollbar {
        width: 6px;
    }

    .AI_history_standalone::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .AI_history_standalone::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

        .AI_history_standalone::-webkit-scrollbar-thumb:hover {
            background: #888;
        }




/* ==========================================================================
   STANDALONE INPUT PANEL
   ========================================================================== */
.savePanel_standalone label{float:right;margin-left:6px;width:17%;max-width:60px;text-align:center;font-size:14px;}


/* ==========================================================================
   AVIE THINKING THROBBER (CORRECTED)
   ========================================================================== */

/* 1. Container Adjustments */
/* We DO NOT change 'position' here, so it keeps the 'absolute' 
   placement defined in your existing .AI_ThinkingText class. */

/* Thinking Indicator */
.avie_thinking_text {
    position: absolute; top: 22px; left: 50%; transform: translate(-50%, -50%);
    text-align: center; z-index: 9999;
    background-color: rgba(255, 255, 255, 0.95); color: #333;
    padding: 8px 25px; border-radius: 30px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); border: 1px solid #ddd;
    display: none; transition: opacity 0.3s ease;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: 350px; height: 12px; line-height: 12px; padding-left:30px;
}



    /* 2. The Spinner Icon */
    #avie_thinking_text::before {
        content: "\f1ce";   /* FontAwesome 'fa-circle-o-notch' */ 
        font-family: FontAwesome;
        /* Pin strictly to the left of the container */
        position: absolute;
        left: 10px;
        /* Vertically center the icon regardless of container height */
        top: 30%;
        transform: translateY(-50%);
        /* Animation & Style */
        -webkit-animation: fa-spin 1.5s infinite linear;
        animation: fa-spin 1.5s infinite linear;
        color: #007bff;
        font-size: 1.2em;
    }











    /* ==========================================================================
   AVIE MODAL DIALOGUES (Supplier Mismatch)
   ========================================================================== */

/* The dark background overlay */
.avie-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: avieFadeIn 0.3s forwards;
}

/* The white content box */
.avie-modal-box {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: scale(0.9);
    animation: avieScaleIn 0.3s forwards;
}

/* Typography */
.avie-modal-title {
    color: #d9534f; /* Warning Red */
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}
.avie-modal-icon {
    font-size: 40px;
    color: #d9534f;
    margin-bottom: 15px;
    display: block;
}
.avie-modal-text {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* Buttons Container */
.avie-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.avie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.avie-btn-fix {
    background-color: #0275d8; /* Primary Blue */
    color: white;
}
.avie-btn-fix:hover { background-color: #025aa5; }

.avie-btn-proceed {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}
.avie-btn-proceed:hover { background-color: #e0e0e0; }

.avie-btn-cancel {
    background: transparent;
    color: #999;
    text-decoration: underline;
}
.avie-btn-cancel:hover { color: #555; }

/* Animations */
@keyframes avieFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes avieScaleIn { from { transform: scale(0.9); } to { transform: scale(1); } }
































/* ==========================================================================
   RESPONSIVE LAYOUT (Mobile / Small Screens)
   ========================================================================== */
@media screen and (max-width: 600px) {

    /* 1. Hide the Left Hand Menu */
    .AI_LeftPanel {
        display: none !important;
    }

    /* 2. Force the Right Panel to fill the entire screen */
    .AI_RightPanel {
        left: 0px !important; /* Reset the left offset (was likely 250px or 280px) */
        width: 100% !important; /* Ensure it claims the full width */
    }

    /* 3. Optional: Adjust the inner chat wrapper if it has margins */
    .AI_ChatWrapper {
        left: 0px !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   MOBILE MENU & RESPONSIVENESS
   ========================================================================== */

/* Default: Toggle is hidden on desktop */
#Avie_MobileToggle {
    display: none;
}

/* Mobile Rules */
@media screen and (max-width: 600px) {

    /* 0. Hide certain single elements */
     .AI_HideOnMob { display:none;}


    /* 1. Show the Toggle Button */
    #Avie_MobileToggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 20000; /* Above everything */
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 8px 12px;
        cursor: pointer;
        font-size: 18px;
        color: #555;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    #Avie_MobileToggle:active {
        background-color: #f0f0f0;
    }

    /* 2. Hide Left Panel by default */
    .AI_LeftPanel {
        display: none; 
        /* We remove !important here so the .show-mobile class can override it */
    }

    /* 3. The "Open" State (Floating Drawer) */
    .AI_LeftPanel.show-mobile {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 260px; /* Adjust to match your design */
        z-index: 10000;
        background-color: #fff;
        box-shadow: 2px 0 15px rgba(0,0,0,0.3);
        overflow-y: auto;
        animation: slideIn 0.3s ease-out;
    }

    /* 4. Force Right Panel to full width */
    .AI_RightPanel {
        left: 0px !important;
        width: 100% !important;
    }
}

/* Simple Slide Animation */
@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}





/* The Trigger Button (Bottom RH Corner) */
.AI_ModeToggle {
    position: absolute;
    right: 0px;
    bottom: 0px;
    cursor: pointer;
    background-color: #f0f4f9;
    color: #444746;
    border: 1px solid #c7c7c7;
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 600;
    user-select: none;
    transition: background 0.2s;
    line-height: 14px;z-index:4000;
}

.AI_ModeToggle:hover {
    background-color: #e0e5ec;
    border-color: #999;
    color: #1f1f1f;
}

/* The Selection Panel (Popup) */
.AI_ModeSelector {
    display: none; /* Hidden by default */
    position: absolute;
    bottom: 25px; /* Sits just above the trigger button */
    right: 0px;
    width: 220px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    text-align: left;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Individual Options */
.AI_ModeOption {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background 0.1s;
}

.AI_ModeOption:last-child {
    border-bottom: none;
}

.AI_ModeOption:hover {
    background-color: #f5f8fd;
}

.AI_ModeOption.selected {
    background-color: #e8f0fe;
    border-left: 3px solid #1a73e8;
}

.AI_ModeOption strong {
    display: block;
    font-size: 13px;
    color: #202124;
    margin-bottom: 2px;
}

.AI_ModeOption span {
    display: block;
    font-size: 11px;
    color: #5f6368;
    line-height: 1.3;
}





















/* --- New Intro Screen Styles --- */
.AI_Intro {
    display: flex;
    flex-direction: column;
    padding: 0px;
    background: #fff; /* Clean white background */
    overflow-y: auto; /* Allow scrolling if list gets long */
}

.Intro_Header {
    text-align: center;
    margin-bottom: 20px;
}

    .Intro_Header h2 {
        color: #444746;
        font-size: 22px;
        margin-bottom: 5px;
    }

    .Intro_Header p {
        color: #5f6368;
        font-size: 13px;
        margin: 0;
    }

/* Feature Grid */
.Intro_Grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.Intro_Card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: default;
    transition: transform 0.1s, box-shadow 0.1s;
}

    .Intro_Card:hover {
        background: #f0f4f9;
        border-color: #4F81BD;
    }

.Intro_Icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.Intro_Title {
    font-weight: 600;
    color: #1f1f1f;
    font-size: 13px;
    display: block;
}

.Intro_Desc {
    font-size: 11px;
    color: #757575;
    margin-top: 4px;
    display: block;
    line-height: 1.4;
}

/* Section Label */
.Intro_Label {
    font-size: 11px;
    font-weight: 700;
    color: #9aa0a6;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* Examples (Styled better than before) */
.Intro_QuickPrompts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.Intro_Prompt {
    background: white;
    border: 1px solid #dadce0;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 12px;
    color: #3c4043;
    cursor: pointer;
    text-align: left;
    position: relative;
}

    .Intro_Prompt:hover {
        background: #f1f3f4;
        color: #1a73e8;
    }

    .Intro_Prompt:after {
        content: '→';
        position: absolute;
        right: 15px;
        color: #bdc1c6;
    }


    .CreatePO{position:absolute;top:13px;right:32px;font-size:14px; padding:5px 10px 5px 10px;border:1px solid #28a745;border-radius: 2px;cursor:pointer;background-color:#28a745;color:white;}
        .CreatePO:hover {background-color: #218838;color: white;border-color: #1e7e34;}