/**
 * cli/cli.css
 * Feuille de style dédiée pour VisiDog CLI.
 * Haute lisibilité, thèmes dynamiques (dark, light, navy, solarized, high-contrast),
 * mise en page split-screen, coloration syntaxique et télémétrie temps réel.
 */

:root {
  --cli-bg: #0f172a;
  --cli-surface: #1e293b;
  --cli-surface-hover: #334155;
  --cli-border: #334155;
  --cli-text: #f8fafc;
  --cli-text-muted: #94a3b8;
  --cli-primary: #38bdf8;
  --cli-primary-hover: #0284c7;
  --cli-primary-fg: #0f172a;
  --cli-success: #22c55e;
  --cli-warning: #f59e0b;
  --cli-danger: #ef4444;
  --cli-accent: #a855f7;
  --cli-code-bg: #000000;
  --cli-code-text: #f8fafc;
  --cli-code-border: #334155;
  --cli-inline-code-bg: rgba(255, 255, 255, 0.1);
  --cli-font: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --cli-bg: #0f172a;
  --cli-surface: #1e293b;
  --cli-surface-hover: #334155;
  --cli-border: #334155;
  --cli-text: #f8fafc;
  --cli-text-muted: #94a3b8;
  --cli-primary: #38bdf8;
  --cli-primary-hover: #0284c7;
  --cli-primary-fg: #0f172a;
  --cli-success: #22c55e;
  --cli-warning: #f59e0b;
  --cli-danger: #ef4444;
  --cli-accent: #a855f7;
  --cli-code-bg: #000000;
  --cli-code-text: #f8fafc;
  --cli-code-border: #334155;
  --cli-inline-code-bg: rgba(255, 255, 255, 0.1);
}

[data-theme="visidog"] {
  --cli-bg: #f8f8f0;
  --cli-surface: #ffffff;
  --cli-surface-hover: #e8edf4;
  --cli-border: #cbd5e1;
  --cli-text: #002858;
  --cli-text-muted: #475569;
  --cli-primary: #002858;
  --cli-primary-hover: #1b365d;
  --cli-primary-fg: #ffffff;
  --cli-success: #16a34a;
  --cli-warning: #d97706;
  --cli-danger: #dc2626;
  --cli-accent: #4898d8;
  --cli-code-bg: #002858;
  --cli-code-text: #e8edf4;
  --cli-code-border: #4898d8;
  --cli-inline-code-bg: rgba(72, 152, 216, 0.18);
}

[data-theme="light"] {
  --cli-bg: #f8fafc;
  --cli-surface: #ffffff;
  --cli-surface-hover: #f1f5f9;
  --cli-border: #cbd5e1;
  --cli-text: #0f172a;
  --cli-text-muted: #64748b;
  --cli-primary: #0284c7;
  --cli-primary-hover: #0369a1;
  --cli-primary-fg: #ffffff;
  --cli-success: #16a34a;
  --cli-warning: #d97706;
  --cli-danger: #dc2626;
  --cli-accent: #9333ea;
  --cli-code-bg: #0f172a;
  --cli-code-text: #f8fafc;
  --cli-code-border: #cbd5e1;
  --cli-inline-code-bg: rgba(15, 23, 42, 0.08);
}

[data-theme="navy"] {
  --cli-bg: #001f3f;
  --cli-surface: #002b59;
  --cli-surface-hover: #003a78;
  --cli-border: #004488;
  --cli-text: #e6f1ff;
  --cli-text-muted: #8892b0;
  --cli-primary: #64ffda;
  --cli-primary-hover: #4cdbb7;
  --cli-primary-fg: #001f3f;
  --cli-success: #52e3c2;
  --cli-warning: #ffd166;
  --cli-danger: #ff5e7e;
  --cli-accent: #f77f00;
  --cli-code-bg: #001f3f;
  --cli-code-text: #e6f1ff;
  --cli-code-border: #004488;
  --cli-inline-code-bg: rgba(100, 255, 218, 0.12);
}

[data-theme="solarized"] {
  --cli-bg: #002b36;
  --cli-surface: #073642;
  --cli-surface-hover: #0a4452;
  --cli-border: #586e75;
  --cli-text: #839496;
  --cli-text-muted: #586e75;
  --cli-primary: #268bd2;
  --cli-primary-hover: #1e71ab;
  --cli-primary-fg: #ffffff;
  --cli-success: #859900;
  --cli-warning: #b58900;
  --cli-danger: #dc322f;
  --cli-accent: #6c71c4;
  --cli-code-bg: #002b36;
  --cli-code-text: #93a1a1;
  --cli-code-border: #586e75;
  --cli-inline-code-bg: rgba(38, 139, 210, 0.18);
}

