/* Reej AI Platform : thème Reej (couleurs de reej-consulting.com) et interface simplifiée pour les débutants.
 * Bleu nuit #071076 · indigo #4C4C9B · lavande #F3F3FB · cyan #65C3E0 · police Plus Jakarta Sans.
 * Chargé après la feuille de LibreChat. Un seul thème (clair) : il est imposé par reej-ui.js.
 * Les éléments masqués ici le sont pour la lisibilité, pas pour la sécurité (les droits restent ceux de LibreChat). */

/* Plus Jakarta Sans hébergée sur la plateforme (aucun appel à Google Fonts depuis le poste des salariés). */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/reej-fonts/jakarta-latin-ext-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/reej-fonts/jakarta-latin-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/reej-fonts/jakarta-latin-ext-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/reej-fonts/jakarta-latin-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== 1. Couleurs ============================================================================================= */
:root, .dark {
  /* Gamme de marque (remplace la gamme « green » de LibreChat) : 500 = indigo, 700 = bleu nuit. */
  --green-50: 243 243 251; --green-100: 230 230 245; --green-200: 204 204 232; --green-300: 165 165 210;
  --green-400: 120 120 180; --green-500: 76 76 155; --green-600: 44 46 138; --green-700: 7 16 118;
  --green-800: 5 12 92; --green-900: 4 9 70; --green-950: 3 6 48;
  /* Gris teintés de bleu nuit. */
  --gray-20: 238 238 246; --gray-50: 247 247 252; --gray-100: 238 238 247; --gray-200: 226 226 240;
  --gray-300: 204 204 224; --gray-400: 150 150 178; --gray-500: 92 93 122; --gray-600: 68 69 98;
  --gray-650: 56 57 88; --gray-700: 44 45 76; --gray-800: 30 31 60; --gray-850: 22 23 48;
  --gray-875: 17 18 40; --gray-900: 12 13 32;
  --theme-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --surface-primary-alt: 243 243 251;
  --surface-submit: var(--green-700); --surface-submit-hover: var(--green-800);
  --accent-primary: 76 76 155; --accent-primary-hover: 7 16 118;
  --ring-primary: 76 76 155;
  --status-success: 22 163 74; --status-success-subtle: 240 253 244; --status-success-border: 134 239 172;
  color-scheme: light;
}

