/* ===== Compléments à la maquette : éléments propres à l'application ===== */

/* Réponses en Markdown (titres, listes, code, tableaux) */
#opti-design .op-answer-content h1,
#opti-design .op-answer-content h2,
#opti-design .op-answer-content h3,
#opti-design .op-answer-content h4 { font-size: 14px; font-weight: 600; letter-spacing: -.2px; line-height: 1.5; margin: 18px 0 8px; }
#opti-design .op-answer-content h1 { font-size: 17px; }
#opti-design .op-answer-content h2 { font-size: 15px; }
#opti-design .op-answer-content ul,
#opti-design .op-answer-content ol { padding-left: 20px; margin: 0 0 12px; }
#opti-design .op-answer-content li { margin: 5px 0; }
#opti-design .op-answer-content strong { font-weight: 600; }
#opti-design .op-answer-content a { color: var(--op-blue); }
#opti-design .op-answer-content blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--op-blue); color: var(--op-muted); }
#opti-design .op-answer-content hr { border: 0; border-top: 1px solid var(--op-border); margin: 18px 0; }
#opti-design .op-answer-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; background: var(--op-soft); padding: 1px 5px; border-radius: 5px; }
#opti-design .op-answer-content pre { background: var(--op-soft); border: 1px solid var(--op-border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 0 0 12px; }
#opti-design .op-answer-content pre code { background: none; padding: 0; font-size: 12px; line-height: 1.6; }
#opti-design .op-answer-content table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 12px; display: block; overflow-x: auto; }
#opti-design .op-answer-content th,
#opti-design .op-answer-content td { border: 1px solid var(--op-border); padding: 6px 10px; text-align: left; }
#opti-design .op-answer-content th { background: var(--op-soft); font-weight: 600; }

/* Curseur clignotant pendant la génération */
#opti-design .op-answer.is-streaming .op-answer-content > :last-child::after,
#opti-design .op-answer.is-streaming .op-answer-content:empty::after {
  content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 3px;
  vertical-align: -2px; background: var(--op-blue); border-radius: 1px;
  animation: op-blink 1s steps(2, start) infinite;
}
@keyframes op-blink { to { visibility: hidden; } }

/* Message d'erreur dans une réponse */
#opti-design .op-answer-error { color: #a75751; background: color-mix(in srgb, #a75751 8%, transparent); border-radius: 8px; padding: 10px 12px; }

/* Bouton d'envoi transformé en « stop » pendant la génération */
#opti-design .op-send.is-stop { background: var(--op-ink); }
#opti-design .op-send.is-stop:hover { background: var(--op-muted); }

/* Les actions n'apparaissent qu'une fois la réponse terminée */
#opti-design .op-answer.is-streaming .op-answer-actions { visibility: hidden; }

/* Historique vide */
#opti-design .op-empty-history { font-size: 11px; color: var(--op-faint); padding: 6px 9px; }

/* Pas de contour navigateur dans le composer (le cadre bleu suffit) */
#opti-design .op-composer textarea:focus { outline: none; }

/* Les retours à la ligne des messages utilisateur sont conservés */
#opti-design .op-user-message { white-space: pre-wrap; }

/* Réponse interrompue par l'utilisateur */
#opti-design .op-answer-interrupted { font-size: 11px; color: var(--op-faint); margin-top: 4px; font-style: italic; }

/* Le bouton « … » d'une conversation n'apparaît qu'au survol (toujours visible si actif ou au clavier) */
#opti-design .op-thread-row > .op-icon { opacity: 0; }
#opti-design .op-thread-row:hover > .op-icon,
#opti-design .op-thread-row.is-active > .op-icon,
#opti-design .op-thread-row > .op-icon:focus-visible,
#opti-design .op-thread-row > .op-icon[aria-expanded="true"] { opacity: 1; }
@media (pointer: coarse) { #opti-design .op-thread-row > .op-icon { opacity: 1; } }

/* Boutons secondaires des modales */
#opti-design .op-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
#opti-design .op-secondary { padding: 10px 18px; font-size: 11px; border: 1px solid var(--op-border); border-radius: 30px; color: var(--op-muted); }
#opti-design .op-secondary:hover { background: var(--op-soft); color: var(--op-blue); }
#opti-design .op-danger { background: #aa5450 !important; }
#opti-design .op-danger:hover { background: #8e3f3b !important; }

/* Erreur de connexion */
#opti-design .op-login-error { font-size: 11px; color: #a75751; background: color-mix(in srgb, #a75751 8%, transparent); border-radius: 8px; padding: 9px 11px; margin: -6px 0 14px; }
#opti-design .op-login-submit:disabled { opacity: .6; }
/* Champs de connexion : pas de fond blanc imposé par l'auto-remplissage du navigateur */
#opti-design .op-input-wrap input:-webkit-autofill,
#opti-design .op-input-wrap input:-webkit-autofill:hover,
#opti-design .op-input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--op-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--op-bg) inset;
  transition: background-color 9999s;
}
#opti-design .op-input-wrap input:focus { outline: none; }

/* ===== Pièces jointes ===== */
#opti-design .op-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
#opti-design .op-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 280px; font-size: 11px; color: var(--op-blue); background: var(--op-soft); border: 1px solid var(--op-border); padding: 5px 6px 5px 9px; border-radius: 8px; }
#opti-design .op-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
#opti-design .op-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-chip small { color: var(--op-faint); font-size: 10px; flex-shrink: 0; }
#opti-design .op-chip button { display: flex; padding: 1px; border-radius: 4px; color: var(--op-muted); }
#opti-design .op-chip button:hover { color: #a75751; }
#opti-design .op-chip button svg { width: 13px; height: 13px; }
#opti-design .op-chip.is-uploading { opacity: .65; }
#opti-design .op-chip.is-uploading svg:first-child { animation: op-spin 1s linear infinite; }
@keyframes op-spin { to { transform: rotate(360deg); } }
#opti-design .op-message-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0 0 8px auto; max-width: 85%; }
#opti-design .op-composer.is-dragover { border-color: var(--op-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--op-blue) 18%, transparent); background: var(--op-soft); }

/* ===== Encart d'analyse (code exécuté + résultat) ===== */
#opti-design .op-analysis { border: 1px solid var(--op-border); border-radius: 10px; margin: 0 0 12px; background: var(--op-surface); overflow: hidden; }
#opti-design .op-analysis > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 11px; font-weight: 600; color: var(--op-muted); }
#opti-design .op-analysis > summary::-webkit-details-marker { display: none; }
#opti-design .op-analysis > summary svg { width: 14px; height: 14px; color: var(--op-blue); }
#opti-design .op-analysis > summary .op-chevron { margin-left: auto; transition: transform .16s; color: var(--op-faint); }
#opti-design .op-analysis[open] > summary .op-chevron { transform: rotate(90deg); }
#opti-design .op-analysis.is-error > summary { color: #a75751; }
#opti-design .op-analysis.is-running > summary svg:first-child { animation: op-spin 1s linear infinite; }
#opti-design .op-analysis pre { margin: 0 12px 12px; }
#opti-design .op-analysis .op-analysis-label { font-size: 10px; letter-spacing: 1px; color: var(--op-faint); margin: 2px 12px 5px; font-weight: 600; }

