/* ============================================================
   GLOBAL THEME — NOIR & OR PREMIUM
   ============================================================ */

:root {
  --font-app: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --font-field: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --black: #0b1f3f;
  --black-light: #14345f;
  --navy-950: #07162f;
  --navy-900: #0b1f3f;
  --navy-850: #12315c;
  --navy-800: #174a78;
  --panel: #12315c;
  --panel-light: #194577;
  --panel-soft: rgba(25, 69, 119, 0.76);
  --blue-line: rgba(112, 207, 255, 0.24);
  --accent: #38d5e8;
  --accent-light: #9bf2ff;
  --accent-soft: rgba(56, 213, 232, 0.26);
  --coral: #ff7f8a;
  --coral-soft: rgba(255, 127, 138, 0.18);
  --gold: #ffc857;
  --gold-light: #fff0a8;
  --gold-soft: rgba(255, 200, 87, 0.34);
  --cream: #fbf7ec;
  --text-dark: #1f2937;
}

/* Base */
body {
  font-family: var(--font-app);
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 213, 232, 0.10), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(255, 200, 87, 0.08), transparent 28%),
    linear-gradient(160deg, #09234e 0%, var(--navy-900) 46%, #07162f 100%);
  color: var(--cream);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body.is-demo-mode::after {
  content: "MODE DÉMONSTRATION";
  position: fixed;
  top: 50%;
  right: 0;
  bottom: auto;
  z-index: 13000;
  padding: 10px 5px;
  border: 1px solid rgba(255,200,87,0.38);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, rgba(255,200,87,0.86), rgba(155,242,255,0.82));
  color: #061223;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.07em;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0,0,0,0.20), 0 0 10px rgba(255,200,87,0.12);
  opacity: 0.86;
  pointer-events: none;
  text-orientation: mixed;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
}

@media (max-width: 760px) {
  body.is-demo-mode::after {
    top: auto;
    right: 12px;
    bottom: 12px;
    padding: 6px 9px;
    border-right: 1px solid rgba(255,200,87,0.34);
    border-radius: 999px;
    font-size: 9px;
    transform: none;
    writing-mode: horizontal-tb;
  }
}

::selection {
  background: rgba(255, 200, 87, 0.34);
  color: #ffffff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.92) rgba(7,22,47,0.66);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(7,22,47,0.62);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7,22,47,0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(215,248,255,0.88));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.28),
    0 0 12px rgba(255,255,255,0.26);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffffff, #ffffff);
}

#content {
  min-height: calc(100vh - var(--app-top-offset, 150px));
  transform-origin: top left;
}

.app-confirm {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 12, 30, 0.72);
  backdrop-filter: blur(8px);
}

.app-confirm-card {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255,200,87,0.58);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(56,213,232,0.1), rgba(255,200,87,0.08)),
    var(--panel);
  box-shadow:
    0 26px 70px rgba(0,0,0,0.42),
    0 0 26px rgba(255,200,87,0.18);
}

.app-confirm-card,
.campaign-form-dialog,
.campaign-quality-dialog,
.campaign-launch-dialog,
.job-library-compare-dialog,
.ref-quality-autolink-dialog,
.employee-declared-skill-modal,
.career-dialog,
.job-ref-elevia-dialog,
.pap-verification-dialog,
.ia-mail-dialog,
.resources-modal-content,
.employee360-modal-content,
.eval-quiz-dialog,
.clients-modal-content,
.hierarchy-modal-content,
.tronc-isys-dialog,
.modal,
.landing-contact-card,
[data-app-modal-zoom="true"] {
  scale: var(--app-modal-zoom, 1);
  transform-origin: center center;
}

.campaign-form-modal,
.campaign-quality-modal,
.career-modal,
.job-library-compare-modal,
.ref-quality-autolink-modal,
.job-ref-elevia-modal,
.pap-verification-modal,
.ia-mail-modal,
.eval-quiz-modal,
.resources-modal,
.clients-modal,
.tronc-isys-modal,
.modal-overlay {
  padding: calc(24px * var(--app-modal-zoom, 1));
}

.app-confirm-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(159, 243, 235, 0.62);
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 247, 182, 0.32), transparent 32%),
    linear-gradient(145deg, rgba(9, 31, 66, 0.96), rgba(4, 18, 39, 0.96));
  color: var(--gold-light);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.app-confirm-close:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 200, 87, 0.84);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(255, 200, 87, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.app-confirm-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,200,87,0.62);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #061223;
  font-size: 28px;
  font-weight: 950;
}

