/* ============================== */
/*    Assistant IA Panel          */
/* ============================== */
:root {
    --Brain-Degraded : linear-gradient(99deg, #FF6450 -1.03%, #FF95B7 29%, #4D56D1 65.19%, #63E0DD 97.81%);  
    --Spacing-S-20 : 25px;
    --ia-primary: #3D64ED;
    --ia-primary-light: #3D64ED1A;
    --ia-primary-hover: #2B4FD4;
    --ia-primary-soft: #EEF1FD;

    --ia-bg: #FFFFFF;
    --ia-bg-subtle: #F7F8FA;
    --ia-border: #E4E7EC;
    --ia-border-light: #F0F1F4;
    --ia-text-primary: #1A1D26;
    --ia-text-secondary: #6B7280;
    --ia-text-muted: #9CA3AF;

    --ia-star-color: #F59E0B;

    --ia-space-xs: 4px;
    --ia-space-sm: 8px;
    --ia-space-md: 12px;
    --ia-space-lg: 16px;
    --ia-space-xl: 20px;
    --ia-space-2xl: 24px;

    --ia-radius-sm: 6px;
    --ia-radius-md: 8px;
    --ia-radius-lg: 12px;
    --ia-radius-xl: 16px;

    --ia-transition-fast: 150ms ease;
    --ia-transition-normal: 250ms ease;
    --ia-transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --ia-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --ia-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --ia-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --ia-shadow-dropdown: 0 10px 40px rgba(61, 100, 237, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);

}

.ia-assistant-right-panel {
  width: 0%;
  height: 100%;
  border-left: 1px solid #e0e0e0;
  box-shadow: -1px 0 4px rgba(0, 0, 0, 0.04);
  background-color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0%;
  transition: flex-basis 0.3s ease;
}

.ia-assistant-header-container {
	position: relative;
	padding: 10px 20px;
	font-weight: bold;
	font-size: 14px;
	min-height: 25px;
}

.ia-assistant-footer {
	display: flex;
	padding: 5px 5px;
	border-top: 1px solid #eee;
	width: 83%;
	left: 8px;
    top: calc(100vh - 162px) !important;
    .x-box-inner{
        height: 124px !important;
    }
}


.ia-assistant-collapsed {
  width: 0 !important;
  padding: 0 !important;
  border: none;
  overflow: hidden;
}

.ia-assistant-importbtn {
	display: flex;
	padding: 0px var(--Spacing-S-12, 12px);
	align-items: center;
	gap: 4px;
	border-radius: 8px;
	border: 1px solid var(--Primary-Primary-80, #304287) !important;
	background: var(--Neutral-Neutral-00, #FFF);
	color: var(--Primary-Primary-80, #304287);
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 700;
	line-height: 20px; /* 142.857% */
}

.ia-assistant-resizer {
	width: 5px;
	cursor: col-resize;
	background: #ccc;
}


.ia-assistant-panel-wrapper {
	display: flex;
	padding: 10px; 
	height: 100%;
	flex-direction: column;
	background: white;
	font-family: 'Inter', sans-serif;
}

.ia-assistant-panel-wrapper .x-box-inner {
	/*    width: 90%; */
	/*    height: 40%; */
	overflow: visible !important;
}

.ia-assistant-footer .x-box-inner {
	border: solid 1px;
	border-radius: 5px;
}

.ia-assistant-footer .ia-assistant-inputarea {
	padding: 2px 2px 2px 2px;
	width: 100% !important;
	height: 70% !important;
}

.ia-assistant-footer .ls-assist-ia-importbtn-container {
	padding-left: 8px;
	top: 60% !important;
	width: 98% !important;
	height: 30% !important;
	display: flex;       
	justify-content: space-between;
	align-items: center; 
}

.ia-assistant-footer .ia-assistant-inputarea > textarea {
	width: 95% !important;
	border: none;
	outline: none;
}

.ia-assistant-header-title {
	color: #222;
}

.ia-assistant-header-bar {
	height: 3px;
	background: linear-gradient(to right, #ec4899, #8b5cf6, #06b6d4);
	border-radius: 2px;
	margin-top: 5px;
}

.ia-assistant-right-panel .ia-assistant-dragndroparea {
	width: 100%;
	height: 100% ;
/* 	top: 5px !important; */
/* 	left: 0px !important; */
	position: absolute !important;
	z-index: 9998; 
    background-color: rgba(0, 0, 255, 0.1);
}

.ia-assistant-footer .ia-assistant-info-message { 
	position: absolute !important;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background-color: #2f5bea;
	color: white;
	padding: 8px 16px;
	border-radius: 8px;
	font-weight: bold;
	text-align: center;
	margin: 0 auto;
	z-index: 9999;
	box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
	animation: fadeOut 3s forwards;
}

.disclaimer-panel {
    position: relative;
    text-align: center;
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-style: normal;
    font-weight: normal;
    height: 20px;
    margin-top: -5px !important;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

.ia-assistant-HoveredBackgroundStyle {
	 background-color: #3D64ED33;
}

.ia-assistant-scenario-header {
    padding: 10px;
    width: 100%;
    flex: 0 0 auto !important;
}

.ia-assistant-body-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  height: 100%;
  width: 100%;
  overflow-y: auto;
   flex: 1 1 auto; 
  overflow: auto;
}



/* When header has dropdown, adjust body top - using !important to override inline style */
.ia-assistant-header-v2.ia-header-with-dropdown ~ .ia-assistant-body-scrollpanel,
.ia-header-with-dropdown + .ia-assistant-body-scrollpanel {
  top: 124px !important;
}

.ai-wrapped-field-with-submit {
    position: relative;
    .ai-wrapped-submit-button {
        position: absolute;
        button {
            position: relative;
            width: 32px;
        }
    }
    &.textarea-with-submit {
        .ai-wrapped-submit-button {
            bottom: 20px;
            button {
        		left: -26px;
    		}
        }
    }
    &.date-with-submit {
        .ai-wrapped-submit-button {
            button {
        		left: -20px;
    		}
        }
    }
    &.multilist-with-submit {
        .ai-wrapped-submit-button {
            bottom: 5px;
            button {
        		left: -24px;
        		bottom: -5px;
    		}
        }
    }
    &.checkbox-with-submit {
        .ai-wrapped-submit-button {
        	button {
        		left:300px;
        		bottom: 5px;
    		}
        }
    }
    &.number-with-submit {
        .ai-wrapped-submit-button {
        	button {
        		bottom: 5px;
        		left: -22px;
    		}
        }
    }
}

.ia-assistant-preconfigured-question-section {
    display: block;
}

.ia-assistant-preconfigured-question-wrapper {
    width: 90%;
    background: #DCE4FD;
    color: #000;
    padding: 8px 12px;
	word-wrap: break-word;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
    display: flex;
	border-radius: 4px;
    margin: 10px 0px !important;
	&:last-child {
        margin-bottom: 0px!important;
	}
    .ia-assistant-preconfigured-order {
        width: 26px;
        height: 26px;
        border: solid 2px #3CA7A2;
        color: #3CA7A2;
        text-align: center;
        align-self: center;
        p {
            margin-top: 3px;
            height: 14px;
            font-size: 16px;
            font-weight: bold;
            vertical-align: middle;
        }
    }
    .ia-assistant-preconfigured-question {
        width: calc(100% - 41px);
        margin-left: 8px;
    }
}

.ia-assistant-message-user, 
.ia-assistant-message-bot {
	color: #000;
	max-width: 75%;
	padding: 8px 12px;
	word-wrap: break-word;
	font-size: 14px;
	font-style: normal;
	font-weight: 500;
	line-height: 20px;
	border-radius: 8px;
	font-family: 'Inter', sans-serif;
	p {
	    font-size: 14px;
    	font-style: normal;
    	font-weight: 500;
        font-family: 'Inter', sans-serif;
	}
}

.ia-assistant-message-user {
  align-self: flex-end;
  clear: both;
  margin: 4px 14px 4px 50px;
  background: #DCE4FD;
}

.ia-assistant-message-bot {
  align-self: flex-start;
}

.ia-assistant-message-user-wrapper,
.ia-assistant-message-bot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ia-assistant-message-user-wrapper {
  align-items: flex-end;
}

.ia-assistant-message-bot-wrapper {
  align-items: flex-start;
  position: relative;
}

.ia-assistant-message-toolbar {
  display: none; /* hidden by default */
  gap: 8px;
  margin-top: 4px;
  padding-left: 8px;
}

.ia-assistant-message-bot-wrapper:hover .ia-assistant-message-toolbar {
  display: flex;
}

.ia-assistant-toolbar-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ia-assistant-toolbar-btn:hover {
  background: #f0f0f0;
}

.ia-assistant-toolbar-btn img {
  width: 16px;
  height: 16px;
  display: block;
}

.ia-assistant-action-button,
.ia-assistant-suggestion-button {
	display: flex;
	padding: 4px 8px;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 2px;
	border-radius: 4px;
	/* 	border: 1px solid var(--Brain-Degraded, #FF6450); */
	border: 1px solid;
	border-image: var(--Brain-Degraded) 1;
}

.ia-assistant-suggestion-button {
	align-self: flex-end;
	clear: both;
	margin: 4px 14px 4px 50px;
	border-radius: 8px;
}

.ia-assistant-suggestion-box {
    margin-top: 10px;
}

.ia-assistant-actions-header {
	color: #000;
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 500;
	line-height: 20px;
}

.ia-assistant-section-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ia-assistant-section-title img {
    width: 24px;
    height: 24px;
    display: block;  
    object-fit: contain; 
}

.ia-assistant-action-selected {
	min-height: 30px;
	width: 180px;
	color: white;
	display: flex;
	padding: 4px 8px;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 2px;
	border-radius: 4px;
	/* 	border: 1px solid; */
	/* 	border-image: var(--Brain-Degraded) 1; */
	background: var(--Brain-Degraded, linear-gradient(99deg, #FF6450 -1.03%, #FF95B7 29%
		, #4D56D1 65.19%, #63E0DD 97.81%));
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 700;
	line-height: 20px;
}

.ia-assistant-change-button {
	color: #304287;
	font-family: 'Inter', sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: 700;
	line-height: 18px; /* 150% */
}

.ia-assistant-quickaction-section {
	border-radius: 2px;
	border-bottom: 1px solid  #96ACF9;
	align-items: flex-start;
	flex-direction: column;
	gap: 8px;
}


.ia-assistant-scenario-header-row {
	padding-left: 32px;
	align-items: center;
	gap: 30px;
}

.ia-assistant-quickaction-section,
.ia-assistant-scenario-header-row {
	display: flex;
	min-width: 200px;
	padding: 16px 8px;
	align-self: stretch;
}

.ia-assistant-question {
    margin-bottom: 5px;
}

.ia-assistant-body-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.ia-assistant-welcome {
	display: flex;
	padding: 8px 4px;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 2px;
	align-self: stretch;
}

.ia-assistant-welcome-title {
	color: #000;
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 700;
	line-height: 24px; /* 150% */
}

.ia-assistant-welcome-message {
	color: #000;
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 500;
	line-height: 20px; /* 142.857% */
}

.ia-assistant-actions-change-selection {
	color: #304287;
	font-family: 'Inter', sans-serif;
	font-size: 12px;
	font-style: normal;
	font-weight: 700;
	line-height: 18px; 
}

.ia-assistant-display-visio-btn {
    display: inline-flex;
    padding: 8px 175px;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-radius: 8px;
    background: var(--Primary-Primary-80, #304287) !important;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background-color 0.2s ease;
    width: auto;       
    max-width: fit-content;
    
}

.ia-assistant-display-visio-btn:hover {
    background: var(--Primary-Primary-90, #3d52a0);
}

.ia-assistant-button-icon {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

.ia-assistant-button-label {
    color: white;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.ia-assistant-btn-disabled {
    background: var(--Primary-Primary-40, #b0b7d8);
    cursor: not-allowed;
    opacity: 0.6;
}

.ia-assistant-btn-disabled:hover {
    background: var(--Primary-Primary-40, #b0b7d8);
}


.uploaded-file-tag {
    background-color: #eeeeee;
    border-radius: 12px;
    padding: 6px 12px;
    margin: 5px 5px;
    width: 90%;
    display: flex;
    align-items: center;
}

.file-badge {
	background-color: #e14b4b;
    color: white;
    font-weight: bold;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-right: 8px;
}

.file-name {
	color: #000; 
    font-weight: normal;
	margin-right: 8px;
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-style: normal;
	line-height: 20px;
	text-decoration: none;
}

.file-name:hover {
   font-weight: bold;
}

.file-close-button {
    cursor: pointer;
    color: #888;
    font-weight: bold;
}

.file-close-button:hover {
    color: #e14b4b;
}

.file-left {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.rive-brain-container {
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 75px;
  background-color: transparent !important;
  position: relative;
}

.rive-brain-canvas {
  width: 150px;
  height: 150px;
  border-radius: 75px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  background-color: transparent !important;
}

.animation-overlay-style {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  background-color: transparent !important;
  z-index: 10000;
  justify-content: center;
  align-items: center;
}


.ls-wizard-toolbar {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  padding: 0 16px;
}

.preview-cancel-btn {
  display: inline-flex;
  justify-content: left;
  align-items: left;
  height: 30px;
  padding: 0; 
  background-color: white;
  line-height: 0;
}

.preview-cancel-btn button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 1px solid rgba(48, 66, 135, 1) !important;
  background-color: white;
  border-radius: 8px;
  width: fit-content;               
  line-height: 0;     
  padding: 0;
  width: 80% !important;
  margin-top: 2px;
  color: rgba(48, 66, 135, 1) !important;
}

.preview-cancel-btn button span {
  line-height: 1;
}

.ai-preview-download-btn {
  display: flex;              
  justify-content: flex-end; 
  align-items: center;  
  padding: 1px 1px 1px 1px;
}

.ai-preview-download-btn button{
  	width: 80% !important;
	height: 100% !important; 
	padding : 0px 0px 0px 0px;
	background-color: rgba(48, 66, 135, 1) !important;
	border-width: 1px !important;
    border-style: solid !important;
    border-image: initial !important;
    border-radius: 8px;
    margin-top: 2px;
}

.ai-preview-download-btn button .halflings {
    margin-right: 5px;
}

.softlaw-container .softlaw-fieldsets-container .ls-duration-field .duration-subfield input[type="text"]{
	width: 65px !important;
}

.ia-assistant-disabled-action {
    opacity: 0.5;
    pointer-events: none;
}

.ia-assistant-message-bot.loading-message::before {
    content: "⏳";
    margin-right: 8px;
    display: inline-block;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}


/* ==========================================================================
   1. HEADER V2 — with Actions button
   ========================================================================== */

.ia-assistant-header-v2 {
    display: flex;
    flex-direction: column;
    padding: var(--ia-space-md) var(--ia-space-lg);
    background: var(--ia-bg);
    border-bottom: 1px solid var(--ia-border);
    flex-shrink: 0;
    height: auto;
    min-height: auto;
}

.ia-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.ia-header-title-area {
    flex: 1;
    min-width: 0;
}

.ia-header-left-area {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: var(--ia-space-sm);
    min-width: 0;
}

.ia-header-left-area > * {
    display: inline-flex !important;
    align-items: center;
}

.ia-header-left {
    display: flex;
    align-items: center;
    gap: var(--ia-space-sm);
}

.ia-header-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.ia-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ia-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions trigger button */
.ia-header-right-area {
    display: flex;
    align-items: center;
    gap: var(--ia-space-sm);
    flex-shrink: 0;
}

.ia-header-actions-trigger {
    flex-shrink: 0;
    cursor: pointer;
}

/* Close button (×) */
.ia-header-close-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--ia-radius-sm);
    transition: background var(--ia-transition-fast);
    flex-shrink: 0;
}

.ia-header-close-btn:hover {
    background: var(--ia-bg-subtle);
}

.ia-header-close-icon {
    font-size: 20px;
    color: var(--ia-text-muted);
    line-height: 1;
    transition: color var(--ia-transition-fast);
}

.ia-header-close-btn:hover .ia-header-close-icon {
    color: var(--ia-text-primary);
}


/* ---- Action Row ---- */
.ia-action-row {
    cursor: pointer;
    padding: 0 var(--ia-space-sm);
    transition: background var(--ia-transition-fast);
    border-radius: var(--ia-radius-sm);
    margin: 1px 0;
}

.ia-action-row:hover {
    background: var(--ia-primary-soft);
}

.ia-action-row:active {
    background: var(--ia-primary-light);
}

.ia-action-row-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ia-space-sm) var(--ia-space-sm);
    min-height: 40px;
}

.ia-action-row-left {
    display: flex;
    align-items: center;
    gap: var(--ia-space-sm);
    flex: 1;
    min-width: 0;
}

.ia-action-row-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.ia-action-row-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ia-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-action-row-star {
    color: var(--ia-star-color);
    font-size: 14px;
    flex-shrink: 0;
    margin-left: var(--ia-space-xs);
}

.ia-action-row-chevron {
    font-size: 16px;
    color: var(--ia-text-muted);
    flex-shrink: 0;
    margin-left: var(--ia-space-sm);
    transition: transform var(--ia-transition-fast);
}

.ia-action-row:hover .ia-action-row-chevron {
    color: var(--ia-primary);
    transform: translateX(2px);
}

/* Disabled state */
.ia-action-row-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.ia-action-row-disabled:hover {
    background: transparent;
}


/* ==========================================================================
   3. TAB BAR
   ========================================================================== */

.ia-assistant-tab-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 var(--ia-space-lg);
    margin: var(--ia-space-md) 0 0 0;
    border-bottom: 2px solid var(--ia-border);
    background: transparent;
    flex-shrink: 0;
}

.ia-assistant-tab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ia-space-sm) var(--ia-space-lg);
    cursor: pointer;
    border: none;
    background: transparent;
    position: relative;
    transition: color var(--ia-transition-fast);
    user-select: none;
    -webkit-user-select: none;
}

.ia-assistant-tab-button .ia-tab-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ia-text-secondary);
    letter-spacing: 0.01em;
    transition: color var(--ia-transition-fast);
}

/* Tab count badge (hidden by default) */
.ia-tab-count {
    display: none;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: var(--ia-primary, #304287);
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.ia-tab-count-visible {
    display: inline-block;
}

.ia-assistant-tab-button:hover .ia-tab-label {
    color: var(--ia-text-primary);
}

.ia-assistant-tab-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: var(--ia-space-sm);
    right: var(--ia-space-sm);
    height: 2px;
    background: transparent;
    border-radius: 2px 2px 0 0;
    transition: background var(--ia-transition-normal);
}

.ia-assistant-tab-button.ia-tab-active .ia-tab-label {
    color: var(--ia-primary);
    font-weight: 600;
}

.ia-assistant-tab-button.ia-tab-active::after {
    background: var(--ia-primary);
}

.ia-assistant-tab-button:hover {
    background: var(--ia-primary-light);
    border-radius: var(--ia-radius-sm) var(--ia-radius-sm) 0 0;
}


/* ==========================================================================
   4. TAB CONTENT
   ========================================================================== */

.ia-tab-content {
    min-height: 0;
    flex: 1;
}

.ia-tab-content-chat {
    display: block;
}

.ia-tab-content-history {
    display: block;
}


/* ==========================================================================
   5. HISTORY PANEL
   ========================================================================== */

.ia-history-panel {
    padding: var(--ia-space-md);
}

.ia-history-empty-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ia-space-2xl) var(--ia-space-lg);
}

.ia-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--ia-space-sm);
}

.ia-history-empty-icon {
    width: 40px;
    height: 40px;
    opacity: 0.3;
    margin-bottom: var(--ia-space-sm);
}

.ia-history-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ia-text-secondary);
}