/* ===== Recherche web ===== */
#opti-design .op-sources { border: 1px solid var(--op-border); border-radius: 10px; background: var(--op-surface); margin: 0 0 14px; padding: 10px 12px; }
#opti-design .op-sources-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--op-muted); }
#opti-design .op-sources-head svg { width: 14px; height: 14px; color: var(--op-blue); flex-shrink: 0; }
#opti-design .op-sources.is-running .op-sources-head svg { animation: op-spin 1s linear infinite; }
#opti-design .op-sources-head em { font-style: normal; font-weight: 500; color: var(--op-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-sources ol { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; }
#opti-design .op-sources li { margin: 0; }
#opti-design .op-sources a { display: flex; gap: 8px; align-items: baseline; font-size: 11px; color: var(--op-ink); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
#opti-design .op-sources a:hover { background: var(--op-soft); color: var(--op-blue); }
#opti-design .op-sources a b { color: var(--op-blue); font-weight: 600; flex-shrink: 0; }
#opti-design .op-sources a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-sources a small { color: var(--op-faint); flex-shrink: 0; margin-left: auto; }
#opti-design .op-cite { display: inline-block; font-size: 10px; font-weight: 600; line-height: 1; color: var(--op-blue); background: var(--op-soft); border-radius: 4px; padding: 2px 4px; margin: 0 1px; text-decoration: none; vertical-align: 1px; }
#opti-design .op-cite:hover { background: var(--op-blue); color: var(--op-on-blue, #fff); }
#opti-design .op-tool-label.is-on { color: var(--op-blue); font-weight: 600; }
#opti-design .op-switch-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--op-border); font-size: 12px; cursor: pointer; }
#opti-design .op-switch-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--op-blue); }
#opti-design .op-switch-row span { flex: 1; }
#opti-design .op-switch-row small { display: block; font-size: 11px; color: var(--op-faint); }

/* ===== Taille du texte (préférence utilisateur) ===== */
#opti-design[data-text-size="grand"] .op-chat-content { zoom: 1.12; }
#opti-design[data-text-size="tres-grand"] .op-chat-content { zoom: 1.25; }
#opti-design[data-text-size="grand"] .op-composer textarea { font-size: 14px; }
#opti-design[data-text-size="tres-grand"] .op-composer textarea { font-size: 15px; }

/* ===== Grande fenêtre à onglets (Réglages, Administration) ===== */
#opti-design .op-modal.is-wide { width: min(900px, 100%); padding: 0; overflow: hidden; }
#opti-design .op-modal.is-wide > header { padding: 18px 22px; margin: 0; border-bottom: 1px solid var(--op-border); }
#opti-design .op-modal.is-wide .op-modal-body { padding: 0; }
#opti-design .op-panes { display: grid; grid-template-columns: 200px minmax(0, 1fr); height: min(620px, calc(100vh / var(--ui-zoom, 1) - 190px)); height: min(620px, calc(100dvh / var(--ui-zoom, 1) - 190px)); }
#opti-design .op-modal-backdrop { overflow-y: auto; }   /* si la fenêtre dépasse malgré tout, elle défile dans le voile, la page ne bouge pas */
#opti-design .op-tabs { border-right: 1px solid var(--op-border); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--op-bg); overflow-y: auto; }
#opti-design .op-tabs button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 12px; color: var(--op-muted); text-align: left; }
#opti-design .op-tabs button svg { width: 16px; height: 16px; }
#opti-design .op-tabs button:hover { background: var(--op-soft); color: var(--op-blue); }
#opti-design .op-tabs button[aria-selected="true"] { background: var(--op-surface); color: var(--op-blue); font-weight: 600; box-shadow: 0 1px 4px var(--op-shadow); }
#opti-design .op-pane { padding: 22px 26px 28px; overflow-y: auto; font-size: 12px; color: var(--op-ink); }
#opti-design .op-pane h3 { font-size: 13px; font-weight: 600; margin: 0 0 4px; }
#opti-design .op-pane .op-hint { font-size: 11px; color: var(--op-faint); margin: 2px 0 12px; line-height: 1.6; }
#opti-design .op-pane section + section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--op-border); }
#opti-design .op-field { margin-bottom: 14px; }
#opti-design .op-field > label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 6px; color: var(--op-ink); }
#opti-design .op-pane input[type=text], #opti-design .op-pane input[type=password], #opti-design .op-pane input[type=number],
#opti-design .op-pane input[type=url], #opti-design .op-pane select, #opti-design .op-pane textarea {
  width: 100%; background: var(--op-bg); border: 1px solid var(--op-border); border-radius: 9px; padding: 9px 11px; color: var(--op-ink); font-size: 12px; }
#opti-design .op-pane textarea { resize: vertical; line-height: 1.6; }
#opti-design .op-pane input:focus, #opti-design .op-pane select:focus, #opti-design .op-pane textarea:focus { outline: none; border-color: var(--op-blue); }
#opti-design .op-choices { display: flex; flex-wrap: wrap; gap: 6px; }
#opti-design .op-choices label { cursor: pointer; position: relative; }
/* Radio invisible ancré sur sa pastille : sinon il se place par rapport à la fenêtre, hors de la zone qui défile, et le clic (focus)
   fait défiler toute la fenêtre pour l'atteindre (le cadre « remonte »). */
#opti-design .op-choices input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
#opti-design .op-choices span { display: inline-block; padding: 7px 13px; border: 1px solid var(--op-border); border-radius: 30px; font-size: 11px; color: var(--op-muted); }
#opti-design .op-choices input:checked + span { border-color: var(--op-blue); background: var(--op-soft); color: var(--op-blue); font-weight: 600; }
#opti-design .op-choices input:focus-visible + span { outline: 2px solid var(--op-blue); outline-offset: 2px; }
#opti-design .op-toggle { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
#opti-design .op-toggle span { flex: 1; }
#opti-design .op-toggle small { display: block; font-size: 11px; color: var(--op-faint); margin-top: 2px; }
#opti-design .op-toggle input { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: var(--op-border); position: relative; cursor: pointer; flex-shrink: 0; transition: background .16s; }
#opti-design .op-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .16s; box-shadow: 0 1px 3px #0003; }
#opti-design .op-toggle input:checked { background: var(--op-blue); }
#opti-design .op-toggle input:checked::after { transform: translateX(16px); }
#opti-design .op-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#opti-design .op-pane-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
#opti-design .op-pane-actions .op-primary { padding: 10px 20px; font-size: 11px; }
#opti-design .op-link { color: var(--op-blue); font-size: 11px; padding: 0; }
#opti-design .op-range { display: flex; align-items: center; gap: 12px; }
#opti-design .op-range input { flex: 1; accent-color: var(--op-blue); }
#opti-design .op-range output { min-width: 34px; font-weight: 600; color: var(--op-blue); }