.app-confirm-kicker {
  margin: 0 0 6px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-confirm-content h3 {
  margin: 0;
  color: var(--gold-light);
  font-size: 24px;
}

.app-confirm-content p:last-child {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.76);
  line-height: 1.45;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

input,
select,
textarea,
button {
  font-family: var(--font-field);
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

:focus-visible {
  outline: 2px solid rgba(255,200,87,0.86);
  outline-offset: 3px;
}

textarea {
  letter-spacing: 0;
  line-height: 1.48;
}

.hidden { 
  display: none !important; 
}

.muted { 
  color: #bfbfbf; 
  font-size: 14px; 
}

/* Titres */
h1, h2, h3 {
  font-weight: 900;
  background: linear-gradient(90deg, var(--gold-light), var(--accent-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Utilitaire */
.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================================
   ASSISTANCE IA — STYLE PREMIUM
   ============================================================ */

.ai-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 380px;
  height: 520px; /* FIXE → ne grandit plus */
  background: var(--navy-950);
  border: 2px solid var(--gold);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(212,175,55,0.4);
  z-index: 9999;
}

.ai-header {
  background: var(--gold);
  color: black;
  padding: 12px;
  font-weight: 800;
  text-align: center;
  border-radius: 14px 14px 0 0;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Message IA */
.ai-message {
  background: rgba(212,175,55,0.15);
  border: 1px solid var(--gold);
  color: var(--gold); /* texte or */
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 90%;
  align-self: flex-start;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
}

/* Message utilisateur */
.user-message {
  background: rgba(255,255,255,0.15);
  border: 1px solid #fff;
  color: white; /* texte blanc */
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 90%;
  align-self: flex-end;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
}

.ai-input-zone {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--gold);
}

.ai-input-zone input {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: var(--panel-light);
  color: white;
  font-size: 13px;
}

.ai-input-zone button {
  background: var(--gold);
  color: black;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.ai-input-zone button:hover {
  filter: brightness(1.15);
}

/* Bouton X */
.ai-close {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  color: black;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ai-close:hover {
  transform: scale(1.2);
  opacity: 0.7;
}

/* Titre animé premium */
.ai-title {
  font-weight: 900;
  font-size: 18px;
  color: black;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: titleBreath 3s ease-in-out infinite;
}

/* Étoiles animées */
.star-left,
.star-right {
  color: black;
  animation: starPulse 1.6s ease-in-out infinite, starGlow 2.4s ease-in-out infinite;
  display: inline-block;
}

/* Pulsation du titre */
@keyframes titleBreath {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Pulsation des étoiles */
@keyframes starPulse {
  0%   { transform: scale(1); opacity: 0.9; }
  50%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

/* Scintillement doré */
@keyframes starGlow {
  0%   { filter: drop-shadow(0 0 2px rgba(212,175,55,0.4)); }
  50%  { filter: drop-shadow(0 0 6px rgba(212,175,55,0.9)); }
  100% { filter: drop-shadow(0 0 2px rgba(212,175,55,0.4)); }
}

/* ============================================================
   Yloria - PERSONNAGE ASSISTANT
   ============================================================ */

.ai-chat {
  width: min(420px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 36px));
  background:
    radial-gradient(circle at 22% 0%, rgba(212,175,55,0.22), transparent 34%),
    var(--navy-950);
  border-radius: 18px;
  overflow: hidden;
}

.ai-header {
  min-height: 92px;
  display: grid;
  grid-template-columns: 82px 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: white;
  border-bottom: 1px solid rgba(212,175,55,0.45);
  text-align: left;
  position: relative;
}

.isys-portrait {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.isys-orb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #07172f;
  box-shadow:
    0 0 18px rgba(56,213,232,0.34),
    0 0 16px rgba(255,200,87,0.22);
  animation: isysFloat 3.2s ease-in-out infinite;
  overflow: hidden;
}

.isys-orb::before,
.isys-orb::after {
  content: none;
}

.isys-orb img,
.isys-mini-orb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.isys-orb::before {
  left: -12px;
  transform: rotate(11deg);
  transform-origin: 70% 12%;
}

.isys-orb::after {
  right: -12px;
  transform: rotate(-11deg);
  transform-origin: 30% 12%;
}

.isys-hand,
.isys-mini-hand {
  position: absolute;
  z-index: -1;
  display: block;
  opacity: 0;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.26)) drop-shadow(0 0 7px rgba(255,200,87,0.28));
  transform-origin: 44% 86%;
  transition: opacity 0.18s ease;
}

.isys-hand,
.isys-mini-hand {
  display: none;
}

.isys-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.isys-hand-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.isys-hand-finger,
.isys-hand-thumb,
.isys-hand-palm,
.isys-hand-wrist {
  fill: var(--gold);
  stroke: rgba(6,18,35,0.82);
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
}

.isys-hand-finger {
  fill: #fff0a8;
}

.isys-hand-palm {
  fill: var(--gold);
}

.isys-hand-thumb {
  fill: #ffe27c;
}

.isys-hand-wrist {
  fill: #9a741a;
  stroke-width: 2;
}

.isys-hand-line {
  fill: none;
  stroke: rgba(6,18,35,0.24);
  stroke-width: 2;
  stroke-linecap: round;
}

.isys-hand-nail {
  display: none;
}

.isys-hand {
  width: 30px;
  height: 36px;
  top: 23px;
}

.isys-hand.left {
  left: -18px;
  transform: rotate(-12deg) scaleX(-1);
}

.isys-hand.right {
  right: -20px;
  transform: rotate(20deg);
}

.isys-eye {
  position: absolute;
  z-index: 3;
  top: 20px;
  width: 7px;
  height: 9px;
  border-radius: 50%;
  background: var(--navy-950);
  animation: isysBlink 4s infinite;
}

.isys-eye.left { left: 18px; }
.isys-eye.right { right: 18px; }

.isys-smile {
  position: absolute;
  z-index: 3;
  left: 15px;
  top: 32px;
  width: 30px;
  height: 19px;
  border: 1px solid rgba(88,50,12,0.22);
  border-radius: 56% 56% 48% 48%;
  background: linear-gradient(180deg, #fff2cb 0%, #e7c27c 100%);
  box-shadow: inset 0 -4px 6px rgba(112,65,16,0.18);
}

.isys-smile::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 9px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 55% 55% 65% 65%;
  background: #07162f;
}

.isys-smile::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 11px;
  width: 12px;
  height: 6px;
  transform: translateX(-50%);
  border-bottom: 2px solid rgba(7,22,47,0.75);
  border-radius: 0 0 999px 999px;
}

.isys-spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 10px var(--gold);
}

.isys-spark.one {
  top: 8px;
  right: 7px;
  animation: isysSpark 2s ease-in-out infinite;
}

.isys-spark.two {
  left: 5px;
  bottom: 13px;
  animation: isysSpark 2.6s ease-in-out infinite 0.4s;
}

.ai-title-zone {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ai-title {
  font-size: 24px;
  letter-spacing: 0;
  color: var(--gold);
  animation: none;
}

.ai-subtitle {
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-close {
  color: var(--gold);
  position: static;
  justify-self: end;
}

.isys-intro {
  margin: 12px 14px 0;
  padding: 12px;
  border: 1px solid rgba(212,175,55,0.32);
  border-radius: 14px;
  background: rgba(212,175,55,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.isys-intro strong {
  color: var(--gold);
  font-size: 14px;
}

.isys-intro span {
  color: rgba(255,255,255,0.74);
  font-size: 12px;
  line-height: 1.35;
}

.isys-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px 0;
}

.isys-quick-actions button {
  border: 1px solid rgba(212,175,55,0.36);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.05);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.isys-quick-actions button:hover {
  background: rgba(212,175,55,0.16);
  transform: translateY(-2px);
}

.isys-quick-actions button.is-muted {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.64);
}

.ai-chat.is-demo-guided-mode {
  border-color: rgba(155, 242, 255, 0.86);
  box-shadow:
    0 0 24px rgba(155, 242, 255, 0.28),
    0 0 22px rgba(212,175,55,0.22);
}

.ai-chat.is-demo-guided-mode .isys-intro {
  border-color: rgba(155, 242, 255, 0.42);
  background: rgba(155, 242, 255, 0.08);
}

.ai-chat.is-demo-guided-mode .ai-message::before {
  content: "Guide démo";
}

.ai-chat.is-demo-guided-mode .isys-quick-actions button:first-child {
  border-color: rgba(255, 214, 112, 0.78);
  background: linear-gradient(135deg, rgba(255, 214, 112, 0.92), rgba(155, 242, 255, 0.92));
  color: #061223;
}

.ai-chat.is-demo-guided-mode .ai-input-zone {
  opacity: 0.72;
}

.ai-chat.is-demo-guided-mode .ai-input-zone input,
.ai-chat.is-demo-guided-mode .ai-input-zone button {
  cursor: not-allowed;
}

.icon-button {
  position: relative;
  display: inline-grid !important;
  place-items: center;
  width: 38px;
  min-width: 38px !important;
  height: 34px;
  padding: 0 !important;
  overflow: hidden;
  text-indent: -999px;
}

.icon-button::before,
.icon-button::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  text-indent: 0;
}

.icon-sound::before {
  top: 50%;
  left: 9px;
  width: 10px;
  height: 14px;
  transform: translateY(-50%);
  background: currentColor;
  clip-path: polygon(0 32%, 38% 32%, 100% 4%, 100% 96%, 38% 68%, 0 68%);
}

.icon-sound::after {
  top: 50%;
  right: 8px;
  width: 13px;
  height: 13px;
  transform: translateY(-50%) rotate(45deg);
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 0 999px 0 0;
}

.icon-button.is-muted::after {
  top: 50%;
  left: 50%;
  width: 23px;
  height: 2px;
  transform: translate(-50%, -50%) rotate(-42deg);
  border: 0;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(5,11,22,0.36);
}

.ai-messages {
  padding: 14px;
}

.ai-message,
.user-message {
  border-radius: 15px;
}

.ai-message {
  position: relative;
  margin-left: 12px;
  background: rgba(212,175,55,0.12);
  color: var(--gold-light);
}

.isys-permission-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 94%;
}

.isys-permission-message strong {
  color: var(--gold-light);
  font-size: 14px;
}

.isys-permission-message span {
  white-space: pre-line;
  color: rgba(255,255,255,0.78);
  line-height: 1.4;
}

.isys-permission-message button {
  align-self: flex-start;
  border: 1px solid rgba(155,242,255,0.42);
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--accent), var(--gold-light));
  color: #061223;
  font-weight: 900;
  cursor: pointer;
}

.isys-permission-message button:hover {
  filter: brightness(1.12);
}

.ai-message::before {
  content: "Yloria";
  position: absolute;
  top: -8px;
  left: -12px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: black;
  font-size: 9px;
  font-weight: 900;
}

.user-message {
  background: rgba(255,255,255,0.1);
}

.ai-input-zone {
  background: var(--navy-950);
  position: relative;
}

.ai-input-zone button {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  font-weight: 900;
}

.isys-speech-status {
  min-height: 18px;
  padding: 0 14px 12px;
  color: rgba(255,255,255,0.68);
  font-size: 12px;
  font-weight: 800;
}

.isys-speech-status.is-active {
  color: var(--accent-light);
}

.ai-chat.is-thinking .isys-orb {
  animation: isysThink 0.7s ease-in-out infinite;
}

.ai-chat:not(.hidden) .isys-orb::before {
  animation: isysCockerEarLeft 1.7s ease-in-out 0.15s 2;
}

.ai-chat:not(.hidden) .isys-orb::after {
  animation: isysCockerEarRight 1.7s ease-in-out 0.15s 2;
}

.ai-chat.is-thinking .ai-input-zone::before {
  content: "Yloria réfléchit...";
  position: absolute;
  transform: translateY(-24px);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.yloria-working-indicator {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 23000;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: min(330px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 214, 112, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 30%, rgba(157, 242, 238, 0.20), transparent 36%),
    linear-gradient(135deg, rgba(6, 22, 48, 0.98), rgba(8, 44, 72, 0.96));
  color: #f7fcff;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(255, 200, 87, 0.26),
    0 0 36px rgba(56, 213, 232, 0.18);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.yloria-working-indicator.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.yloria-working-orb {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 38% 32%, #ffffff 0 8%, transparent 10%),
    radial-gradient(circle at 50% 50%, rgba(157, 242, 238, 0.95), rgba(56, 213, 232, 0.42) 48%, rgba(255, 200, 87, 0.26) 72%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.18) inset,
    0 0 18px rgba(157, 242, 238, 0.52),
    0 0 24px rgba(255, 200, 87, 0.34);
  animation: yloriaWorkingPulse 0.9s ease-in-out infinite;
}

.yloria-working-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.yloria-working-copy strong {
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 1000;
}

.yloria-working-copy small {
  color: rgba(235, 250, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.is-yloria-working {
  position: relative;
  cursor: wait !important;
}

.is-yloria-working::after {
  content: "";
  width: 13px;
  height: 13px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--gold-light);
  border-radius: 999px;
  animation: yloriaWorkingSpin 0.65s linear infinite;
}

@keyframes yloriaWorkingPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.78; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes yloriaWorkingSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .yloria-working-orb,
  .is-yloria-working::after {
    animation: none !important;
  }
}

.ai-chat.is-agent-mode {
  width: min(520px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
}

.yloria-openai-usage {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 150px;
  margin-top: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(141, 244, 255, 0.42);
  border-radius: 999px;
  color: #9bf2ff;
  background: rgba(7, 29, 54, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.yloria-openai-usage.is-warning {
  border-color: rgba(255, 215, 102, 0.72);
  color: #ffe486;
}

.yloria-openai-usage.is-blocked {
  border-color: rgba(255, 136, 136, 0.8);
  color: #ffb0b0;
}

.ai-chat.is-agent-mode .isys-intro,
.ai-chat.is-agent-mode .isys-quick-actions,
.ai-chat.is-agent-mode #ai-messages,
.ai-chat.is-agent-mode .ai-input-zone,
.ai-chat.is-agent-mode #isys-speech-status {
  display: none;
}

.yloria-agent-chatkit {
  flex: 1;
  min-height: 0;
  display: block;
  overflow: hidden;
  border-top: 1px solid rgba(155,242,255,0.2);
}

.yloria-agent-chatkit[hidden] {
  display: none;
}

@keyframes isysFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes isysBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.12); }
}

@keyframes isysSpark {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes isysThink {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.04); }
}

@keyframes isysHandHello {
  0%, 100% { opacity: 0; transform: rotate(20deg) translateY(0); }
  8%, 88% { opacity: 1; }
  20% { opacity: 1; transform: rotate(44deg) translateY(-2px); }
  40% { opacity: 1; transform: rotate(6deg) translateY(1px); }
  60% { opacity: 1; transform: rotate(48deg) translateY(-2px); }
  80% { opacity: 1; transform: rotate(14deg) translateY(0); }
}

@keyframes isysCockerEarLeft {
  0%, 100% { transform: rotate(11deg) translateY(0); }
  18% { transform: rotate(24deg) translateY(-1px); }
  36% { transform: rotate(4deg) translateY(2px); }
  56% { transform: rotate(22deg) translateY(-1px); }
  78% { transform: rotate(8deg) translateY(1px); }
}

@keyframes isysCockerEarRight {
  0%, 100% { transform: rotate(-11deg) translateY(0); }
  18% { transform: rotate(-24deg) translateY(-1px); }
  36% { transform: rotate(-4deg) translateY(2px); }
  56% { transform: rotate(-22deg) translateY(-1px); }
  78% { transform: rotate(-8deg) translateY(1px); }
}

@keyframes isysMiniHandHello {
  0%, 100% { opacity: 0; transform: rotate(22deg) translateY(0); }
  8%, 88% { opacity: 1; }
  20% { opacity: 1; transform: rotate(48deg) translateY(-2px); }
  40% { opacity: 1; transform: rotate(4deg) translateY(1px); }
  60% { opacity: 1; transform: rotate(52deg) translateY(-2px); }
  80% { opacity: 1; transform: rotate(16deg) translateY(0); }
}

@keyframes isysMiniCockerEarLeft {
  0%, 100% { transform: rotate(11deg) translateY(0); }
  18% { transform: rotate(25deg) translateY(-1px); }
  38% { transform: rotate(3deg) translateY(2px); }
  58% { transform: rotate(22deg) translateY(-1px); }
  78% { transform: rotate(7deg) translateY(1px); }
}

@keyframes isysMiniCockerEarRight {
  0%, 100% { transform: rotate(-11deg) translateY(0); }
  18% { transform: rotate(-25deg) translateY(-1px); }
  38% { transform: rotate(-3deg) translateY(2px); }
  58% { transform: rotate(-22deg) translateY(-1px); }
  78% { transform: rotate(-7deg) translateY(1px); }
}

/* ============================================================
   Yloria - PRESENCE SPONTANEE DISCRETE
   ============================================================ */

.isys-companion {
  position: fixed;
  left: var(--elevia-companion-left, auto);
  top: var(--elevia-companion-top, 92px);
  right: var(--elevia-companion-right, 1cm);
  bottom: auto;
  z-index: 10001;
  display: block;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.isys-companion.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.isys-companion.is-home-floating {
  transform: translateX(-50%) translateY(-8px) scale(0.96);
}

.isys-companion.is-home-floating.is-visible {
  animation: eleviaHomeFloat 4.8s ease-in-out infinite;
}

@keyframes eleviaHomeFloat {
  0%, 100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(-12px) scale(1.02);
  }
}

.isys-companion-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(212,175,55,0.56);
  border-radius: 16px;
  background: var(--navy-950);
  cursor: pointer;
  box-shadow: 0 0 18px rgba(212,175,55,0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.isys-companion.is-home-floating .isys-companion-avatar {
  width: min(440px, 42vw);
  height: min(440px, 42vw);
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 18%, rgba(157,242,238,0.95) 0 5px, transparent 6px),
    radial-gradient(circle at 79% 23%, rgba(255,230,136,0.9) 0 4px, transparent 5px),
    radial-gradient(circle at 13% 70%, rgba(255,200,87,0.86) 0 4px, transparent 5px),
    radial-gradient(circle at 84% 73%, rgba(157,242,238,0.88) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(56,213,232,0.14), transparent 62%);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.isys-companion.is-home-floating .isys-companion-avatar::before,
.isys-companion.is-home-floating .isys-companion-avatar::after {
  inset: 18px;
  border-radius: 50%;
  border-color: rgba(155,242,255,0.28);
  opacity: 1;
  animation: eleviaHomeSparkle 2.4s ease-in-out infinite;
}

.isys-companion.is-home-floating .isys-companion-avatar::after {
  inset: 44px;
  border-color: rgba(255,200,87,0.22);
  animation-delay: 0.8s;
}

.isys-companion-avatar::before,
.isys-companion-avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  border: 1px solid rgba(155,242,255,0.48);
  opacity: 0;
  pointer-events: none;
}

.isys-companion-avatar:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 28px rgba(212,175,55,0.58);
}