.ia-history-empty-subtitle {
    font-size: 12px;
    color: var(--ia-text-muted);
    max-width: 200px;
    line-height: 1.4;
}

.ia-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--ia-space-xs);
}

.ia-history-entry {
    border-radius: var(--ia-radius-md);
    padding: var(--ia-space-md) var(--ia-space-lg);
    cursor: pointer;
    transition: background var(--ia-transition-fast);
    border: 1px solid transparent;
}

.ia-history-entry:hover {
    background: var(--ia-bg-subtle);
    border-color: var(--ia-border-light);
}

.ia-history-entry:active {
    background: var(--ia-primary-light);
}

.ia-history-entry-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ia-space-md);
}

.ia-history-entry-content {
    flex: 1;
    min-width: 0;
}

.ia-history-entry-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ia-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.ia-history-entry-subtitle {
    font-size: 12px;
    color: var(--ia-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-history-entry-time {
    font-size: 11px;
    color: var(--ia-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}

/* History entry with PDF button - flex row layout */
.ia-history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ia-history-entry-clickable {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* PDF Export Button */
.ia-history-pdf-btn-container {
    flex-shrink: 0;
    margin-left: var(--ia-space-sm, 8px);
}

.ia-history-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ia-radius-md, 8px);
    background: transparent;
    color: var(--ia-text-secondary, #666);
    cursor: pointer;
    transition: all var(--ia-transition-fast, 0.15s ease);
}

.ia-history-pdf-btn:hover {
    background: var(--ia-primary-light, #e8edff);
    color: var(--ia-primary, #304287);
}

.ia-history-pdf-btn:active {
    background: var(--ia-primary, #304287);
    color: white;
}

.ia-history-pdf-btn svg {
    width: 16px;
    height: 16px;
}




/* ==========================================================================
   6. LAYOUT REFINEMENTS
   ========================================================================== */

/* Body main container needs position:relative for the dropdown overlay */
.ia-assistant-body-main {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    position: relative;
}

.ia-assistant-welcome {
    padding: var(--ia-space-xl) var(--ia-space-lg) var(--ia-space-md);
}

.ia-assistant-welcome-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ia-text-primary);
    margin-bottom: var(--ia-space-xs);
    line-height: 1.3;
}

.ia-assistant-welcome-message {
    font-size: 13px;
    color: var(--ia-text-secondary);
    line-height: 1.5;
}

.ia-assistant-scenario-header {
    padding: var(--ia-space-xs) var(--ia-space-md);
    flex-shrink: 0;
}

.ia-assistant-body-scrollpanel {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.ia-assistant-body-container {
    padding: var(--ia-space-sm) 0;
}


/* ==========================================================================
   7. ANIMATIONS
   ========================================================================== */

.ia-tab-content-chat,
.ia-tab-content-history {
    animation: iaTabFadeIn var(--ia-transition-smooth) forwards;
}

@keyframes iaTabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ia-history-entry {
    animation: iaHistoryEntryIn var(--ia-transition-smooth) forwards;
    opacity: 0;
}

.ia-history-entry:nth-child(1) { animation-delay: 0ms; }
.ia-history-entry:nth-child(2) { animation-delay: 40ms; }
.ia-history-entry:nth-child(3) { animation-delay: 80ms; }
.ia-history-entry:nth-child(4) { animation-delay: 120ms; }
.ia-history-entry:nth-child(5) { animation-delay: 160ms; }

@keyframes iaHistoryEntryIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Action row stagger animation */
.ia-action-row {
    animation: iaActionRowIn var(--ia-transition-fast) forwards;
    opacity: 0;
}

.ia-action-row:nth-child(2) { animation-delay: 20ms; }
.ia-action-row:nth-child(3) { animation-delay: 40ms; }
.ia-action-row:nth-child(4) { animation-delay: 60ms; }
.ia-action-row:nth-child(5) { animation-delay: 80ms; }
.ia-action-row:nth-child(6) { animation-delay: 100ms; }
.ia-action-row:nth-child(7) { animation-delay: 120ms; }

@keyframes iaActionRowIn {
    from { opacity: 0; transform: translateX(4px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

/* /* Dropdown container (Tâches d'extraction) — now positioned under header */ */
/* .ia-assistant-dropdown-container { */
/*     border-bottom: 1px solid var(--ia-border-light); */
/*     width: calc(100% + 2px); */
/*     height: auto; */
/*     min-height: 0; */
/*     margin-left: -1px; */
/* } */

/* /* Extraction task dropdown - match parent height */ */
/* .extraction-task-dropdown { */
/*     height: 100% !important; */
/*     width: calc(100% + 2px); */
/* } */

/* /* Extraction dropdown: hide list container when not expanded */ */
/* .extraction-task-dropdown .extraction-dropdown-list-container { */
/*     display: none; */
/*     max-height: 0; */
/*     overflow: hidden; */
/* } */

/* .extraction-task-dropdown.expanded .extraction-dropdown-list-container { */
/*     display: block; */
/*     max-height: 300px; */
/*     overflow-y: auto; */
/* } */

/* @media (max-width: 380px) { */
/* /*     .ia-action-dropdown { */ */
/* /*         width: 280px; */ */
/* /*         right: var(--ia-space-sm); */ */
/* /*     } */ */

/* /*     .ia-header-actions-label { */ */
/* /*         display: none; */ */
/* /*     } */ */

/*     .ia-assistant-tab-bar { */
/*         padding: 0 var(--ia-space-sm); */
/*     } */

/*     .ia-assistant-tab-button { */
/*         padding: var(--ia-space-xs) var(--ia-space-sm); */
/*     } */
/* } */


/* Container list */
.ia-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 6px;
}

/* Card */
.ia-history-card {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

/* Clickable zone (hover) */
.ia-history-card-clickable {
  padding: 12px 12px 10px 12px;
  cursor: pointer;
}

.ia-history-card:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
  border-color: rgba(15, 23, 42, 0.18);
}

.ia-history-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ia-history-card-title {
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
}

.ia-history-card-time {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.ia-history-card-body {
  margin-top: 6px;
}

.ia-history-card-subtitle {
  font-size: 12px;
  color: #475569;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;   /* 2 lignes max */
  -webkit-box-orient: vertical;
}

/* File link in subtitle */
.ia-history-file-link {
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}

.ia-history-file-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* Footer actions */
.ia-history-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.6);
}

.ia-history-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #334155;
  background: rgba(59, 130, 246, 0.10);
  padding: 4px 8px;
  border-radius: 999px;
}

.ia-history-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ia-history-card-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  cursor: pointer;
}

.ia-history-card-btn--icon {
  width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ia-history-card-btn:hover {
  border-color: rgba(15, 23, 42, 0.22);
  background: rgba(248, 250, 252, 0.9);
}

.ia-assistant-header-v2{
  position: relative;
  overflow: visible;
}

.ia-assistant-header-v2::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--Brain-Degraded);
}

/* =========================================================
   IA Assistant - Historique (LegalSuite style)
   Add this block to your assistant history stylesheet
   ========================================================= */

/* Panel spacing */
.ia-history-panel{
  padding: 10px 12px;
}

/* Header row */
.ia-history-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 8px;
}

/* "Supprimer tout" button */
.ia-history-delete-all-wrap {
  display: flex;
  align-items: center;
}

.ia-history-delete-all-btn {
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: background .15s ease, color .15s ease;
}

.ia-history-delete-all-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.ia-history-delete-all-btn svg {
  width: 14px;
  height: 14px;
}

.ia-history-delete-all-btn:hover svg {
  color: #dc2626;
}

.ia-history-delete-all-btn:focus {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

/* List */
.ia-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 16px;
}

/* Card */
.ia-history-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
  margin-bottom: 12px;
}

.ia-history-card:hover {
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.08);
  border-color: #d1d5db;
}