/* Tableau des comptes */
#opti-design .op-table { width: 100%; border-collapse: collapse; font-size: 11px; }
#opti-design .op-table th { text-align: left; font-weight: 600; color: var(--op-faint); letter-spacing: .5px; padding: 8px 6px; border-bottom: 1px solid var(--op-border); font-size: 10px; text-transform: uppercase; }
#opti-design .op-table td { padding: 9px 6px; border-bottom: 1px solid var(--op-border); vertical-align: middle; }
#opti-design .op-table td small { display: block; color: var(--op-faint); }
#opti-design .op-table .op-icon { width: 28px; height: 28px; padding: 5px; }
#opti-design .op-table .op-icon svg { width: 15px; height: 15px; }
#opti-design .op-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; background: var(--op-soft); color: var(--op-blue); }
#opti-design .op-badge.is-off { background: color-mix(in srgb, #a75751 12%, transparent); color: #a75751; }
#opti-design .op-inline-form { background: var(--op-bg); border: 1px solid var(--op-border); border-radius: 10px; padding: 14px; margin: 12px 0; }

/* Statistiques */
#opti-design .op-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 22px; }
#opti-design .op-kpi { background: var(--op-bg); border: 1px solid var(--op-border); border-radius: 12px; padding: 13px 14px; }
#opti-design .op-kpi strong { display: block; font-size: 22px; font-weight: 700; color: var(--op-blue); letter-spacing: -.5px; }
#opti-design .op-kpi span { font-size: 11px; color: var(--op-muted); }
#opti-design .op-bars { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding: 8px 0 0; border-bottom: 1px solid var(--op-border); }
#opti-design .op-bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
#opti-design .op-bars i { display: block; width: 100%; max-width: 26px; background: var(--op-blue); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
#opti-design .op-bars b { font-size: 9px; font-weight: 500; color: var(--op-faint); }
#opti-design .op-bars-labels { display: flex; gap: 5px; margin-top: 4px; }
#opti-design .op-bars-labels span { flex: 1; text-align: center; font-size: 9px; color: var(--op-faint); }

@media (max-width: 650px) {
  #opti-design .op-panes { grid-template-columns: 1fr; height: auto; max-height: calc(100dvh - 160px); }
  #opti-design .op-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--op-border); }
  #opti-design .op-tabs button { white-space: nowrap; }
  #opti-design .op-grid2 { grid-template-columns: 1fr; }
}

/* Erreur dans un formulaire (fenêtres Réglages / Administration) */
#opti-design .op-form-error { font-size: 11px; color: #a75751; background: color-mix(in srgb, #a75751 8%, transparent); border-radius: 8px; padding: 9px 11px; margin: 4px 0 12px; }
#opti-design .op-pw-row { display: flex; gap: 8px; align-items: center; }
#opti-design .op-pw-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .3px; }
#opti-design .op-pw-row .op-secondary { padding: 8px 14px; white-space: nowrap; }

/* Alertes de lecture (pages non lues, sections en échec) */
#opti-design .op-warn { font-size: 11px; color: #a86a12; background: color-mix(in srgb, #d9932b 12%, transparent); border-radius: 6px; padding: 5px 8px; margin: 3px 6px 5px; line-height: 1.5; }
#opti-design .op-chip small.is-warn { color: #a86a12; font-weight: 600; }

/* Logo cliquable : retour à l'accueil */
#opti-design a.op-brand { display: block; text-decoration: none; color: inherit; cursor: pointer; border-radius: 10px; transition: opacity .15s; }
#opti-design a.op-brand:hover { opacity: .8; }
#opti-design a.op-brand:focus-visible { outline: 2px solid var(--op-blue); outline-offset: 4px; }

/* Message sur l'écran de connexion (déconnexion automatique, session expirée) */
#opti-design .op-login-notice { font-size: 11px; line-height: 1.5; color: var(--op-blue); background: var(--op-soft); border: 1px solid var(--op-border); border-radius: 8px; padding: 10px 12px; margin: -6px 0 14px; }

/* Journal d'audit */
#opti-design .op-audit-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
#opti-design .op-audit-filters select { width: auto; min-width: 170px; }
#opti-design .op-audit-filters input { flex: 1; min-width: 180px; width: auto; }
#opti-design .op-audit-filters .op-secondary { padding: 8px 14px; white-space: nowrap; }
#opti-design .op-table td { font-size: 11px; }

/* Menu de téléchargement d'une réponse (même style que le menu d'une conversation) */
#opti-design .op-export-menu { position: fixed; z-index: 28; width: 250px; padding: 8px; background: var(--op-surface); border: 1px solid var(--op-border); box-shadow: 0 12px 38px #12365325; border-radius: 13px; }
#opti-design .op-export-menu > button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px; border-radius: 7px; font-size: 11px; line-height: 1.5; }
#opti-design .op-export-menu > button svg { width: 16px; height: 16px; color: var(--op-muted); }
#opti-design .op-export-menu > button:hover:not(:disabled) { background: var(--op-soft); color: var(--op-blue); }
#opti-design .op-export-menu > button:hover:not(:disabled) svg { color: var(--op-blue); }
#opti-design .op-export-menu > button:disabled { opacity: .45; cursor: not-allowed; }

/* Fichiers produits par l'analyse : graphiques et documents */
#opti-design .op-files { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
#opti-design .op-figure { margin: 0; max-width: 620px; border: 1px solid var(--op-border); border-radius: 12px; overflow: hidden; background: #fff; }
#opti-design .op-figure img { display: block; width: 100%; height: auto; background: #fff; }
#opti-design .op-figure figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 11px; color: var(--op-muted); background: var(--op-surface); border-top: 1px solid var(--op-border); }
#opti-design .op-file-card { display: flex; align-items: center; gap: 10px; max-width: 620px; padding: 10px 12px; border: 1px solid var(--op-border); border-radius: 12px; background: var(--op-surface); font-size: 12px; }
#opti-design .op-file-card > svg { width: 18px; height: 18px; color: var(--op-blue); flex-shrink: 0; }
#opti-design .op-file-card .op-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--op-ink); }
#opti-design .op-file-card small { color: var(--op-faint); font-size: 11px; }
#opti-design .op-file-dl { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--op-blue); text-decoration: none; padding: 5px 10px; border: 1px solid var(--op-border); border-radius: 30px; white-space: nowrap; }
#opti-design .op-file-dl:hover { background: var(--op-soft); }
#opti-design .op-file-dl svg { width: 14px; height: 14px; }