.elevia-start-voice {
  position: absolute;
  left: 50%;
  top: calc(100% + 18px);
  width: max-content;
  max-width: min(360px, 78vw);
  transform: translateX(-50%) translateY(6px);
  padding: 11px 16px 12px;
  border: 1px solid rgba(255,200,87,0.74);
  border-radius: 18px 18px 18px 5px;
  background:
    linear-gradient(135deg, rgba(255,238,160,0.98), rgba(155,242,255,0.96));
  color: #061223;
  box-shadow:
    0 0 0 4px rgba(255,200,87,0.08),
    0 16px 36px rgba(0,0,0,0.28),
    0 0 28px rgba(155,242,255,0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
}

.elevia-start-voice::before {
  content: "";
  position: absolute;
  left: 28px;
  top: -7px;
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(255,200,87,0.74);
  border-top: 1px solid rgba(255,200,87,0.74);
  background: rgba(255,238,160,0.98);
}

.elevia-start-voice strong,
.elevia-start-voice span {
  position: relative;
  display: block;
}

.elevia-start-voice strong {
  color: #07172f;
  font-size: 14px;
  font-weight: 950;
}

.elevia-start-voice span {
  margin-top: 2px;
  color: rgba(7,23,47,0.76);
  font-size: 12px;
  font-weight: 850;
}

.elevia-start-voice:hover {
  transform: translateX(-50%) translateY(2px);
  box-shadow:
    0 0 0 5px rgba(255,200,87,0.12),
    0 18px 40px rgba(0,0,0,0.32),
    0 0 34px rgba(155,242,255,0.36);
}

.isys-companion.is-awaiting-voice .elevia-start-voice {
  opacity: 1;
  pointer-events: auto;
  animation: eleviaStartPrompt 1.55s ease-in-out infinite;
}

@keyframes eleviaStartPrompt {
  0%, 100% {
    transform: translateX(-50%) translateY(6px);
  }
  50% {
    transform: translateX(-50%) translateY(0);
  }
}

.isys-companion.is-listening .isys-companion-avatar {
  border-color: rgba(155,242,255,0.72);
  box-shadow:
    0 0 0 5px rgba(56,213,232,0.12),
    0 0 24px rgba(56,213,232,0.42),
    0 0 18px rgba(212,175,55,0.26);
}

.isys-companion.is-preparing-voice .isys-companion-avatar,
.isys-companion.is-speaking .isys-companion-avatar {
  border-color: rgba(255,240,168,0.86);
  box-shadow:
    0 0 0 4px rgba(255,200,87,0.12),
    0 0 26px rgba(155,242,255,0.38),
    0 0 22px rgba(255,200,87,0.28);
}

.isys-companion.is-preparing-voice .isys-companion-avatar::before,
.isys-companion.is-speaking .isys-companion-avatar::before {
  animation: eleviaVoiceEcho 1.45s ease-out infinite;
}

.isys-companion.is-preparing-voice .isys-companion-avatar::after,
.isys-companion.is-speaking .isys-companion-avatar::after {
  animation: eleviaVoiceEcho 1.45s ease-out 0.42s infinite;
}

.isys-mini-orb {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #07172f;
  box-shadow:
    0 0 16px rgba(56,213,232,0.28),
    0 0 12px rgba(255,200,87,0.18);
  animation: isysFloat 3.2s ease-in-out infinite;
  overflow: hidden;
}

.isys-companion.is-home-floating .isys-mini-orb {
  width: min(260px, 25vw);
  height: min(260px, 25vw);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 46%, rgba(157,242,238,0.1), rgba(7,23,47,0.88) 64%);
  box-shadow:
    0 0 0 1px rgba(155,242,255,0.24),
    0 0 42px rgba(56,213,232,0.3),
    0 0 34px rgba(255,200,87,0.2);
}