/* Clickable top area */
.ia-history-card-clickable {
  padding: 14px 16px 10px;
  cursor: default;
}

.ia-history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ia-history-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ia-history-card-title {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.ia-history-card-time {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}

.ia-history-card-body {
  margin-top: 4px;
}

.ia-history-card-subtitle {
  font-size: 13px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer bar */
.ia-history-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
  background: #ffffff;
  gap: 8px;
}

/* Primary action buttons */
.ia-history-primary-wrap {
  display: inline-flex;
  align-items: center;
}

.ia-history-primary-btn{
  border: 1px solid #dbe2f5;
  background: #eef2ff;
  color: #2f3aa6;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.ia-history-primary-btn svg{
  opacity: .9;
}

.ia-history-primary-btn:hover{
  background: #e0e7ff;
  border-color: #c7d2fe;
  transform: translateY(-1px);
}


/* Secondary actions group (right) */
.ia-history-card-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  opacity: 0;
  transition: opacity .15s ease;
}

.ia-history-card:hover .ia-history-card-actions {
  opacity: 1;
}

/* Wrapper around icon buttons */
.ia-history-card-btn-wrap {
  display: inline-flex;
}

/* Icon buttons - neutral */
.ia-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.ia-icon-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Icon buttons - danger (delete) */
.ia-icon-btn-danger {
  border-color: #fecaca;
}