/* Bouton « Télécharger » sous une réponse : visible, avec son texte */
#opti-design .op-answer-actions .op-export-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--op-blue); border: 1px solid var(--op-border); border-radius: 30px; background: transparent; }
#opti-design .op-answer-actions .op-export-btn svg { width: 14px; height: 14px; }
#opti-design .op-answer-actions .op-export-btn:hover, #opti-design .op-answer-actions .op-export-btn[aria-expanded="true"] { background: var(--op-soft); }

/* Liens « Télécharger » écrits par le modèle et rendus actifs par l'application */
#opti-design a.op-dl-link { display: inline-block; margin: 2px 2px; padding: 3px 11px; font-size: 12px; font-weight: 600; color: var(--op-blue); border: 1px solid var(--op-border); border-radius: 30px; text-decoration: none; cursor: pointer; background: var(--op-soft); }
#opti-design a.op-dl-link:hover { background: var(--op-blue); color: var(--op-on-blue, #fff); }
#opti-design a.op-dl-link:focus-visible { outline: 2px solid var(--op-blue); outline-offset: 2px; }

/* Document rédigé par le modèle : cadre à part, c'est ce qui est exporté */
#opti-design .op-document { position: relative; margin: 18px 0 14px; padding: 22px 26px 12px; background: var(--op-surface); border: 1px solid var(--op-border); border-radius: 12px; box-shadow: 0 1px 4px #0d2a4a12; }
#opti-design .op-document::before { content: attr(data-label); position: absolute; top: -9px; left: 16px; padding: 0 8px; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--op-blue); background: var(--op-bg); }
#opti-design .op-document > :first-child { margin-top: 0; }

/* ===== Zone de saisie : fondu doux sur toute la largeur, plus de rectangle qui coupe la conversation ===== */
#opti-design .op-conversation { --conv-pad: 42px; }
@media (max-width: 650px) { #opti-design .op-conversation { --conv-pad: 18px; } }
#opti-design .op-chat-dock {
  width: auto; max-width: none;
  margin: auto calc(-1 * var(--conv-pad)) 0;            /* annule le retrait latéral : le fond couvre toute la largeur */
  padding: 34px var(--conv-pad) 15px;
  background: linear-gradient(to bottom, transparent 0, var(--op-bg) 30px);   /* le texte s'efface en douceur sous la saisie */
  pointer-events: none;                                  /* la zone de fondu ne bloque pas le clic sur le texte */
}
#opti-design .op-chat-dock > * { max-width: 820px; margin-left: auto; margin-right: auto; pointer-events: auto; }

/* ===== Un contenu large (code, tableau, ligne sans espace) ne doit jamais faire déborder la réponse ===== */
#opti-design .op-answer-body, #opti-design .op-answer-content { min-width: 0; }
#opti-design .op-answer-content { overflow-wrap: anywhere; }
#opti-design .op-document { max-width: 100%; box-sizing: border-box; min-width: 0; overflow: visible; overflow-wrap: anywhere; }   /* overflow-x couperait l'étiquette posée sur la bordure */
#opti-design .op-answer-content pre { max-width: 100%; overflow-x: auto; }
#opti-design .op-answer-content table { display: block; max-width: 100%; overflow-x: auto; }

/* Carte d'appel à une connexion API */
#opti-design .op-sources.op-tool { margin: 6px 0 10px; padding: 8px 12px; }
#opti-design .op-sources.op-tool.is-error { border-color: color-mix(in srgb, #a75751 45%, var(--op-border)); }
#opti-design .op-sources.op-tool.is-error .op-sources-head, #opti-design .op-sources.op-tool.is-error svg { color: #a75751; }
#opti-design #op-conn-list .op-toggle small { display: block; color: var(--op-faint); font-size: 11px; margin-top: 2px; }

/* ===== Dossiers ===== */
#opti-design .op-folders { margin: 0 0 4px; max-height: calc(42vh / var(--ui-zoom, 1)); overflow-y: auto; }   /* beaucoup de dossiers dépliés : la zone défile au lieu de pousser la liste hors écran */
#opti-design .op-folder-item { display: block; }   /* « .op-folder » est déjà pris par la maquette (élément en ligne) */
#opti-design .op-folder-row { display: flex; align-items: center; border-radius: 9px; margin: 2px 0; color: var(--op-muted); }
#opti-design .op-folder-row:hover { background: var(--op-soft); }
#opti-design .op-folder-toggle { display: flex; gap: 7px; align-items: center; padding: 9px 8px; flex: 1; min-width: 0; text-align: left; font-size: 11px; font-weight: 600; color: var(--op-ink); }
#opti-design .op-folder-toggle > svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--op-muted); }
#opti-design .op-folder-chevron { width: 12px !important; height: 12px !important; transition: transform .15s; }
#opti-design .op-folder-item.is-open .op-folder-chevron { transform: rotate(90deg); }
#opti-design .op-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-folder-count { margin-left: auto; color: var(--op-faint); font-weight: 500; font-size: 10px; }
#opti-design .op-folder-row > .op-icon { flex-shrink: 0; width: 28px; height: 30px; padding: 5px; margin-right: 3px; opacity: 0; }
#opti-design .op-folder-row:hover > .op-icon, #opti-design .op-folder-row > .op-icon:focus-visible, #opti-design .op-folder-row > .op-icon[aria-expanded="true"] { opacity: 1; }
#opti-design .op-folder-row > .op-icon svg { width: 15px; height: 15px; }
#opti-design .op-folder-chats { margin-left: 14px; padding-left: 6px; border-left: 1px solid var(--op-border); }
#opti-design .op-folder-empty { font-size: 10.5px; color: var(--op-faint); padding: 6px 8px 8px; line-height: 1.4; }
#opti-design .op-folder-menu { position: fixed; z-index: 28; width: 230px; padding: 8px; background: var(--op-surface); border: 1px solid var(--op-border); box-shadow: 0 12px 38px #12365325; border-radius: 13px; }
#opti-design .op-folder-menu > button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px; border-radius: 7px; font-size: 11px; }
#opti-design .op-folder-menu > button svg { width: 16px; height: 16px; color: var(--op-muted); }
#opti-design .op-folder-menu > button:hover { background: var(--op-soft); color: var(--op-blue); }
#opti-design .op-move-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin-bottom: 6px; }
#opti-design .op-move-row.is-current { background: var(--op-soft); }
#opti-design .op-move-row small { margin-left: auto; color: var(--op-faint); font-size: 10px; }