.isys-companion.is-home-floating .isys-mini-orb img {
  object-fit: contain;
}

.isys-companion.is-home-docked {
  transition: left 0.7s ease, top 0.7s ease, opacity 0.22s ease, transform 0.7s ease;
}

.isys-companion.is-header-docked {
  opacity: 0;
  pointer-events: none;
}

@keyframes eleviaHomeSparkle {
  0%, 100% {
    transform: scale(0.96) rotate(0deg);
    opacity: 0.36;
  }
  50% {
    transform: scale(1.05) rotate(8deg);
    opacity: 0.82;
  }
}

.isys-companion.is-speaking .isys-mini-orb {
  animation: isysFloat 3.2s ease-in-out infinite, eleviaVoiceGlow 0.9s ease-in-out infinite;
}

@keyframes eleviaVoiceEcho {
  0% {
    opacity: 0.68;
    transform: scale(0.92);
    border-color: rgba(155,242,255,0.62);
  }
  70% {
    opacity: 0.2;
    border-color: rgba(255,200,87,0.42);
  }
  100% {
    opacity: 0;
    transform: scale(1.42);
    border-color: rgba(255,200,87,0);
  }
}

@keyframes eleviaVoiceGlow {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.18) saturate(1.2);
  }
}

.isys-mini-orb::before,
.isys-mini-orb::after {
  content: none;
}