.ia-icon-btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Accessibility focus */
.ia-history-card-clickable:focus,
.ia-icon-btn:focus,
.ia-history-primary-btn:focus {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

/* Empty / loading blocks */
.ia-history-loading-container,
.ia-history-empty-container {
  margin-top: 12px;
}

/* Textarea assistant: auto-grow, puis scroll */
.ia-assistant-footer .ia-assistant-inputarea textarea.x-form-textarea{
  height: auto !important;
  min-height: 44px;
  max-height: 140px;     /* ajuste: 120/140/160 */
  overflow-y: auto !important;
  resize: none;          /* évite le resize manuel moche */
  line-height: 18px;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Optionnel: éviter le scroll horizontal (si un mot très long) */
.ia-assistant-footer .ia-assistant-inputarea textarea.x-form-textarea{
  overflow-x: hidden;
}

/* Capsule container */
.ia-header-view-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9dbe7;
  border-radius: 12px;
  padding: 3px;
  background: #f7f8fc;
  gap: 4px;
}

/* Each segment */
.ia-header-view-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  color: #4a4f6a;
  font-weight: 600;
}

/* Active segment */
.ia-header-view-active {
  background: #304287; 
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(109, 94, 252, 0.25);
}

.ia-header-view-icon {
  font-size: 14px;
  line-height: 14px;
}