/* ===== Mes notes ===== */
#opti-design .op-notes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(230px, 300px) 1fr; border-top: 1px solid var(--op-border); }
#opti-design .op-notes[hidden] { display: none; }
#opti-design .op-notes-active > .op-mainfooter { display: none; }
#opti-design .op-notes-list { border-right: 1px solid var(--op-border); display: flex; flex-direction: column; min-height: 0; background: var(--op-surface); }
#opti-design .op-notes-top { padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
#opti-design .op-notes-top input { width: 100%; }
#opti-design .op-notes-new { justify-content: center; padding: 9px 14px; font-size: 11px; }
#opti-design .op-notes-items { overflow-y: auto; padding: 0 8px 12px; flex: 1; }
#opti-design .op-notes-empty { font-size: 11px; color: var(--op-faint); padding: 14px 8px; }
#opti-design .op-note-item { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 9px; margin: 2px 0; }
#opti-design .op-note-item:hover { background: var(--op-soft); }
#opti-design .op-note-item.is-active { background: var(--op-soft); box-shadow: inset 3px 0 0 var(--op-blue); }
#opti-design .op-note-item b { display: block; font-size: 12px; color: var(--op-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-note-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; color: var(--op-muted); margin-top: 3px; line-height: 1.4; }
#opti-design .op-note-item small { display: block; font-size: 10px; color: var(--op-faint); margin-top: 4px; }
#opti-design .op-note-pane { overflow-y: auto; padding: 26px 38px 30px; min-width: 0; display: flex; flex-direction: column; }
#opti-design .op-note-back { display: none; align-items: center; gap: 6px; margin-bottom: 12px; }
#opti-design .op-note-back svg { width: 14px; height: 14px; }
#opti-design .op-note-head { display: flex; align-items: center; gap: 12px; }
#opti-design #op-note-title { flex: 1; min-width: 0; font-size: 20px; font-weight: 700; border: none; background: transparent; padding: 4px 0; color: var(--op-ink); outline: none; }
#opti-design #op-note-title::placeholder { color: var(--op-faint); }
#opti-design .op-note-status { font-size: 10.5px; color: var(--op-faint); white-space: nowrap; }
#opti-design .op-note-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
#opti-design .op-note-tools .op-export-btn { margin-left: 0; }
#opti-design .op-note-sep { flex: 1; }
#opti-design .op-note-meta { font-size: 10.5px; color: var(--op-faint); margin: 6px 0 12px; }
#opti-design .op-note-meta a { color: var(--op-blue); }
#opti-design #op-note-body { flex: 1; min-height: calc(55vh / var(--ui-zoom, 1)); width: 100%; resize: vertical; border: 1px solid var(--op-border); border-radius: 12px; padding: 16px 18px; font-size: 13px; line-height: 1.65; background: var(--op-surface); color: var(--op-ink); font-family: inherit; }
#opti-design #op-note-body:focus { outline: none; border-color: var(--op-blue); }
#opti-design .op-note-preview { border: 1px solid var(--op-border); border-radius: 12px; padding: 18px 22px; background: var(--op-surface); min-height: calc(30vh / var(--ui-zoom, 1)); }
#opti-design .op-note-welcome { max-width: 520px; margin: calc(6vh / var(--ui-zoom, 1)) auto 0; text-align: center; color: var(--op-muted); font-size: 12.5px; line-height: 1.6; }
#opti-design .op-note-welcome > svg { width: 34px; height: 34px; color: var(--op-blue); }
#opti-design .op-note-welcome h2 { font-size: 18px; color: var(--op-ink); margin: 8px 0; }
#opti-design .op-note-welcome ul { text-align: left; margin: 16px 0 20px; padding-left: 18px; }
#opti-design .op-note-welcome li { margin: 6px 0; }
#opti-design .op-note-welcome li svg { width: 13px; height: 13px; vertical-align: -2px; }
#opti-design .op-note-welcome .op-primary { margin: 0 auto; }
#opti-design .op-chip-note svg { color: var(--op-blue); }
@media (max-width: 760px) {
  #opti-design .op-notes { grid-template-columns: 1fr; }
  #opti-design .op-notes.has-note .op-notes-list { display: none; }
  #opti-design .op-notes:not(.has-note) .op-note-pane { display: none; }
  #opti-design .op-note-back { display: inline-flex; }
  #opti-design .op-note-pane { padding: 18px 18px 24px; }
}
#opti-design #op-notes-search { height: 36px; padding: 0 14px; border: 1px solid var(--op-border); border-radius: 30px; background: var(--op-bg); font-size: 11.5px; color: var(--op-ink); }
#opti-design #op-notes-search:focus { outline: none; border-color: var(--op-blue); }
#opti-design .op-note-tools .op-export-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 11px; font-weight: 600; color: var(--op-blue); border: 1px solid var(--op-border); border-radius: 30px; background: transparent; }
#opti-design .op-note-tools .op-export-btn svg { width: 14px; height: 14px; }
#opti-design .op-note-tools .op-export-btn:hover { background: var(--op-soft); }

/* ===== Agrandissement de toute l'interface (grands écrans) =====
   --ui-zoom est posé par app.js : automatique selon la taille de l'écran, ou choisi dans Réglages → Général (par appareil).
   Le zoom agrandit aussi les hauteurs en vh : on les divise d'autant pour que l'application tienne toujours dans l'écran. */
#opti-design { zoom: var(--ui-zoom, 1); }
#opti-design, #opti-design .op-window, #opti-design .op-app, #opti-design .op-login {
  min-height: calc(100vh / var(--ui-zoom, 1)); min-height: calc(100dvh / var(--ui-zoom, 1));
}
@media (min-width: 651px) {
  #opti-design .op-app { height: calc(100vh / var(--ui-zoom, 1)); height: calc(100dvh / var(--ui-zoom, 1)); }
  #opti-design .op-home { padding-top: clamp(28px, calc(6vh / var(--ui-zoom, 1)), 70px); }
}

/* ===== Administration → Contacts ===== */
#opti-design .op-contact-row { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr auto; gap: 8px 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--op-border); }
#opti-design .op-contact-row .op-field { margin: 0; }
#opti-design .op-contact-row .op-contact-role { grid-column: 1 / 3; }
#opti-design .op-contact-support { grid-column: 3 / 5; display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; color: var(--op-muted); padding-bottom: 9px; cursor: pointer; }
#opti-design .op-contact-support input { accent-color: var(--op-blue); }
#opti-design .op-contact-row > .op-icon { margin-bottom: 4px; }
#opti-design .op-contact-support { justify-content: flex-start; }
#opti-design .op-contact-support input { width: auto; height: auto; margin: 0; flex: none; }
#opti-design .op-contact-support span { margin: 0; }