.isys-mini-orb::before {
  left: -9px;
  transform: rotate(11deg);
  transform-origin: 70% 12%;
}

.isys-mini-orb::after {
  right: -9px;
  transform: rotate(-11deg);
  transform-origin: 30% 12%;
}

.isys-mini-hand {
  width: 23px;
  height: 28px;
  top: 18px;
}

.isys-mini-hand.left {
  left: -9px;
  transform: rotate(-10deg) scaleX(-1);
}

.isys-mini-hand.right {
  right: -10px;
  transform: rotate(22deg);
}

.isys-companion.is-waving .isys-mini-orb::before {
  animation: isysMiniCockerEarLeft 1.65s ease-in-out 0.12s 2;
}

.isys-companion.is-waving .isys-mini-orb::after {
  animation: isysMiniCockerEarRight 1.65s ease-in-out 0.12s 2;
}

.isys-mini-eye {
  position: absolute;
  z-index: 3;
  top: 16px;
  width: 6px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy-950);
  animation: isysBlink 4s infinite;
}

.isys-mini-eye.left { left: 14px; }
.isys-mini-eye.right { right: 14px; }

.isys-mini-smile {
  position: absolute;
  z-index: 3;
  left: 12px;
  top: 27px;
  width: 24px;
  height: 15px;
  border: 1px solid rgba(88,50,12,0.2);
  border-radius: 56% 56% 48% 48%;
  background: linear-gradient(180deg, #fff2cb 0%, #e7c27c 100%);
  box-shadow: inset 0 -3px 5px rgba(112,65,16,0.16);
}

.isys-mini-smile::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 7px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 55% 55% 65% 65%;
  background: #07162f;
}

