/* Editeur de compte rendu (report-editor.js) et pastilles « i » (info.js). */

body:has(#m-report[style*="flex"]) #ai-menus-bubble, body:has(#m-report[style*="flex"]) #ai-conclusion-bubble { display: none !important; }
.re-overlay { position: fixed; inset: 0; z-index: 9000; flex-direction: column; background: var(--bg); color: var(--ink); }
.re-top { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.re-title { flex: 1; min-width: 0; font-size: 1rem; }
.re-top button { flex-shrink: 0; min-height: 40px; padding: .4rem 1rem; }
.re-tabs { display: none; }
.re-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.re-panel { overflow-y: auto; padding: 1rem; background: var(--surface); border-right: 1px solid var(--line); }
.re-preview { min-width: 0; min-height: 0; }
.re-preview iframe { display: block; width: 100%; height: 100%; border: 0; background: #f1f5f9; }

.re-block { margin-bottom: 1.25rem; }
.re-block[hidden] { display: none; }
.re-label { display: block; margin-bottom: .4rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.re-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.re-actions button { min-height: 36px; padding: .3rem .7rem; font-size: .8rem; }
.re-name-row { display: flex; gap: .4rem; margin-top: .5rem; }
.re-name-row[hidden] { display: none; }
.re-name-row .inp { flex: 1; min-width: 0; }
.re-sec { border-bottom: 1px solid var(--line); padding: .25rem 0; }
.re-sec-head { display: flex; align-items: center; gap: .5rem; }
.re-check { display: flex; flex: 1; min-width: 0; align-items: center; gap: .5rem; min-height: 36px; font-size: .86rem; cursor: pointer; }
.re-check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--brand); }
.re-off { color: var(--muted); cursor: default; }
.re-move { display: inline-flex; gap: .2rem; flex-shrink: 0; }
.re-move[hidden] { display: none; }
.re-move button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent; color: var(--ink); cursor: pointer; }
.re-move button:disabled { opacity: .35; cursor: default; }
.re-subs { padding: 0 0 .35rem 1.65rem; }
.re-subs .re-check { min-height: 32px; font-size: .8rem; color: var(--muted); }
.re-hint { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.re-hint button { display: block; margin-top: .6rem; min-height: 36px; padding: .3rem .7rem; font-size: .8rem; }
.re-hint button[hidden] { display: none; }

@media (max-width: 900px) {
  .re-top { padding: .5rem .75rem; }
  .re-tabs { display: flex; gap: .25rem; padding: .35rem .75rem; background: var(--surface); border-bottom: 1px solid var(--line); }
  .re-tab { flex: 1; min-height: 40px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
  .re-tab.on { background: var(--brand-soft); color: var(--brand-ink); }
  .re-body { display: block; overflow: hidden; }
  .re-panel, .re-preview { height: 100%; }
  .re-panel { border-right: 0; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .re-body[data-view="preview"] .re-panel, .re-body[data-view="panel"] .re-preview { display: none; }
  .re-sec-head .re-check, .re-move button { min-height: 40px; }
  .re-move button { width: 38px; height: 38px; }
  .re-subs .re-check { min-height: 38px; font-size: .86rem; }
}

.info-lab { display: inline-flex; align-items: center; gap: .3rem; }
.info-dot {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: .25rem; padding: 0; vertical-align: 1px;
  border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--muted);
  font: italic 600 10px/1 Georgia, serif; text-transform: none; cursor: pointer;
}
.info-dot::after { content: ""; position: absolute; inset: -10px; } /* zone de doigt */
.info-dot:hover, .info-dot[aria-expanded="true"] { border-color: var(--brand); color: var(--brand-ink); }
.info-pop {
  position: fixed; z-index: 9500; width: min(320px, calc(100vw - 16px)); padding: .75rem .85rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-card);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18); font-size: .82rem; line-height: 1.45;
}
.info-title { display: block; margin-bottom: .3rem; }
.info-formula { color: var(--muted); }
.info-live { margin-top: .35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.info-note { margin-top: .35rem; color: var(--muted); }
@media (max-width: 640px) {
  .info-pop { left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; }
}

/* Editeur de texte : stabilo, annuler, et options de format de l'IA */
.me-hl { display: inline-block; padding: 0 4px; border-radius: 2px; background: #fef08a; color: #1e293b; font-weight: 700; }
.dark .mini-editor-content span[style*="background-color"] { color: #0f172a; }
.cowriter-format { display: flex; flex-wrap: wrap; gap: .25rem .85rem; margin: .4rem 0; }
.cowriter-check { display: inline-flex; align-items: center; gap: .3rem; min-height: 28px; font-size: .76rem; color: var(--muted); cursor: pointer; }
.cowriter-check input { accent-color: var(--brand); }
.cowriter-note { margin: 0 0 .35rem; font-size: .72rem; color: var(--muted); }
.cowriter-quote { margin: .4rem 0; padding: .3rem .6rem; border-left: 3px solid var(--brand); background: var(--brand-soft); color: var(--ink); font-size: .78rem; max-height: 5.5em; overflow: auto; }
.cowriter-preview p { margin: 0 0 .4rem; }
.cowriter-preview ul, .cowriter-preview ol { margin: 0 0 .4rem 1.1rem; list-style: revert; }