.ia-header-view-label {
  font-size: 13px;
}


/* 1) Empêche le scroll horizontal dans tout le panel */
.ia-assistant-right-panel,
.ia-assistant-panel-wrapper,
.ia-assistant-body-scrollpanel,
.ia-assistant-body-main {
  overflow-x: hidden !important;
}

/* 2) GXT met souvent des widths inline en px sur .x-box-inner → on force 100% */
.ia-assistant-right-panel .x-box-inner {
  width: 100% !important;
  max-width: 100% !important;
}

/* 3) Même idée sur les items */
.ia-assistant-right-panel .x-box-item {
  max-width: 100% !important;
}

/* 4) Important : les composants doivent compter padding/border dans la largeur */
.ia-assistant-right-panel,
.ia-assistant-right-panel * {
  box-sizing: border-box;
}

/* 5) Les textes très longs (sans espaces) peuvent créer un overflow */
.ia-assistant-message-user,
.ia-assistant-message-bot,
.ia-assistant-body-container {
  overflow-wrap: anywhere;   /* le plus robuste */
  word-break: break-word;
}

/* 6) Textarea + input zone : éviter le dépassement */
.ia-assistant-inputarea,
.ia-assistant-inputarea textarea {
  width: 100% !important;
  max-width: 100% !important;
}