.isys-mini-smile::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 10px;
  height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid rgba(7,22,47,0.75);
  border-radius: 0 0 999px 999px;
}

.isys-companion-bubble {
  position: relative;
  width: min(310px, calc(100vw - 120px));
  padding: 13px 38px 14px 14px;
  border: 1px solid rgba(212,175,55,0.42);
  border-radius: 16px 16px 4px 16px;
  background:
    linear-gradient(135deg, rgba(13,27,47,0.98), rgba(5,11,22,0.94));
  box-shadow: 0 0 24px rgba(212,175,55,0.22);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.isys-companion.is-intro .isys-companion-bubble {
  width: min(430px, calc(100vw - 120px));
}

.isys-companion-bubble:hover,
.isys-companion-bubble:focus {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(212,175,55,0.34);
  outline: none;
}

.isys-companion-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 18px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-top: 1px solid rgba(212,175,55,0.42);
  border-right: 1px solid rgba(212,175,55,0.42);
  background: var(--navy-950);
}

.isys-companion-bubble strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.isys-companion-bubble span {
  position: relative;
  display: block;
  color: #061223;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
}

#isys-companion-text {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(155,242,255,0.36);
  border-radius: 14px 14px 14px 4px;
  background:
    linear-gradient(135deg, rgba(255,240,168,0.96), rgba(155,242,255,0.94));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    0 8px 18px rgba(0,0,0,0.16);
}

