/* Composer */
.copilot-zone {
  background: var(--composer-bg); border: 1px solid var(--border); border-radius: 16px; margin: 0 8px 8px; box-shadow: 0 4px 16px rgba(40,38,34,0.05);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
  max-height: 55vh; overflow-y: auto;
}
.copilot-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-pill { display: none; }
.draft-switch { box-sizing: border-box; display: inline-flex; gap: 2px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-app); }
.draft-switch[hidden] { display: none; }
.draft-switch button { display: inline-flex; align-items: center; border: 0; background: none; padding: 0 10px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.draft-switch button[aria-pressed="true"] { background: var(--bg-card); color: var(--text-main); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.draft-switch button:disabled { opacity: .5; cursor: default; }
.draft-switch button.new::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
#ai-menu-btn { margin-left: auto; }
.composer-attachments { flex-wrap: wrap; }
.composer-menu-btn.warn::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 2px; border-radius: 50%; background: #d9822b; }
.composer-menu { position: fixed; inset: auto; margin: 0; width: min(340px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); color: var(--text-main); box-shadow: var(--shadow-pop); }
.composer-menu:popover-open { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.composer-menu > button { justify-content: flex-start; }
.composer-menu .instruction-row { display: flex; }
.composer-menu .instruction-input { flex: 1; min-width: 0; }
.composer-menu #btn-toggle-instruction { display: none; }
.composer-menu select { width: 100%; }
/* message d'état sur une ligne, coupé (…) ; texte entier en infobulle : jamais de retour à la ligne de la barre (20/11) */
.composer-attachments #action-status { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.composer-menu-btn { flex-shrink: 0; }
.composer-menu #btn-add-note:disabled, #more-menu:has(#btn-add-note:disabled) #feedback-version { display: none; }
.composer-attachments #ai-explanation, .composer-attachments #ai-explanation[open] { position: relative; margin-left: 0; flex-basis: auto; font-size: 12px; white-space: nowrap; }
.composer-attachments #ai-explanation p { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 5; width: min(380px, 70vw); white-space: normal; box-shadow: var(--shadow-pop); }
.copilot-head:not(:has(.copilot-alerts:not(:empty))), #draft-context, #draft-state { display: none; }
.composer-menu .brain-report-button { margin: 0; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); font-size: 12.5px; font-weight: 550; }
.composer-menu [hidden] { display: none !important; }
.copilot-alerts { display: flex; gap: 6px; flex-wrap: wrap; }
.copilot-alerts:empty { display: none; }
.alert-chip { font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: var(--yellow-soft); color: var(--yellow); font-weight: 550; }
.alert-chip.info { background: var(--accent-soft); color: var(--accent); }
#ai-explanation { margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
#ai-explanation summary { cursor: pointer; list-style: none; }
#ai-explanation summary::-webkit-details-marker { display: none; }
#ai-explanation[open] { flex-basis: 100%; margin-left: 0; }
#ai-explanation p { margin-top: 4px; padding: 8px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; }
#action-status { font-size: 12.5px; color: var(--text-muted); }
#action-status:empty { display: none; }
#draft-conflict {
  background: var(--yellow-soft); color: var(--yellow); border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
#draft-conflict p { flex: 1; min-width: 200px; }

.composer-box { display: flex; flex-direction: column; gap: 6px; }
.copilot-textarea {
  width: 100%; min-height: 76px; max-height: 240px; background: var(--composer-input-bg);
  border: 1px solid var(--composer-input-border); border-radius: 13px;
  padding: 10px 12px; font-size: 14.5px; line-height: 1.5; resize: vertical; outline: none;
}
.copilot-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.copilot-textarea:disabled { opacity: .6; }
.instruction-row { display: none; gap: 8px; align-items: center; }
.instruction-row.open { display: flex; }
.instruction-input {
  flex: 1; background: var(--composer-input-bg); border: 1px solid var(--composer-input-border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; min-width: 0;
}
.instruction-input:focus { border-color: var(--accent); }

.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.composer-notes { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.composer-notes #feedback-version { max-width: 180px; min-width: 0; }
.composer-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 24px; padding-top: 2px; }
.composer-support { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.composer-attachments { display: flex; align-items: center; gap: 6px; }

.composer-bottom > .btn-send { align-self: start; }
@media (max-width: 700px) {
  .composer-notes { margin-left: 0; }
  .composer-bottom { gap: 12px; }
  .composer-bottom > .btn-send { padding: 0 10px; }
}

.copilot-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn-tool, .btn-regen {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main);
  font-size: 12.5px; font-weight: 550; height: 32px; padding: 0 11px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn-tool:hover:not(:disabled), .btn-regen:hover:not(:disabled) { border-color: var(--border-strong); background: var(--bg-card-hover); }
.btn-primary-soft { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary-soft:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-send {
  background: color-mix(in srgb, var(--acc, var(--send)) 92%, #000000); border: none; color: var(--send-ink, #ffffff); font-size: 13.5px; font-weight: 650;
  height: 34px; padding: 0 16px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.btn-send:hover:not(:disabled) { background: color-mix(in srgb, var(--acc, var(--send)) 84%, #000000); }
#composer-text{color:var(--text-main)}