/* =========================================================
   IA Cards — Premium / Preprod
   ========================================================= */

.ia-chat-actions-root{
  --ls-accent: #5b6cf8;
  --ls-text: #0f172a;
  --ls-muted: rgba(15,23,42,.62);
  --ls-border: rgba(15,23,42,.10);
  --ls-bg: #fff;
  --ls-soft: rgba(91,108,248,.07);

  --radius: 12px;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow-hover: 0 16px 38px rgba(15,23,42,.12);
  --ring: 0 0 0 3px rgba(91,108,248,.18);
}

/* Sections: plus net + ligne de séparation */
.ia-chat-actions-section__label{
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(15,23,42,.42);
  display:flex;
  align-items:center;
  gap:10px;
  margin: 14px 0 10px;
}
.ia-chat-actions-section__label::after{
  content:"";
  height:1px;
  flex:1;
  background: rgba(15,23,42,.08);
}

/* Grid: 4 colonnes en large, sinon 2 puis 1 */
.ia-chat-actions-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}
@media (max-width: 1100px){
  .ia-chat-actions-grid{ grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 640px){
  .ia-chat-actions-grid{ grid-template-columns: 1fr; }
}

/* Card */
.ia-chat-action-card{
  background: var(--ls-bg);
  border: 1px solid var(--ls-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  min-height: 84px;                /* hauteur homogène */
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

/* wash discret en haut (premium) */
.ia-chat-action-card::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(900px 240px at 18% 0%,
    rgba(91,108,248,.10) 0%,
    rgba(255,255,255,0) 55%);
  opacity:.55;
  pointer-events:none;
}

/* Chevron d'affordance - only in expanded mode */
.ia-chat-actions-grid--expanded .ia-chat-action-card::after{
  content:"›";
  position:absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: rgba(15,23,42,.30);
  transition: transform .14s ease, color .14s ease;
  pointer-events:none;
}

.ia-chat-action-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(91,108,248,.28);
  background: linear-gradient(0deg, var(--ls-soft), var(--ls-bg));
}
.ia-chat-actions-grid--expanded .ia-chat-action-card:hover::after{
  transform: translateY(-50%) translateX(2px);
  color: rgba(91,108,248,.9);
}
.ia-chat-action-card:active{
  transform: translateY(0) scale(.99);
  box-shadow: var(--shadow);
}

/* Focus clavier */
.ia-chat-action-card:focus,
.ia-chat-action-card:focus-within{
  outline: none;
  box-shadow: var(--shadow), var(--ring);
  border-color: rgba(91,108,248,.45);
}

/* Favorite : plus classe que border jaune fort */
.ia-chat-action-card--favorite{
  border-color: rgba(245,158,11,.35);
}
.ia-chat-action-card--favorite::before{
  background: radial-gradient(900px 240px at 18% 0%,
    rgba(245,158,11,.16) 0%,
    rgba(255,255,255,0) 55%);
}

/* Disabled */
.ia-chat-action-card--disabled{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
  filter: grayscale(.25);
}

/* Inner: layout pro → icône à gauche + texte */
.ia-chat-action-card__inner{
  display:grid;
  grid-template-columns: 50px 1fr;
  align-items:center;
  gap: 10px;
  padding: 14px 14px 14px 14px; /* place pour chevron */
  text-align:left;
}

/* Chip icône (fond) */
.ia-chat-action-card__top{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(91,108,248,.10);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
}

.ia-chat-action-card__icon{
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.ia-chat-action-card__monogram{
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(135deg, #5b6cf8, #8b5cf6);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:14px;
}

/* Badge étoile */
.ia-chat-action-card__star{
  position:absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(245,158,11,.95);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 10px;
  box-shadow: 0 8px 18px rgba(245,158,11,.22);
}

/* Label plus lisible */
.ia-chat-action-card__label{
  color: var(--ls-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
}

.ia-chat-action-card__desc{
  margin-top: 4px;
  font-size: 12px;
  color: var(--ls-muted);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Compact : densité un peu + forte */
@media (max-width: 720px){
  .ia-chat-action-card{ min-height: 78px; }
  .ia-chat-action-card__inner{ padding: 12px 40px 12px 12px; gap: 10px; }
  .ia-chat-action-card__top{ width: 40px; height: 40px; }
  .ia-chat-action-card__label{ font-size: 13px; }
}     

/* ****Container du bouton help ****/
.ia-tab-help-button{
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #d83a2e;              
  padding: 6px 10px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.ia-tab-help-button:hover{
  background-color: rgba(216, 58, 46, 0.08);
}

.ia-tab-help-button:active{
  background-color: rgba(216, 58, 46, 0.14);
}

.ia-tab-help-button:focus,
.ia-tab-help-button:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 58, 46, 0.18);
}

/* Icône ? */
.ia-tab-help-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background-color: #d83a2e;
}

/* ==========================================================================
   9. HISTORY PANEL FILTERS & BADGES
   ========================================================================== */

/* Filter row container */
.ia-history-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

/* Search container */
.ia-history-search-container {
  display: flex;
  align-items: center;
  width: 200px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ia-history-search-container:focus-within {
  border-color: #5b6cf8;
  box-shadow: 0 0 0 3px rgba(91, 108, 248, 0.12);
}

.ia-history-search-icon {
  font-size: 14px;
  margin-right: 6px;
  opacity: 0.5;
}

.ia-history-search-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  font-size: 13px;
  color: #1f2a44;
  padding: 2px 0 !important;
  box-shadow: none !important;
}

.ia-history-search-input::placeholder {
  color: #9ca3af;
}

/* Date filter dropdown */
.ia-history-date-filter {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #e6e9f2;
  border-radius: 8px;
  background: #fff;
  color: #1f2a44;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.ia-history-date-filter:hover {
  border-color: #d8deee;
}

.ia-history-date-filter:focus {
  border-color: #5b6cf8;
  box-shadow: 0 0 0 3px rgba(91, 108, 248, 0.12);
}

/* Card title row with badge */
.ia-history-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* Category badges */
.ia-history-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ia-badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.ia-badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
}

.ia-badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.ia-badge-orange {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
}

.ia-badge-teal {
  background: rgba(20, 184, 166, 0.15);
  color: #0d9488;
}

.ia-badge-pink {
  background: rgba(236, 72, 153, 0.15);
  color: #db2777;
}

.ia-badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.ia-badge-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
}

/* Delete button alignment in filter row */
.ia-history-filter-row .ia-history-delete-all-wrap {
  margin-left: auto;
  flex-shrink: 0;
}

/* ====== Main History Title Section ====== */
.ia-history-main-title {
  padding: 20px 16px 12px 16px;
}

.ia-history-main-title-text {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 2px;
}

.ia-history-main-subtitle {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

/* ====== Documents analysés banner section (History tab) ====== */
.ia-history-analyzed-docs-banner {
  background: #f8f5ff;
  border: 1px solid #e8e4f8;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 16px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ia-history-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ia-history-banner-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  border-radius: 8px;
}

.ia-history-banner-icon img,
.ia-history-banner-icon svg {
  width: 20px;
  height: 20px;
}

.ia-history-banner-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.ia-history-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.ia-history-banner-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.ia-history-banner-btn-wrap {
  align-self: flex-start;
}


.ia-history-banner-btn:hover .ia-history-banner-btn-arrow {
  transform: translateX(2px);
}

/* Section label */
.ia-history-section-label {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  padding: 0 16px 12px 16px;
}

/* ===================== Pagination ===================== */
.ia-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid #f3f4f6;
  background: #ffffff;
}

.ia-history-pagination-btn {
  border: none;
  background: transparent;
  color: #304287;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}

.ia-history-pagination-btn:hover:not([disabled]) {
  background: #f5f3ff;
  color: #304287;
}

.ia-history-pagination-btn[disabled] {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.5;
}

.ia-history-pagination-indicator {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

.ia-assistant-body-main {
    display: flex;
    flex-direction: column;
/*     height: 100%; */
    overflow: hidden;
}

.ia-assistant-tab-bar {
    flex-shrink: 0;
}

.ia-assistant-body-scrollpanel {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}


/* Mode Chat — laisse de la place pour le footer (input) */
.ia-assistant-body-scrollpanel {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: calc(100vh - 350px) !important;
    width: 100%;
}

/* Mode Historique — pas de footer, prend quasi toute la hauteur */
.ia-assistant-body-scrollpanel.ia-scroll-history-mode {
    height: calc(100vh - 180px) !important;
}


/* ============================================
   ASSISTANT IA — LAYOUT STRUCTURE
   Force CSS Flexbox over GXT VBoxLayout
   ============================================ */

/* Le right-panel lui-même */
.ia-assistant-right-panel {
    overflow: hidden !important;
}

/* Wrapper principal */
.ia-assistant-panel-wrapper {
    height: 100% !important;
    overflow: hidden !important;
}

/* CRITICAL: Override GXT's x-box-inner — c'est lui qui contrôle tout */
.ia-assistant-panel-wrapper > .x-box-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
}

/* CRITICAL: Kill GXT absolute positioning on ALL children */
.ia-assistant-panel-wrapper > .x-box-inner > .x-box-item {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
}

/* Header — taille auto */
.ia-assistant-panel-wrapper > .x-box-inner > .ia-assistant-header-v2 {
    flex-shrink: 0 !important;
    height: auto !important;
}

/* Body — prend TOUT l'espace restant, scrolle en interne */
.ia-assistant-panel-wrapper > .x-box-inner > .ia-assistant-body-main {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;   /* PAS de scroll ici — le scroll est dans innerScroll */
}

/* Footer — taille auto, ne shrink pas */
.ia-assistant-panel-wrapper > .x-box-inner > .ia-assistant-footer {
    flex-shrink: 0 !important;
    height: auto !important;
}

/* Disclaimer — taille auto, ne shrink pas */
.ia-assistant-panel-wrapper > .x-box-inner > .disclaimer-panel {
    flex-shrink: 0 !important;
    height: auto !important;
}


/* ============================================
   BODY — scroll interne uniquement
   ============================================ */
.ia-assistant-body-main {
    overflow: hidden !important;
}

/* L'outer wrapper prend toute la hauteur du body */
.ia-assistant-body-outer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Le tab bar est fixe en haut */
.ia-assistant-tab-bar {
    flex-shrink: 0;
}

/* Le scrollpanel interne prend le reste */
.ia-assistant-body-scrollpanel {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto !important;
}

/* Scrollbar fine */
.ia-assistant-body-scrollpanel::-webkit-scrollbar {
    width: 4px;
}
.ia-assistant-body-scrollpanel::-webkit-scrollbar-track {
    background: transparent;
}
.ia-assistant-body-scrollpanel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}


/* ============================================
   FOOTER
   ============================================ */
.ia-assistant-footer {
    padding: 8px 12px 4px 12px !important;
    background: transparent;
    box-sizing: border-box !important;
    width: 100% !important;
}


/* ============================================
   PILL WRAPPER
   ============================================ */
.ia-footer-input-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end;
    border: 1px solid #d0d0d0;
    border-radius: 16px;
    background: #ffffff;
    padding: 4px;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.ia-footer-input-wrapper:focus-within {
    border-color: #304287;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}


/* ============================================
   TEXTAREA — override GXT inline styles
   ============================================ */
.ia-footer-textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    height: auto !important;
}

.ia-footer-textarea textarea,
.ia-footer-textarea .x-form-field,
.ia-footer-textarea .x-form-textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    resize: none !important;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 12px !important;
    padding-right: 40px !important;
    margin: 0 !important;
    min-height: 40px;
    max-height: 200px;
    overflow-y: hidden;
    font-family: inherit;
    color: #1a1a1a;
}