/* ===== Profils d'accès d'une connexion (Administration → Connexions) ===== */
#opti-design .op-acl { border: 1px solid var(--op-border); border-radius: 12px; background: var(--op-bg); margin-top: 10px; }
#opti-design .op-acl.is-open { border-color: color-mix(in srgb, var(--op-blue) 35%, var(--op-border)); }
#opti-design .op-acl-top { display: flex; align-items: center; gap: 6px; padding-right: 8px; }
#opti-design .op-acl-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-align: left; color: var(--op-ink); }
#opti-design .op-acl-head svg { width: 15px; height: 15px; color: var(--op-faint); transition: transform .15s; flex-shrink: 0; }
#opti-design .op-acl.is-open .op-acl-head svg { transform: rotate(90deg); color: var(--op-blue); }
#opti-design .op-acl-head b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-acl-head small { margin-left: auto; font-size: 11px; color: var(--op-faint); white-space: nowrap; }
#opti-design .op-acl-body { padding: 12px 14px 16px; border-top: 1px solid var(--op-border); }
#opti-design .op-acl-body .op-field { margin-bottom: 4px; }
#opti-design .op-acl-label { font-size: 11px; font-weight: 600; color: var(--op-muted); margin: 18px 0 8px; }
#opti-design .op-acl-body .op-choices + .op-acl-label { margin-top: 20px; }
#opti-design .op-acl-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
#opti-design .op-acl-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 30px; background: var(--op-soft); color: var(--op-blue); font-size: 11px; font-weight: 500; }
#opti-design .op-acl-chip button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
#opti-design .op-acl-chip button:hover { background: color-mix(in srgb, var(--op-blue) 18%, transparent); }
#opti-design .op-acl-chip button svg { width: 12px; height: 12px; }
#opti-design .op-pane select.op-acl-add { width: auto; max-width: 100%; min-width: 240px; margin-top: 10px; }