[data-theme="high-contrast"] {
  --cli-bg: #000000;
  --cli-surface: #121212;
  --cli-surface-hover: #242424;
  --cli-border: #ffffff;
  --cli-text: #ffffff;
  --cli-text-muted: #d0d0d0;
  --cli-primary: #00ffff;
  --cli-primary-hover: #00cccc;
  --cli-primary-fg: #000000;
  --cli-success: #00ff00;
  --cli-warning: #ffff00;
  --cli-danger: #ff0000;
  --cli-accent: #ff00ff;
  --cli-code-bg: #000000;
  --cli-code-text: #ffffff;
  --cli-code-border: #ffffff;
  --cli-inline-code-bg: rgba(255, 255, 255, 0.2);
}

html:lang(fr) .en { display: none !important; }
html:lang(en) .fr { display: none !important; }

/*
 * Listes déroulantes natives : on force l'opacité et les couleurs du thème
 * actif sur les <option> afin d'éviter tout texte clair sur fond clair
 * (comportement des popups natifs lorsque le <select> a un fond translucide).
 */
select option {
  background-color: var(--cli-bg);
  color: var(--cli-text);
}

/* Icones filaires SVG vectorielles via masques CSS */
.vd-icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: -0.15em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

.vd-icon-settings {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.vd-icon-copy {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
}

.vd-icon-folder {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.vd-icon-folder-open {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v2H2z'/%3E%3Cpath d='M2 13h20l-3 8H5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v2H2z'/%3E%3Cpath d='M2 13h20l-3 8H5z'/%3E%3C/svg%3E");
}

.vd-icon-file {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
}

.vd-icon-plus {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}

.vd-icon-mic {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E");
}

.vd-icon-attach {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
}

.vd-icon-camera {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}

.vd-icon-refresh {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpolyline points='1 20 1 14 7 14'/%3E%3Cpath d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpolyline points='1 20 1 14 7 14'/%3E%3Cpath d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'/%3E%3C/svg%3E");
}

.vd-icon-close {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.vd-icon-alert {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

.vd-icon-mobile {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2' ry='2'/%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2' ry='2'/%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'/%3E%3C/svg%3E");
}

.vd-icon-tablet {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2' ry='2'/%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2' ry='2'/%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'/%3E%3C/svg%3E");
}

.vd-icon-desktop {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='14' rx='2' ry='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='14' rx='2' ry='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E");
}

.vd-icon-volume-2 {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3C/svg%3E");
}

.vd-icon-volume-x {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cline x1='23' y1='9' x2='17' y2='15'/%3E%3Cline x1='17' y1='9' x2='23' y2='15'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cline x1='23' y1='9' x2='17' y2='15'/%3E%3Cline x1='17' y1='9' x2='23' y2='15'/%3E%3C/svg%3E");
}

.vd-icon-pulse {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E");
}

.vd-icon-bolt {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E");
}

.vd-icon-check {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.vd-icon-shield {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
}

.vd-icon-bug {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='8' height='14' x='8' y='6' rx='4'/%3E%3Cpath d='M19 7l-3 2M5 7l3 2M19 19l-3-2M5 19l3-2M20 13h-4M4 13h4M10 4l1 2M14 4l-1 2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='8' height='14' x='8' y='6' rx='4'/%3E%3Cpath d='M19 7l-3 2M5 7l3 2M19 19l-3-2M5 19l3-2M20 13h-4M4 13h4M10 4l1 2M14 4l-1 2'/%3E%3C/svg%3E");
}

.vd-icon-flask {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v7.31L4.17 19.34A2 2 0 0 0 5.89 22h12.22a2 2 0 0 0 1.72-2.66L14 9.31V2h-4z'/%3E%3Cline x1='8.5' y1='2' x2='15.5' y2='2'/%3E%3Cpath d='M6.5 16h11'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v7.31L4.17 19.34A2 2 0 0 0 5.89 22h12.22a2 2 0 0 0 1.72-2.66L14 9.31V2h-4z'/%3E%3Cline x1='8.5' y1='2' x2='15.5' y2='2'/%3E%3Cpath d='M6.5 16h11'/%3E%3C/svg%3E");
}

.vd-icon-terminal {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 17 10 11 4 5'/%3E%3Cline x1='12' y1='19' x2='20' y2='19'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 17 10 11 4 5'/%3E%3Cline x1='12' y1='19' x2='20' y2='19'/%3E%3C/svg%3E");
}

.vd-icon-edit {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.vd-icon-trash {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

.vd-icon-download {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

.vd-icon-chevron-left {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}

.vd-icon-chevron-right {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

.vd-icon-chevron-down {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.vd-icon-stop {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='none'%3E%3Crect x='6' y='6' width='12' height='12' rx='2' ry='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='none'%3E%3Crect x='6' y='6' width='12' height='12' rx='2' ry='2'/%3E%3C/svg%3E");
}

.vd-icon-fullscreen,
.vd-icon-maximize {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E");
}

.vd-icon-fullscreen-exit,
.vd-icon-minimize {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3'/%3E%3C/svg%3E");
}

.vd-icon-code {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E");
}

.btn-stop-hint {
  box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(239, 68, 68, 0.85);
  transform: scale(1.02);
  transition: all 0.12s ease-in-out;
}

/* Bandeau d'incitation Plan Mode -> Act Mode */
.plan-mode-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--cli-text, #e2e8f0);
}

.plan-mode-banner .plan-mode-banner-text {
  flex: 1 1 auto;
  min-width: 0;
}

.plan-mode-banner .btn {
  flex: 0 0 auto;
}

.plan-approve-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Édition inline d'un plan avant approbation */
.plan-edit-container {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-edit-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-primary);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--cli-font);
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}

.plan-edit-textarea:focus {
  border-color: var(--cli-accent);
}

.plan-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.status-icon-green { color: var(--cli-success, #22c55e); }
.status-icon-yellow { color: var(--cli-warning, #f59e0b); }
.status-icon-red { color: var(--cli-danger, #ef4444); }
.status-icon-gray { color: var(--cli-text-muted, #94a3b8); }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ascenseurs fins (Thin vertical/horizontal scrollbars) */
.projects-tree-container,
.sidebar-content,
.cli-viewport,
.cli-textarea,
.editor-textarea,
.cli-autocomplete,
#models-list-container {
  scrollbar-width: thin;
  scrollbar-color: var(--cli-border) transparent;
}

.projects-tree-container::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar,
.cli-viewport::-webkit-scrollbar,
.cli-textarea::-webkit-scrollbar,
.editor-textarea::-webkit-scrollbar,
.cli-autocomplete::-webkit-scrollbar,
#models-list-container::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.projects-tree-container::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track,
.cli-viewport::-webkit-scrollbar-track,
.cli-textarea::-webkit-scrollbar-track,
.editor-textarea::-webkit-scrollbar-track,
.cli-autocomplete::-webkit-scrollbar-track,
#models-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.projects-tree-container::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb,
.cli-viewport::-webkit-scrollbar-thumb,
.cli-textarea::-webkit-scrollbar-thumb,
.editor-textarea::-webkit-scrollbar-thumb,
.cli-autocomplete::-webkit-scrollbar-thumb,
#models-list-container::-webkit-scrollbar-thumb {
  background-color: var(--cli-border);
  border-radius: 4px;
}

.projects-tree-container::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover,
.cli-viewport::-webkit-scrollbar-thumb:hover,
.cli-textarea::-webkit-scrollbar-thumb:hover,
.editor-textarea::-webkit-scrollbar-thumb:hover,
.cli-autocomplete::-webkit-scrollbar-thumb:hover,
#models-list-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--cli-text-muted);
}

body {
  font-family: var(--cli-font);
  background-color: var(--cli-bg);
  color: var(--cli-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
}

/* Header */
.cli-header {
  height: 44px;
  background-color: var(--cli-surface);
  border-bottom: 1px solid var(--cli-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  user-select: none;
  z-index: 10;
}

.cli-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--cli-primary);
  font-size: 14px;
}

.cli-brand svg, .cli-brand img {
  width: 20px;
  height: 20px;
}

.cli-topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cli-text);
  font-weight: 500;
  padding: 0 12px;
  max-width: 55%;
  min-width: 0;
}

.topbar-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-breadcrumb-sep {
  opacity: 0.35;
  margin: 0 2px;
}

/* Sidebar Section Headers */
.sidebar-section-header {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--cli-border);
  background: var(--cli-surface);
}

.sidebar-section-header .section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cli-text-muted);
}

/* Projects Tree Container in Sidebar */
.sidebar-projects-pane {
  display: flex;
  flex-direction: column;
  height: 200px;
  min-height: 70px;
  flex-shrink: 0;
  overflow: hidden;
}

.projects-tree-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-resizer-h {
  height: 6px;
  cursor: row-resize;
  background: var(--cli-border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.15s ease;
}

.sidebar-resizer-h:hover,
.sidebar-resizer-h.resizing {
  background: var(--cli-accent, #6366f1);
}

.sidebar-files-pane {
  flex: 1;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-node {
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.project-node.active-project {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.05);
}

.project-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

.project-row:hover {
  background: var(--cli-surface-hover);
}

.project-chevron {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cli-text-muted);
  flex-shrink: 0;
}

.project-title {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.6;
}

.project-row:hover .project-actions {
  opacity: 1;
}

.project-action-btn {
  background: transparent;
  border: none;
  color: var(--cli-text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-action-btn:hover {
  color: var(--cli-text);
  background: var(--cli-surface-hover);
}

.project-sessions-list {
  padding-left: 14px;
  margin: 2px 0 4px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-sessions-list.collapsed {
  display: none;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--cli-text-muted);
  transition: all 0.15s ease;
}

.session-row:hover {
  background: var(--cli-surface-hover);
  color: var(--cli-text);
}

.session-row.active {
  background: var(--cli-primary);
  color: var(--cli-primary-fg, #ffffff);
  font-weight: 600;
}

.session-row.active .session-action-btn {
  color: var(--cli-primary-fg, #ffffff);
  opacity: 0.85;
}

.session-title-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.session-row:hover .session-actions {
  opacity: 1;
}

.session-action-btn {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-action-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.session-status-slot {
  width: 14px;
  min-width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-status-slot .session-active-dot {
  margin: 0;
}

.session-status-slot .vd-icon {
  width: 12px;
  height: 12px;
}

.session-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--cli-success, #22c55e);
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.7);
  flex-shrink: 0;
}

@keyframes vd-ai-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.7; }
}

.vd-ai-working {
  animation: vd-ai-pulse 0.9s infinite ease-in-out;
  color: var(--cli-accent, #38bdf8) !important;
  flex-shrink: 0;
}

.session-rename-input {
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-accent);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 11px;
  font-family: inherit;
  width: 100px;
  outline: none;
}

.cli-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Boutons communs */
.btn {
  background: var(--cli-surface-hover);
  color: var(--cli-text);
  border: 1px solid var(--cli-border);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--cli-border);
  color: var(--cli-primary);
}

.btn.active {
  background: var(--cli-primary);
  color: var(--cli-primary-fg, #ffffff);
  border-color: var(--cli-primary);
}

.btn-primary {
  background: var(--cli-primary);
  color: var(--cli-primary-fg, #ffffff);
  border-color: var(--cli-primary);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--cli-primary-hover);
  color: #fff;
}

.btn-success {
  background: var(--cli-success);
  color: #0f172a;
  font-weight: 600;
}

.btn-danger {
  background: var(--cli-danger);
  color: #fff;
}

.hidden {
  display: none !important;
}

.mode-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
}
.mode-plan { background: #3b82f6; color: #fff; }
.mode-act { background: #10b981; color: #fff; }
.mode-goal { background: #9333ea; color: #fff; }
.mode-infinite { background: #ef4444; color: #fff; box-shadow: 0 0 10px rgba(239, 68, 68, 0.45); }
.goal-badge-infinite { background: #ef4444 !important; color: #fff !important; box-shadow: 0 0 8px rgba(239, 68, 68, 0.45); }

.cli-brand-logo {
  object-fit: contain;
  vertical-align: middle;
}

/* Conteneur principal */
.cli-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.cli-sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--cli-surface);
  border-right: 1px solid var(--cli-border);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  height: 100%;
}
.cli-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-right: none;
}

.sidebar-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--cli-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--cli-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
}
.sidebar-toggle-btn:hover {
  background: var(--cli-surface-hover);
  color: var(--cli-text);
}

.sidebar-expand-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 40;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  color: var(--cli-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}
.sidebar-expand-btn:hover {
  color: var(--cli-primary);
  border-color: var(--cli-primary);
  background: var(--cli-surface-hover);
}
.sidebar-expand-btn.hidden {
  display: none !important;
}

.sidebar-tab-btn {
  background: transparent;
  border: none;
  color: var(--cli-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
}
.sidebar-tab-btn.active {
  color: var(--cli-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--cli-primary);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.tree-node {
  display: flex;
  flex-direction: column;
}

.tree-item {
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  position: relative;
  user-select: none;
  min-height: 24px;
}
.tree-item:hover {
  background: var(--cli-surface-hover);
}
.tree-item.tree-dir-item {
  font-weight: 500;
}
.tree-item.drag-over-target {
  background: rgba(56, 189, 248, 0.2) !important;
  outline: 1px dashed var(--cli-primary);
}
.tree-item-label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.tree-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--cli-text-muted);
}
.tree-chevron .vd-icon {
  width: 12px;
  height: 12px;
}
.tree-spacer {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.tree-children {
  display: flex;
  flex-direction: column;
}
.tree-children.hidden {
  display: none !important;
}
.tree-item-empty {
  font-size: 11px;
  color: var(--cli-text-muted);
  font-style: italic;
  padding: 2px 6px;
}
.tree-item-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.tree-item:hover .tree-item-actions {
  display: flex;
}
.tree-action-btn {
  background: transparent;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--cli-text-muted);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tree-action-btn:hover {
  color: var(--cli-primary);
  background: var(--cli-surface);
}

/* Zone centrale Terminal */
.cli-center {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background-color: var(--cli-bg);
  position: relative;
  overflow: hidden;
}

.cli-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-card {
  position: relative;
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  max-width: 96%;
}

/* Ancre sticky : reste collée en haut à droite de la portion visible de la carte
   même lorsque le message dépasse la hauteur du viewport. */
.message-actions-anchor {
  position: sticky;
  top: 12px;
  height: 0;
  z-index: 10;
  pointer-events: none;
}

.message-card-actions {
  position: absolute;
  top: -6px;
  right: -8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 10;
  pointer-events: auto;
}

.message-card:hover .message-card-actions,
.message-card-actions:focus-within {
  opacity: 1;
}

.card-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  color: var(--cli-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.card-action-btn:hover {
  background: var(--cli-surface-hover);
  color: var(--cli-text);
}

.card-action-btn.copied {
  color: var(--cli-success) !important;
}

/* Animation rotation CSS pour sous-agents actifs */
@keyframes vd-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vd-spin {
  display: inline-block;
  animation: vd-spin 1s linear infinite;
  transform-origin: center center;
}

/* Bouton tuer sous-agent dans les actions de carte */
.card-action-kill-agent {
  color: var(--cli-danger, #ef4444);
  font-weight: 600;
}

.card-action-kill-agent:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #dc2626 !important;
}

/* Entrée d'activité d'outil : reflète visuellement chaque outil consommé par l'IA
   (lecture, recherche, exploration, écriture…) dans le flux du raisonnement. */
.tool-activity-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 3px 14px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--cli-text-muted);
  border-left: 2px solid var(--cli-border);
  animation: vd-tool-in 0.18s ease-out;
}

.tool-activity-card .tool-activity-icon,
.tool-activity-card .tool-activity-end {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.tool-activity-card .tool-activity-label {
  font-weight: 600;
  color: var(--cli-text-muted);
  flex: 0 0 auto;
}

.tool-activity-card .tool-activity-target {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--cli-text-muted);
  opacity: 0.9;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-activity-card .tool-activity-result {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.85;
  white-space: nowrap;
}

.tool-activity-running {
  border-left-color: var(--cli-accent, #38bdf8);
}

.tool-activity-done .tool-activity-end {
  color: var(--cli-success);
}

.tool-activity-error {
  border-left-color: var(--cli-danger);
}

.tool-activity-error .tool-activity-end,
.tool-activity-error .tool-activity-result {
  color: var(--cli-danger);
}

@keyframes vd-tool-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

/* Carte de message dédiée aux sous-agents */
.message-subagent {
  border-left: 3px solid var(--cli-accent, #38bdf8);
  background: var(--cli-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.message-subagent.subagent-running {
  border-left-color: var(--cli-accent, #38bdf8);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.message-subagent.subagent-completed {
  border-left-color: var(--cli-success, #22c55e);
}

.message-subagent.subagent-failed {
  border-left-color: var(--cli-danger, #ef4444);
}

.message-subagent.subagent-killed {
  border-left-color: #f59e0b;
}

.subagent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.subagent-title {
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subagent-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--cli-accent, #38bdf8);
}

.subagent-completed .subagent-icon-wrapper {
  color: var(--cli-success, #22c55e);
}

.subagent-failed .subagent-icon-wrapper {
  color: var(--cli-danger, #ef4444);
}

.subagent-killed .subagent-icon-wrapper {
  color: #f59e0b;
}

.subagent-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.subagent-badge.badge-running {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cli-accent, #38bdf8);
}

.subagent-badge.badge-completed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--cli-success, #22c55e);
}

.subagent-badge.badge-failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--cli-danger, #ef4444);
}

.subagent-badge.badge-killed {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.subagent-duration-tag {
  font-size: 11px;
  color: var(--cli-text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.subagent-task-desc {
  font-size: 12px;
  color: var(--cli-text);
  margin-bottom: 6px;
  font-weight: 500;
}

.subagent-status-text {
  font-size: 11px;
  color: var(--cli-text-muted);
  font-style: italic;
  margin-bottom: 4px;
}

.subagent-result-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--cli-bg);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  font-size: 12px;
  max-height: 240px;
  overflow-y: auto;
}

.message-card ul {
  margin: 8px 0 8px 24px;
  padding: 0;
  list-style-type: disc;
}

.message-card li {
  margin: 4px 0;
  line-height: 1.5;
}

.message-card h1, .message-card h2, .message-card h3 {
  margin: 10px 0 6px 0;
}

.message-user {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}
.message-assistant {
  align-self: flex-start;
  width: 100%;
}

/* Panneau d'erreur d'inférence : visuellement distinct d'un message assistant/plan.
   Le détail technique reste local (jamais injecté dans le contexte du LLM). */
.message-error {
  align-self: flex-start;
  width: 100%;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid var(--cli-danger, #ef4444);
  border-left-width: 3px;
}

.message-error-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--cli-danger, #ef4444);
  margin-bottom: 8px;
}

.message-error-title {
  font-size: 13px;
}

.message-error-detail {
  margin: 0 0 8px;
  padding: 8px 10px;
  background: var(--cli-code-bg);
  color: var(--cli-code-text);
  border-radius: 4px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.message-error-hint {
  font-size: 12px;
  color: var(--cli-text-muted);
}

.thinking-block {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--cli-accent);
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: var(--cli-text-muted);
}
.thinking-title {
  font-weight: 600;
  margin-bottom: 4px;
  cursor: pointer;
}

.code-block {
  background: var(--cli-code-bg);
  color: var(--cli-code-text);
  border: 1px solid var(--cli-code-border);
  border-radius: 4px;
  padding: 10px;
  margin: 8px 0;
  overflow-x: auto;
}
.inline-code {
  background: var(--cli-inline-code-bg);
  color: var(--cli-text);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Coloration syntaxique à la demande (JSON, CSS, HTML) */
.code-block.syntax-highlighted {
  line-height: 1.5;
}
.syn-key { color: #38bdf8; font-weight: 600; }
.syn-string { color: #4ade80; }
.syn-number { color: #fb923c; }
.syn-boolean { color: #c084fc; font-weight: 600; }
.syn-null { color: #f87171; font-style: italic; }
.syn-punct { color: #94a3b8; }
.syn-comment { color: #64748b; font-style: italic; }
.syn-doctype { color: #e879f9; font-weight: 600; }
.syn-tag { color: #f43f5e; font-weight: 600; }
.syn-attr { color: #38bdf8; }
.syn-selector { color: #e879f9; font-weight: 600; }
.syn-property { color: #38bdf8; font-weight: 500; }
.syn-value { color: #4ade80; }
.syn-atrule { color: #fb923c; font-weight: 600; }

[data-theme="light"] .syn-key,
[data-theme="visidog"] .syn-key { color: #0284c7; }
[data-theme="light"] .syn-string,
[data-theme="visidog"] .syn-string { color: #15803d; }
[data-theme="light"] .syn-number,
[data-theme="visidog"] .syn-number { color: #c2410c; }
[data-theme="light"] .syn-boolean,
[data-theme="visidog"] .syn-boolean { color: #7e22ce; }
[data-theme="light"] .syn-null,
[data-theme="visidog"] .syn-null { color: #b91c1c; }
[data-theme="light"] .syn-punct,
[data-theme="visidog"] .syn-punct { color: #64748b; }
[data-theme="light"] .syn-comment,
[data-theme="visidog"] .syn-comment { color: #94a3b8; }
[data-theme="light"] .syn-doctype,
[data-theme="visidog"] .syn-doctype { color: #a21caf; }
[data-theme="light"] .syn-tag,
[data-theme="visidog"] .syn-tag { color: #be123c; }
[data-theme="light"] .syn-attr,
[data-theme="visidog"] .syn-attr { color: #0369a1; }
[data-theme="light"] .syn-selector,
[data-theme="visidog"] .syn-selector { color: #a21caf; }
[data-theme="light"] .syn-property,
[data-theme="visidog"] .syn-property { color: #0284c7; }
[data-theme="light"] .syn-value,
[data-theme="visidog"] .syn-value { color: #15803d; }
[data-theme="light"] .syn-atrule,
[data-theme="visidog"] .syn-atrule { color: #c2410c; }

/* Neutralisation visuelle des cartes de message vides (garde de sécurité) */
.message-card.is-empty-card {
  display: none !important;
}

/* Diff formatting */
.diff-container {
  border: 1px solid var(--cli-border);
  border-radius: 6px;
  margin: 10px 0;
  overflow: hidden;
  background: var(--cli-code-bg);
  color: var(--cli-code-text);
}
.diff-header {
  background: var(--cli-surface);
  padding: 6px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--cli-border);
}
.diff-body {
  font-family: inherit;
  font-size: 12px;
  overflow-x: auto;
}
.diff-line { padding: 1px 10px; white-space: pre-wrap; }
.diff-meta { color: #94a3b8; }
.diff-hunk { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.diff-add { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.diff-del { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.diff-ctx { color: #cbd5e1; }

.diff-actions {
  padding: 8px 12px;
  background: var(--cli-surface);
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--cli-border);
}

/* Live Preview Split */
.cli-preview-pane {
  width: 45%;
  min-width: 220px;
  background: var(--cli-surface);
  border-left: 1px solid var(--cli-border);
  display: flex;
  flex-direction: column;
  position: relative;
}
.cli-preview-pane.hidden { display: none; }

/* Mode Plein Écran pour le Live Preview */
.cli-preview-pane:fullscreen,
.cli-preview-pane:-webkit-full-screen,
.cli-preview-pane.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 10000 !important;
  background: var(--cli-bg, #0f172a);
  border-left: none !important;
}

.cli-preview-pane:fullscreen .preview-resizer-v,
.cli-preview-pane:-webkit-full-screen .preview-resizer-v,
.cli-preview-pane.is-fullscreen .preview-resizer-v {
  display: none !important;
}

/* Barre de séparation verticale déplaçable (Message <-> Live Preview) */
.preview-resizer-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  z-index: 20;
  transition: background 0.15s ease;
}

.preview-resizer-v:hover,
.preview-resizer-v.resizing {
  background: var(--cli-accent, #6366f1);
}

/* Calque transparent affiché uniquement pendant le drag du séparateur : il coiffe
   l'iframe de prévisualisation (qui capturerait sinon les événements souris) et
   permet un déplacement fluide vers la gauche comme vers la droite. */
.preview-drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  cursor: col-resize;
  background: transparent;
}

.preview-header {
  padding: 6px 10px;
  border-bottom: 1px solid var(--cli-border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  box-sizing: border-box;
  flex-shrink: 0;
  min-height: 38px;
}

.preview-header::-webkit-scrollbar {
  height: 4px;
}

.preview-header::-webkit-scrollbar-track {
  background: transparent;
}

.preview-header::-webkit-scrollbar-thumb {
  background: var(--cli-border);
  border-radius: 2px;
}

.preview-header::-webkit-scrollbar-thumb:hover {
  background: var(--cli-text-muted);
}

.preview-meta {
  font-size: 11px;
  color: var(--cli-text-muted);
  white-space: nowrap;
}

.preview-meta-file {
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  color: var(--cli-text);
  max-width: none;
}

.preview-preset-select {
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  height: 24px;
}

.preview-preset-select:focus {
  border-color: var(--cli-accent, #6366f1);
}

.preview-header-spacer {
  flex: 1 1 auto;
  min-width: 6px;
}

.preview-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.preview-header-actions .btn {
  flex-shrink: 0;
}
.preview-iframe {
  flex: 1;
  border: none;
  background: #fff;
}

/* Barre de séparation au-dessus du container du prompt */
.prompt-resizer-h {
  height: 6px;
  cursor: row-resize;
  background: var(--cli-border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.15s ease;
}

.prompt-resizer-h:hover,
.prompt-resizer-h.resizing {
  background: var(--cli-accent, #6366f1);
}

/* Input Area */
.cli-input-area {
  position: relative;
  padding: 10px 16px;
  background: var(--cli-surface);
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Menu d'aide et d'autocomplétion des commandes */
.cli-autocomplete {
  position: absolute;
  bottom: 100%;
  left: 16px;
  right: 16px;
  max-height: 250px;
  overflow-y: auto;
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  border-radius: 6px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.cli-autocomplete.hidden {
  display: none !important;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--cli-border);
  font-size: 12px;
  transition: background 0.1s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--cli-surface-hover);
}

.autocomplete-cmd {
  font-weight: 700;
  color: var(--cli-accent);
  font-family: monospace;
}

.autocomplete-usage {
  color: var(--cli-text-muted);
  font-size: 11px;
  margin-left: 8px;
}

.autocomplete-desc {
  color: var(--cli-text-muted);
  font-size: 11px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

/* Panneau de sélection d'espace de travail Sidebar */
.sidebar-workspace-box {
  padding: 10px;
  border-bottom: 1px solid var(--cli-border);
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background-color 0.15s ease, outline 0.15s ease;
}
.sidebar-workspace-box.drag-over-target {
  background: rgba(56, 189, 248, 0.2) !important;
  outline: 1px dashed var(--cli-primary);
}

.sidebar-workspace-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cli-text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-fsa {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--cli-success);
}

.badge-opfs {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(72, 152, 216, 0.15);
  color: var(--cli-accent);
}

.w-full {
  width: 100%;
}
.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}
.input-row {
  flex: 1;
  min-height: 38px;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* Boutons Envoyer / Arrêter : hauteur fixe et centrage vertical,
   indépendamment de la hauteur redimensionnable de la zone de saisie. */
.input-row > #btn-send,
.input-row > #btn-stop {
  align-self: center;
  flex: 0 0 auto;
  height: 34px;
}
.cli-textarea {
  flex: 1;
  height: 100%;
  min-height: 38px;
  max-height: none;
  background: var(--cli-bg);
  border: 1px solid var(--cli-border);
  color: var(--cli-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
}
.cli-textarea:focus {
  outline: none;
  border-color: var(--cli-primary);
}

.input-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toolbar-actions { display: flex; gap: 6px; }

/* Status Bar */
.cli-status-bar {
  height: 28px;
  background-color: var(--cli-surface);
  border-top: 1px solid var(--cli-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  color: var(--cli-text-muted);
  user-select: none;
}
.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  border-radius: 8px;
  width: 550px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-box.modal-xl {
  width: 920px;
  max-width: 95vw;
  height: 85vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#editor-modal .modal-body {
  padding: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editor-textarea {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  padding: 12px;
  font-family: var(--cli-font);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  box-sizing: border-box;
  outline: none;
}
.editor-textarea:focus {
  border-color: var(--cli-accent);
}

.image-viewer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--cli-bg);
  border: 1px solid var(--cli-border);
  border-radius: 6px;
  max-height: 60vh;
  overflow: auto;
  width: 100%;
  box-sizing: border-box;
}

.image-viewer-container img {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#explorer-content.drag-active {
  outline: 2px dashed var(--cli-accent) !important;
  outline-offset: -4px;
  background-color: var(--cli-surface-hover) !important;
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cli-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--cli-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group label {
  font-size: 12px;
  color: var(--cli-text-muted);
}
.form-control {
  background: var(--cli-bg);
  border: 1px solid var(--cli-border);
  color: var(--cli-text);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: inherit;
}

.graph-container {
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  border-radius: 6px;
  padding: 12px;
  margin: 10px 0;
  overflow-x: auto;
  text-align: center;
}

.graph-container svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.terminal-img {
  border: 1px solid var(--cli-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.terminal-img:hover {
  transform: scale(1.01);
}

@media (max-width: 768px) {
  .cli-sidebar {
    position: absolute;
    left: 0;
    top: 48px;
    bottom: 28px;
    z-index: 50;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
  }
  .cli-sidebar.collapsed {
    display: none;
  }
}

/* Modèles LLM & Hauteur de raisonnement */
.model-select-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-select {
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  max-width: 220px;
}

.model-select:focus {
  border-color: var(--cli-accent);
}

.reasoning-select {
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-primary);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.custom-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-actions-select {
  background: var(--cli-bg);
  color: var(--cli-text);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  max-width: 220px;
}

.custom-actions-select:focus {
  border-color: var(--cli-accent);
}

.custom-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  border-radius: 4px;
  padding: 6px 10px;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.custom-action-item:hover {
  border-color: var(--cli-accent);
}

.model-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cli-surface);
  border: 1px solid var(--cli-border);
  border-radius: 5px;
  padding: 8px 12px;
  transition: border-color 0.15s ease;
}

.model-item-card.is-active {
  border-color: var(--cli-primary);
  background: rgba(72, 152, 216, 0.05);
}

.model-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-item-title {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-item-meta {
  font-size: 11px;
  color: var(--cli-text-muted);
}

.badge-reasoning {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(147, 51, 234, 0.15);
  color: #a855f7;
  font-weight: 600;
}

.badge-cheap {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.model-item-card.is-cheap {
  border-left: 3px solid #22c55e;
}

.topbar-model-select {
  height: 28px;
  max-width: 200px;
  font-size: 11px;
}

/* Bouton Text-to-Speech (Restitution Vocale) */
#btn-tts-toggle {
  transition: all 0.2s ease;
  position: relative;
}

#btn-tts-toggle.active {
  background: var(--cli-accent, #3b82f6);
  color: #ffffff;
  border-color: var(--cli-accent, #3b82f6);
}

#btn-tts-toggle.is-speaking {
  animation: tts-speaking-pulse 1.2s infinite ease-in-out;
}

.card-speak-btn {
  color: var(--cli-text-muted);
}

.card-speak-btn:hover {
  color: var(--cli-accent, #3b82f6);
}

@keyframes tts-speaking-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; filter: brightness(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Badges de vérification formelle (Output Tokens Optimization) */
.verification-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.verification-badge.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.verification-badge.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.verification-badge.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.verification-badge.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}


.vd-icon-rag {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E");
}

/* Toggle RAG (header Fichiers du projet) :
   - actif   : icône filaire verte
   - inactif : couleur standard
   - busy    : orange, non cliquable (init / bootstrap IA / resynchro en cours) */
.rag-toggle.rag-active {
  color: #22c55e;
}
.rag-toggle.rag-busy {
  color: #f59e0b;
  pointer-events: none;
  opacity: 0.85;
}

/* ==========================================================================
   Interactive Clarification & Goal Refinement Card (ask_question)
   ========================================================================== */
.question-clarification-card {
  border-left: 4px solid var(--cli-accent, #3b82f6) !important;
  background: var(--cli-bg-card, #1e2430) !important;
  border-radius: 6px;
  padding: 14px 16px;
  margin: 10px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.question-clarification-card .question-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cli-accent, #3b82f6);
}

.question-clarification-card .question-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--cli-text, #f1f5f9);
  margin-bottom: 12px;
}

.question-clarification-card .question-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.question-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--cli-bg-input, #0f141c);
  border: 1px solid var(--cli-border, #334155);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.question-option-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--cli-accent, #3b82f6);
}

.question-option-item.is-recommended {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.04);
}

.question-option-badge {
  font-family: var(--cli-font-mono, monospace);
  font-size: 11px;
  color: var(--cli-text-dim, #94a3b8);
  min-width: 20px;
}

.question-option-label {
  flex: 1;
  font-size: 13px;
  color: var(--cli-text, #f1f5f9);
}

.badge-recommended {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-option-custom {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.question-custom-text {
  margin-left: 28px;
  width: calc(100% - 28px);
  background: var(--cli-bg-input, #0f141c);
  border: 1px solid var(--cli-border, #334155);
  color: var(--cli-text, #f1f5f9);
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 4px;
}

.question-custom-text:focus {
  border-color: var(--cli-accent, #3b82f6);
  outline: none;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-confirmed-badge {
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  font-size: 13px;
  color: var(--cli-text, #f1f5f9);
}