.ia-footer-textarea textarea::placeholder,
.ia-footer-textarea .x-form-empty-field {
    color: #9ca3af !important;
    font-style: normal !important;
}

.ia-footer-textarea .x-form-text-wrap {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    width: 100% !important;
}

.ia-footer-textarea .x-form-focus {
    border: none !important;
    box-shadow: none !important;
}

.ia-footer-textarea .x-form-invalid {
    border: none !important;
    background: none !important;
}

/* Scrollbar fine sur textarea */
.ia-footer-textarea textarea::-webkit-scrollbar {
    width: 4px;
}
.ia-footer-textarea textarea::-webkit-scrollbar-track {
    background: transparent;
}
.ia-footer-textarea textarea::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Voice button */
.ia-footer-textarea .ls-textarea-voice-button {
    bottom: 8px !important;
    top: auto !important;
    right: 8px !important;
}


/* ============================================
   TOOLBAR
   ============================================ */
.ia-footer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-top: 1px solid #f0f0f0;
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.ia-footer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}


/* ============================================
   IMPORT BUTTON
   ============================================ */

.ia-footer-toolbar .ia-assistant-importbtn:hover {
    background: rgba(220, 228, 253, 1) !important;
}

.ia-footer-toolbar .ia-assistant-importbtn img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}