.isys-companion.is-intro #isys-companion-text {
  font-size: 14px;
  line-height: 1.42;
}

#isys-companion-text::before {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(155,242,255,0.36);
  border-bottom: 1px solid rgba(155,242,255,0.36);
  background: rgba(255,240,168,0.96);
}

.isys-companion-voice-status {
  display: none;
  margin-top: 7px;
  color: rgba(255,255,255,0.68);
  font-size: 11px;
  font-weight: 850;
}

.isys-companion.is-preparing-voice .isys-companion-voice-status,
.isys-companion.is-speaking .isys-companion-voice-status {
  display: block;
}

.isys-companion.is-preparing-voice .isys-companion-voice-status::before {
  content: "Yloria prépare sa voix...";
}

.isys-companion.is-speaking .isys-companion-voice-status::before {
  content: "Yloria parle...";
}

.isys-companion.is-preparing-voice .isys-mini-orb,
.isys-companion.is-speaking .isys-mini-orb {
  box-shadow:
    0 0 20px rgba(56,213,232,0.42),
    0 0 18px rgba(255,200,87,0.28);
}

.isys-bubble-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,200,87,0.16);
  color: var(--gold);
  cursor: pointer;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.isys-bubble-close:hover {
  background: rgba(255,200,87,0.28);
  color: var(--gold-light);
}

.isys-companion-voice-toggle {
  position: absolute;
  top: 7px;
  right: 72px;
  width: 26px;
  min-width: 26px !important;
  height: 24px;
  border: 1px solid rgba(255,200,87,0.28);
  border-radius: 999px;
  background: rgba(255,200,87,0.14);
  color: var(--gold-light);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.isys-companion-voice-toggle:hover {
  background: rgba(255,200,87,0.26);
}

.isys-companion-voice-toggle.is-muted {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.66);
}

.isys-companion-bubble .icon-sound::before {
  left: 6px;
  width: 7px;
  height: 10px;
}

.isys-companion-bubble .icon-sound::after {
  right: 6px;
  width: 8px;
  height: 8px;
}

@media (max-width: 680px) {
  .isys-companion {
    right: 14px;
    bottom: 14px;
  }

  .isys-companion-bubble {
    width: calc(100vw - 112px);
  }

  .isys-companion-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .isys-mini-orb {
    width: 42px;
    height: 42px;
  }

  .isys-mini-hand {
    top: 20px;
  }
}