/* ===== Administration : intertitres des onglets, page Wipsos ===== */
#opti-design .op-tabs-group { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--op-faint); padding: 14px 10px 5px; }
#opti-design .op-tabs-group:first-child { padding-top: 2px; }
#opti-design .op-kv td:first-child { color: var(--op-muted); width: 190px; }
#opti-design .op-code { background: var(--op-bg); border: 1px solid var(--op-border); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; overflow-x: auto; }
#opti-design .op-user-list { border: 1px solid var(--op-border); border-radius: 10px; padding: 2px 14px; max-height: 360px; overflow-y: auto; }
#opti-design .op-user-list .op-toggle { padding: 6px 0; margin: 0; min-height: 0; border-bottom: 1px solid var(--op-border); }
#opti-design .op-user-list .op-toggle:last-child { border-bottom: 0; }
#opti-design .op-user-list .op-toggle small { display: inline; margin-left: 8px; }
@media (max-width: 700px) { #opti-design .op-tabs-group { display: none; } }

/* Anciennes cartes de consultation en échec : discrètes, pas d'alerte rouge */
#opti-design .op-tool.is-error { opacity: .55; }
#opti-design .op-tool.is-error, #opti-design .op-tool.is-error * { color: var(--op-faint) !important; border-color: var(--op-border) !important; }

/* ===== Droits d'accès : tableau utilisateurs × systèmes ===== */
#opti-design .op-rights-wrap { border: 1px solid var(--op-border); border-radius: 10px; max-height: 430px; overflow: auto; }
#opti-design .op-rights { width: 100%; margin: 0; border-collapse: collapse; }
#opti-design .op-rights th { position: sticky; top: 0; z-index: 1; background: var(--op-surface, var(--op-bg)); text-align: center; font-size: 11px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--op-border); white-space: nowrap; }
#opti-design .op-rights th:first-child, #opti-design .op-rights td:first-child { text-align: left; width: 100%; }
#opti-design .op-rights th small { display: block; font-weight: 400; color: var(--op-faint); margin-top: 2px; }
#opti-design .op-rights td { padding: 8px 12px; border-bottom: 1px solid var(--op-border); text-align: center; font-size: 12px; }
#opti-design .op-rights tr:last-child td { border-bottom: 0; }
#opti-design .op-rights td small { margin-left: 8px; color: var(--op-faint); font-size: 11px; }
#opti-design .op-check { display: inline-flex; cursor: pointer; padding: 4px; }
#opti-design .op-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--op-blue); cursor: pointer; }

/* Tableaux des réponses : une ligne par cellule (pas de mot coupé), le tableau défile horizontalement s'il est trop large */
#opti-design .op-answer-content table th, #opti-design .op-answer-content table td { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
#opti-design .op-answer-content table { width: max-content; max-width: 100%; }

/* Ce que fait Optimus pendant la réponse (17/11) : « Réfléchit… », « Consulte Wipsos : … », « Rédige la réponse… » */
#opti-design .op-answer-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--op-faint); }
#opti-design .op-answer-status[hidden] { display: none; }
#opti-design .op-status-dots { display: inline-flex; gap: 3px; }
#opti-design .op-status-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--op-blue); opacity: .25; animation: op-status-dot 1.2s infinite ease-in-out; }
#opti-design .op-status-dots i:nth-child(2) { animation-delay: .2s; }
#opti-design .op-status-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes op-status-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { #opti-design .op-status-dots i { animation: none; opacity: .6; } }

/* ── Projets (18/11) ─────────────────────────────────────────────────────────────────────────────────────────── */
#opti-design #op-projet-name { flex: 1; min-width: 0; font-size: 20px; font-weight: 700; border: none; background: transparent; padding: 4px 0; color: var(--op-ink); outline: none; }
#opti-design .op-projet-desc { width: 100%; border: none; border-bottom: 1px dashed var(--op-border); background: transparent; padding: 4px 0 6px; font-size: 12.5px; color: var(--op-muted); outline: none; }
#opti-design .op-projet-desc:focus { border-bottom-color: var(--op-blue); }
#opti-design .op-projet-h { font-size: 12px; font-weight: 700; color: var(--op-ink); text-transform: uppercase; letter-spacing: .04em; margin: 22px 0 8px; }
#opti-design .op-projet-h small { font-weight: 400; color: var(--op-faint); text-transform: none; letter-spacing: 0; }
#opti-design .op-projet-consignes { width: 100%; min-height: calc(18vh / var(--ui-zoom, 1)); resize: vertical; border: 1px solid var(--op-border); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6; background: var(--op-surface); color: var(--op-ink); font-family: inherit; }
#opti-design .op-projet-consignes:focus { outline: none; border-color: var(--op-blue); }
#opti-design .op-projet-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-bottom: 10px; }
#opti-design .op-projet-docs > .op-hint { grid-column: 1 / -1; margin: 0; }
#opti-design .op-projet-doc { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 6px 8px 10px; border: 1px solid var(--op-border); border-radius: 10px; background: var(--op-surface); }
#opti-design .op-projet-doc > svg { grid-row: 1 / 3; width: 16px; height: 16px; color: var(--op-blue); }
#opti-design .op-projet-doc span { font-size: 12px; color: var(--op-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-projet-doc small { grid-column: 2; font-size: 10px; color: var(--op-faint); }
#opti-design .op-projet-doc .op-icon { grid-column: 3; grid-row: 1 / 3; }
#opti-design .op-projet-doc.is-uploading { opacity: .65; }
#opti-design .op-projet-doc.is-uploading > svg { animation: op-tourne 1s linear infinite; }
@keyframes op-tourne { to { transform: rotate(360deg); } }
#opti-design .op-projet-chats { display: flex; flex-direction: column; gap: 2px; }
#opti-design .op-projet-chat { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; }
#opti-design .op-projet-chat:hover { background: var(--op-soft); }
#opti-design .op-projet-chat svg { width: 15px; height: 15px; color: var(--op-muted); flex: none; }
#opti-design .op-projet-chat span { flex: 1; min-width: 0; font-size: 12.5px; color: var(--op-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#opti-design .op-projet-chat small { font-size: 10.5px; color: var(--op-faint); white-space: nowrap; }
#opti-design .op-home-projet { display: flex; align-items: center; gap: 8px; margin: 0 auto 10px; max-width: 760px; padding: 8px 12px; border-radius: 10px; background: var(--op-soft); color: var(--op-ink); font-size: 11.5px; }
#opti-design .op-home-projet[hidden] { display: none; }
#opti-design .op-home-projet svg { width: 15px; height: 15px; color: var(--op-blue); flex: none; }
#opti-design .op-home-projet span { flex: 1; }
@media (max-width: 760px) {
  #opti-design .op-projets.has-note .op-notes-list { display: none; }
  #opti-design .op-projets:not(.has-note) .op-note-pane { display: none; }
}

#opti-design .op-navsection-link { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
#opti-design .op-navsection-link:hover { color: var(--op-blue); }
#opti-design .op-folder-item.is-active > .op-folder-row { background: var(--op-soft); box-shadow: inset 3px 0 0 var(--op-blue); }
#opti-design .op-folder-chevron { cursor: pointer; border-radius: 4px; }
#opti-design .op-folder-chevron:hover { background: var(--op-border); }

/* Requête SQL libre (18/11) : dépliable sous la carte de l'outil */
#opti-design .op-tool-sql { margin: 4px 0 2px 26px; font-size: 11px; color: var(--op-muted); }
#opti-design .op-tool-sql summary { cursor: pointer; width: fit-content; }
#opti-design .op-tool-sql summary:hover { color: var(--op-blue); }
#opti-design .op-tool-sql pre { margin: 6px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: var(--op-surface); border: 1px solid var(--op-border); border-radius: 8px; font-size: 11px; line-height: 1.5; color: var(--op-ink); }

/* ── Mode caché « The Fallen » (18/11, fallen.js v2) : machine de guerre rouge et noire ───────────────────────────── */
#opti-design.op-fallen { --opf-biseau: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
#opti-design.op-fallen .op-brand img { filter: grayscale(1) sepia(1) hue-rotate(-50deg) saturate(5) brightness(.85); }
#opti-design.op-fallen .op-sidebar {
  background: var(--opf-glyphes-v) right 5px top 14px / 9px auto repeat-y,
              repeating-linear-gradient(135deg, #ffffff05 0 2px, transparent 2px 9px),
              linear-gradient(180deg, #170909, #0b0505 70%);
  border-right: 2px solid #5e0d18; box-shadow: inset -3px 0 0 #00000066, 1px 0 18px #d3122f22; }
#opti-design.op-fallen .op-main {
  background: var(--opf-filigrane) center 46% / min(52vmin, 470px) no-repeat, var(--opf-motif) 0 0 / 260px repeat,
              radial-gradient(ellipse at 50% -10%, #2c0b0e 0, #0a0505 62%); }
#opti-design.op-fallen .op-header {
  background: var(--opf-glyphes-h) left 18px bottom 4px / auto 7px repeat-x, linear-gradient(#150809, #0d0606);
  border-bottom: 1px solid #6a0f1d; box-shadow: 0 1px 0 #ff2a3c33, 0 8px 22px #00000055; }
#opti-design.op-fallen .op-header-title { text-transform: uppercase; letter-spacing: .14em; color: #ff4b4b; text-shadow: 0 0 10px #ff1e3c66; }
#opti-design.op-fallen .op-navsection, #opti-design.op-fallen .op-navsection-link { letter-spacing: .2em; color: #b0333f; }
#opti-design.op-fallen .op-primary, #opti-design.op-fallen .op-new {
  clip-path: var(--opf-biseau); border-radius: 0 !important; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  background: linear-gradient(180deg, #ee2340, #a00d22 55%, #6d0815) !important; color: #fff !important;
  box-shadow: inset 0 1px 0 #ff8a8a66, inset 0 -2px 0 #00000055 !important; }
#opti-design.op-fallen .op-send { border-radius: 0 !important; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: linear-gradient(180deg, #ee2340, #8f0b1e) !important; box-shadow: 0 0 14px #d3122f88; }
#opti-design.op-fallen .op-recents > *, #opti-design.op-fallen .op-mainnav > *, #opti-design.op-fallen .op-folder-row { border-radius: 0 !important; }
#opti-design.op-fallen .op-recents .is-active, #opti-design.op-fallen .op-recents [aria-current] { box-shadow: inset 3px 0 0 #ff2a3c; background: #2a0f12 !important; }
#opti-design.op-fallen .op-user-message {
  border-radius: 0 !important; clip-path: var(--opf-biseau);
  background: linear-gradient(135deg, #2c1213, #160909) !important; box-shadow: inset 0 0 0 1px #6a0f1d, inset 0 0 18px #d3122f22; }
#opti-design.op-fallen .op-answer > img { filter: drop-shadow(0 0 7px #ff1e3c99); }
#opti-design.op-fallen .op-answer-body { border-left: 2px solid #7a0c1c; padding-left: 14px; }
#opti-design.op-fallen .op-answer-name { color: #ff3b3b; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 0 8px #ff1e3c55; }
#opti-design.op-fallen .op-answer-content strong { color: #ff6b6b; }
#opti-design.op-fallen .op-answer-content table th { background: #2a0f12; color: #ff8a8a; }
#opti-design.op-fallen .op-composer {
  border-radius: 0 !important; border-color: #7a0c1c !important;
  background:
    linear-gradient(#ff2a3c, #ff2a3c) top left / 16px 2px no-repeat, linear-gradient(#ff2a3c, #ff2a3c) top left / 2px 16px no-repeat,
    linear-gradient(#ff2a3c, #ff2a3c) top right / 16px 2px no-repeat, linear-gradient(#ff2a3c, #ff2a3c) top right / 2px 16px no-repeat,
    linear-gradient(#ff2a3c, #ff2a3c) bottom left / 16px 2px no-repeat, linear-gradient(#ff2a3c, #ff2a3c) bottom left / 2px 16px no-repeat,
    linear-gradient(#ff2a3c, #ff2a3c) bottom right / 16px 2px no-repeat, linear-gradient(#ff2a3c, #ff2a3c) bottom right / 2px 16px no-repeat,
    radial-gradient(circle at 10px 10px, #5a5e64 0 2px, transparent 3px), radial-gradient(circle at calc(100% - 10px) 10px, #5a5e64 0 2px, transparent 3px),
    linear-gradient(180deg, #150909, #0e0606) !important;
  box-shadow: 0 0 0 1px #3d0a12, 0 0 28px #d3122f26 !important; }
#opti-design.op-fallen .op-composer:focus-within { box-shadow: 0 0 0 1px #ff2a3c, 0 0 32px #ff2a3c44 !important; }
#opti-design.op-fallen .op-mainfooter, #opti-design.op-fallen .op-hint { color: #8f6a6a; }
#opti-design.op-fallen .op-answer-status .op-status-dots { display: none; }
#opti-design.op-fallen .op-answer-status::before {
  content: ''; flex: none; width: 66px; height: 13px; margin-right: 8px;
  background: var(--opf-glyphes-s) 0 50% / auto 13px repeat-x; filter: drop-shadow(0 0 4px #ff2a3c);
  animation: opf-decode .9s steps(8) infinite; }
@keyframes opf-decode { to { background-position-x: -132px; } }
#opti-design.op-fallen ::-webkit-scrollbar-thumb { background: #5e0d18; }
#opti-design.op-fallen ::selection { background: #d3122f; color: #fff; }
@media (prefers-reduced-motion: reduce) { #opti-design.op-fallen .op-answer-status::before { animation: none; } }

/* Transformation */
.opf-scene { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; overflow: hidden; perspective: 1400px; --opf-c: #ff2a3c; }
.opf-sortie { --opf-c: #3aa8e0; }
.opf-alerte { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 30%, color-mix(in srgb, var(--opf-c) 55%, transparent) 100%); }
.opf-noir { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, #1a0d0d, #030202 70%); transition: opacity .5s; }
.opf-sortie .opf-noir { background: radial-gradient(ellipse at 50% 60%, #0b1420, #020306 70%); }
.opf-entrailles { position: absolute; inset: 0; opacity: 0; overflow: hidden;
  background: repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 22px), repeating-linear-gradient(90deg, #ffffff06 0 1px, transparent 1px 22px),
    radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--opf-c) 28%, transparent), transparent 65%); }
.opf-corps { position: absolute; inset: 0; transform-style: preserve-3d; perspective: 1500px; transform-origin: 50% 100%; }
.opf-bloc { position: absolute; transform-style: preserve-3d; will-change: transform; }
.opf-morceau { position: absolute; overflow: hidden; backface-visibility: visible; will-change: transform; }
.opf-morceau > #opti-design { box-shadow: none; }
.opf-bord { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  box-shadow: inset 0 0 0 2px #7b8088, inset 0 0 0 4px #0b0b0c, inset 0 0 0 5px color-mix(in srgb, var(--opf-c) 80%, transparent),
    inset 0 0 26px color-mix(in srgb, var(--opf-c) 40%, transparent);
  background: linear-gradient(135deg, #ffffff14, transparent 30%, transparent 70%, #00000055); }
.opf-ouvert .opf-bord { opacity: 1; }
.opf-verin { position: absolute; height: 16px; transform-origin: left center; border-radius: 3px;
  background: linear-gradient(#55595f, #1c1d20 55%, #3c3f44); box-shadow: inset 0 0 0 1px #000a; }
.opf-verin i { position: absolute; left: 30%; top: 4px; height: 8px; width: 0; border-radius: 4px;
  background: linear-gradient(#d8dce2, #7d828a); box-shadow: 0 0 8px var(--opf-c); animation: opf-pousse .9s cubic-bezier(.6,0,.3,1) infinite alternate; }
@keyframes opf-pousse { to { width: 65%; } }
.opf-circuit { position: absolute; left: -5%; right: -5%; height: 9px; opacity: .85;
  background: var(--opf-glyphes-h, none) 0 50% / auto 9px repeat-x; filter: drop-shadow(0 0 4px var(--opf-c)); animation: opf-defile 1.2s linear infinite; }
@keyframes opf-defile { to { background-position-x: -220px; } }
.opf-debris, .opf-poussiere { position: absolute; inset: 0; pointer-events: none; }
.opf-eclat { position: absolute; background: linear-gradient(140deg, #8d9299, #2a2c30); box-shadow: 0 0 4px color-mix(in srgb, var(--opf-c) 60%, transparent);
  clip-path: polygon(0 20%, 60% 0, 100% 45%, 80% 100%, 15% 85%); }
.opf-nuage { position: absolute; border-radius: 50%; background: radial-gradient(circle, #6b5e55aa, #3a332e44 45%, transparent 70%); filter: blur(6px); }
.opf-sortie .opf-nuage { background: radial-gradient(circle, #5b6670aa, #2e353a44 45%, transparent 70%); }
.opf-braise { position: absolute; border-radius: 50%; background: #ffb347; box-shadow: 0 0 6px 2px #ff4a1c; }
.opf-engrenage { position: absolute; opacity: .95; animation: opf-tourne 1.1s linear infinite;
  background: radial-gradient(circle, #0b0b0d 0 18%, #6a6e75 19% 38%, transparent 39%), repeating-conic-gradient(#6a6e75 0 9deg, transparent 9deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 0 49%, transparent 50%); mask: radial-gradient(circle, #000 0 49%, transparent 50%);
  filter: drop-shadow(0 0 6px var(--opf-c)); }
.opf-engrenage.opf-inverse { animation-direction: reverse; }
@keyframes opf-tourne { to { transform: rotate(360deg); } }
.opf-embleme { position: absolute; left: 50%; top: 46%; width: 30vmin; height: 30vmin; object-fit: contain; opacity: 0;
  transform: translate(-50%, -50%) scale(.2) rotate(-120deg); transition: transform .9s cubic-bezier(.2,1.5,.4,1), opacity .35s;
  filter: drop-shadow(0 0 30px var(--opf-c)) drop-shadow(0 0 90px color-mix(in srgb, var(--opf-c) 55%, transparent)); }
.opf-embleme-on .opf-embleme { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
.opf-texte, .opf-sous-texte { position: absolute; left: 0; right: 0; text-align: center; color: var(--opf-c); }
.opf-texte { top: calc(46% + 18vmin); font: 800 clamp(16px, 3vmin, 30px)/1.2 Montserrat, Arial, sans-serif; letter-spacing: .3em;
  text-shadow: 0 0 14px var(--opf-c), 2px 0 #00e5ff44, -2px 0 #ff00aa44; }
.opf-car { display: inline-block; min-width: .72em; vertical-align: middle; }
.opf-car svg { display: block; margin: auto; }
.opf-sous-texte { top: calc(46% + 18vmin + 46px); opacity: .7; filter: drop-shadow(0 0 4px var(--opf-c)); }
.opf-sous-texte svg { margin: 0 3px; }