/* ===== 2. Typographie ========================================================================================== */
html, body, .font-sans, button, input, textarea, select { font-family: var(--theme-font-family); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01"; }
.markdown, .prose { font-size: 15.5px; line-height: 1.7; }
.markdown h1, .markdown h2, .markdown h3, .prose h1, .prose h2, .prose h3 { font-weight: 700; letter-spacing: -0.015em; color: #071076; }
.markdown a, .prose a { color: #4c4c9b; text-underline-offset: 3px; }
::selection { background: rgb(204 204 232); }

/* Filet de marque en haut de l'écran. */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 9999; pointer-events: none;
  background: linear-gradient(90deg, #071076, #4c4c9b 55%, #65c3e0);
}

/* ===== 3. Simplification : ce qu'un débutant n'a pas besoin de voir ============================================ */
/* Thème : un seul. */
[aria-label="Changer de thème"], [aria-label="Toggle high contrast"],
[data-testid="theme-selector"], div:has(> #theme-selector-label),
/* Barre de gauche : Skills, Prompts, Mémoire et Favoris retirés (Mémoire et Favoris aussi désactivés dans librechat.yaml). */
[data-testid="nav-panel-skills"], [data-testid="nav-panel-prompts"], [data-testid="nav-panel-memories"],
[data-testid="nav-panel-bookmarks"],
/* En-tête : mode éphémère et signets. */
[aria-label="Message éphémère"], [data-testid="bookmark-menu"],
/* Zone de saisie : menu d'outils, badge Artefacts (toujours actifs), compteur de tokens. */
#tools-dropdown-button, div.flex:has(> button[aria-label="Artefacts"]):not(.flex-wrap), [data-testid="token-usage"],
/* Messages : navigation latérale, branche (« fork »), lecture à voix haute. */
[aria-label="Ouvrir le menu de fork"], [aria-label="Lire à haute voix"]
{ display: none !important; }

/* ===== 4. Barre de gauche ====================================================================================== */
/* Icônes à leur taille d'origine : la largeur totale du volet est fixe, élargir la barre rognerait la liste. */
.border-r:has([data-testid="nav-panel-conversations"]) {
  --surface-active: 255 255 255; --surface-active-alt: 255 255 255; --surface-hover: 255 255 255;
}
aside:has([data-testid="nav-panel-conversations"]) {
  --surface-active-alt: 255 255 255; --surface-hover: 255 255 255; --surface-active: 255 255 255;
}
/* Libellés sous les icônes : la barre passe de 53 à 85 px. Le volet (360 px fixés par LibreChat) est élargi d'autant,
   sinon la liste des conversations serait rognée à droite. Volet replié (52 px) : élargi à 85 px pour la même raison. */
aside[style*="width: 360px"] { width: 392px !important; min-width: 392px !important; }
aside[style*="width: 52px"] { width: 85px !important; min-width: 85px !important; max-width: 85px !important; }
.border-r:has([data-testid="nav-panel-conversations"]) { align-items: center; }
[data-testid="new-chat-button"], [data-testid="nav-agents-marketplace-button"], [data-testid^="nav-panel-"] {
  width: 68px !important; height: auto !important; min-height: 48px;
  flex-direction: column !important; justify-content: center !important; gap: 3px !important;
  padding: 6px 2px !important; border-radius: 10px !important;
}
[data-testid="new-chat-button"]::after, [data-testid="nav-agents-marketplace-button"]::after, [data-testid^="nav-panel-"]::after {
  font-size: 10.5px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; white-space: pre-line; text-align: center;
  color: rgb(var(--text-secondary));
}
[data-testid="new-chat-button"]::after { content: "Nouvelle\A discussion"; }
[data-testid="nav-agents-marketplace-button"]::after { content: "Assistants"; }
[data-testid="nav-panel-conversations"]::after { content: "Historique"; }
[data-testid="nav-panel-agents"]::after { content: "Créer un\A assistant"; }
[data-testid="nav-panel-files"]::after { content: "Fichiers"; }
[data-testid="nav-panel-mcp-builder"]::after { content: "Connecteurs"; }

/* Liste des conversations. */
aside a[href^="/c/"] { border-radius: 10px; }

/* ===== 5. En-tête ============================================================================================== */
[data-testid="model-selector-button"] {
  border-radius: 999px !important; border-color: #dcdcef !important; padding-inline: 14px !important; font-weight: 600;
  box-shadow: 0 1px 2px rgb(7 16 118 / .06);
}
[data-testid="model-selector-button"]:hover { border-color: #4c4c9b !important; }

/* ===== 6. Accueil ============================================================================================== */
p.split-parent {
  font-size: 30px !important; line-height: 1.2 !important; font-weight: 800 !important; letter-spacing: -0.025em;
  color: #071076; white-space: normal !important; overflow: visible !important; text-align: center; display: block !important;
}
/* LibreChat laisse 112 px sous la zone de saisie de l'accueil : les cartes remontent dans cet espace. */
.reej-start { width: min(780px, calc(100vw - 32px)); margin: -88px auto 4px; display: flex; flex-direction: column; gap: 14px; }
.reej-start-label { margin: 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7c7d99; }
.reej-start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .reej-start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.reej-card {
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; text-align: left; cursor: pointer;
  background: #ffffff; border: 1px solid #e6e6f3; border-radius: 16px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.reej-card:hover { border-color: #b9b9de; box-shadow: 0 10px 24px -14px rgb(7 16 118 / .45); transform: translateY(-2px); }
.reej-card:focus-visible { outline: 2px solid #4c4c9b; outline-offset: 2px; }
.reej-card-icon {
  flex: 0 0 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: #f3f3fb; color: #4c4c9b; transition: background-color .15s, color .15s;
}
.reej-card:hover .reej-card-icon { background: #071076; color: #ffffff; }
.reej-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reej-card-title { font-size: 14px; font-weight: 700; color: #1e1f3c; }
.reej-card-hint { font-size: 12.5px; color: #6b6c8a; }
.reej-start-tip { margin: 2px 0 0; text-align: center; font-size: 12.5px; color: #7c7d99; }

/* ===== 7. Zone de saisie ======================================================================================= */
form:has(#prompt-textarea) [class*="rounded-3xl"], form:has(#prompt-textarea) [class*="rounded-t-3xl"] {
  border-radius: 24px !important; border-color: #dcdcef !important;
  box-shadow: 0 12px 32px -18px rgb(7 16 118 / .4); transition: border-color .15s, box-shadow .15s;
}
form:has(#prompt-textarea:focus) [class*="rounded-3xl"] { border-color: #4c4c9b !important; box-shadow: 0 0 0 4px rgb(76 76 155 / .12), 0 12px 32px -18px rgb(7 16 118 / .4); }
#prompt-textarea { font-size: 15.5px; }
#prompt-textarea::placeholder { color: #8a8ba6; }
[data-testid="send-button"]:not(:disabled) { background-color: rgb(var(--surface-submit)); color: #fff; }
[data-testid="send-button"]:not(:disabled):hover { background-color: rgb(var(--surface-submit-hover)); }
[data-testid="send-button"]:not(:disabled) svg { color: #fff; }
/* Outils actifs (Connecteurs…) : indigo Reej au lieu d'une couleur par outil. */
button[class*="border-series-"][class*="bg-series-"] {
  border-color: rgb(var(--green-500)); background-color: rgb(var(--green-500) / .1); color: rgb(var(--green-700));
}

/* ===== 8. Conversation ========================================================================================= */
.markdown table { border-radius: 12px; overflow: hidden; }
.markdown th { background: #f3f3fb; color: #071076; font-weight: 700; }