/* ============================================
   SEND BUTTON
   ============================================ */

.ia-footer-send-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 12px !important;
    border: none !important;
    background: #304287 !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(48, 66, 135, 0.3);
}

.ia-footer-send-btn:hover {
    background: #263670 !important;
    box-shadow: 0 4px 12px rgba(48, 66, 135, 0.45);
    transform: translateY(-1px);
}

.ia-footer-send-btn:active {
    transform: translateY(0px);
    box-shadow: 0 1px 4px rgba(48, 66, 135, 0.3);
}

/* Cacher l'image existante */
.ia-footer-send-btn img {
    display: none !important;
}

/* Flèche  — SVG inline via CSS */
.ia-footer-send-btn::after {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5'/%3E%3Cpath d='M5 12l7-7 7 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.ia-footer-send-btn:hover::after {
    transform: translateY(-2px);
}

.ia-footer-send-btn:disabled {
    background: #e5e7eb !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.ia-footer-send-btn:disabled::after {
    opacity: 0.4;
}

/* ============================================
   DISCLAIMER
   ============================================ */
.disclaimer-panel {
    text-align: center;
    padding: 4px 12px 8px 12px !important;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
}


.ia-assistant-inputarea {
    width: 100% !important;
    border: none !important;
}

.ls-assist-ia-importbtn-container {
    display: none !important;
}


/* Scrollbar plus large et facile à attraper dans le textarea */
.ia-footer-textarea textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(48, 66, 135, 0.3) transparent;
}

.ia-footer-textarea textarea::-webkit-scrollbar {
    width: 8px;
}

.ia-footer-textarea textarea::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.ia-footer-textarea textarea::-webkit-scrollbar-thumb {
    background: rgba(48, 66, 135, 0.25);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.ia-footer-textarea textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(48, 66, 135, 0.5);
    border: 1px solid transparent;
    background-clip: padding-box;
}

.ia-footer-textarea textarea::-webkit-scrollbar-thumb:active {
    background: rgba(48, 66, 135, 0.7);
}

.ia-assistant-body-scrollpanel {
    height: calc(100vh - 350px) !important;
}

/* Le wrapper implicite de GWT ScrollPanel */
.ia-assistant-body-main > div {
    height: 100%;
}

.ia-assistant-body-outer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ia-assistant-body-scrollpanel {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
}

/* ============================================================
   AssistantIaHistoryPanel — extracted from inline Java styles
   ============================================================ */


/* Section row: label on TOP, filters BELOW */
.ia-history-analyses-section-row {
    display: flex;
    flex-direction: column;       /* ← colonne au lieu de row */
    align-items: flex-start;      /* ← aligné à gauche */
    padding: 12px 16px;
    gap: 16px;                    /* ← espace entre le label et les filtres */
}

/* Left part: icon + title + description — inchangé */
.ia-history-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Filters: pleine largeur en dessous */
.ia-history-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;                  /* ← prend toute la largeur */
}