/* SAGACE IA — Conversation privée 0.5.5 */

.sagace-original-result-hidden{
  display:none!important;
}

.sagace-layout-expanded{
  grid-template-columns:minmax(0,1fr)!important;
}

.sagace-layout-expanded > *{
  min-width:0;
}

.sagace-chat-followup,
.sagace-free-chat{
  width:100%;
  max-width:100%;
  margin:24px 0 0;
  border:1px solid #d7e3ef;
  border-radius:26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(57,134,207,.07), transparent 30%),
    linear-gradient(180deg,#fafdff 0%,#f3f7fb 100%);
  padding:0;
  box-sizing:border-box;
  box-shadow:0 18px 48px rgba(25,65,105,.11);
  clear:both;
  grid-column:1 / -1!important;
  overflow:hidden;
}

.sagace-chat-head{
  display:flex;
  align-items:center;
  gap:15px;
  padding:18px 22px;
  background:rgba(255,255,255,.92);
  border-bottom:1px solid #dce7f1;
  backdrop-filter:blur(8px);
}

.sagace-chat-avatar{
  width:82px;
  height:82px;
  border-radius:50%;
  object-fit:cover;
  border:4px solid #e5f0fb;
  box-shadow:0 8px 24px rgba(28,94,154,.20);
  flex:0 0 auto;
}

.sagace-chat-head-copy{
  min-width:0;
}

.sagace-chat-title{
  margin:0;
  font-weight:850;
  font-size:20px;
  line-height:1.2;
  color:#174f87;
}

.sagace-chat-subtitle{
  display:flex;
  align-items:center;
  gap:7px;
  margin-top:5px;
  color:#6f7d90;
  font-size:13px;
}

.sagace-chat-subtitle::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#35b76f;
  box-shadow:0 0 0 4px rgba(53,183,111,.12);
}

.sagace-chat-messages{
  min-height:160px;
  max-height:none;
  overflow:visible;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:22px 22px 8px;
  margin:0;
}

.sagace-chat-row{
  display:flex;
  align-items:flex-end;
  gap:10px;
  width:100%;
}

.sagace-chat-row.user{
  flex-direction:row-reverse;
}

.sagace-message-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #fff;
  box-shadow:0 4px 14px rgba(31,67,104,.15);
  background:#dce9f6;
  flex:0 0 auto;
}

.sagace-avatar-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  border-radius:50%;
  border:2px solid #fff;
  box-shadow:0 4px 14px rgba(31,67,104,.15);
  background:linear-gradient(135deg,#2f7fc8,#6b9fd1);
  color:#fff;
  font-weight:850;
  font-size:16px;
  flex:0 0 auto;
}

.sagace-chat-bubble-wrap{
  display:flex;
  flex-direction:column;
  max-width:min(84%,960px);
  min-width:0;
}

.sagace-chat-row.user .sagace-chat-bubble-wrap{
  align-items:flex-end;
  max-width:min(76%,760px);
}

.sagace-message-author{
  margin:0 7px 5px;
  color:#607086;
  font-size:12px;
  font-weight:750;
}

.sagace-chat-row.user .sagace-message-author{
  text-align:right;
}

.sagace-chat-message{
  position:relative;
  overflow-wrap:anywhere;
  line-height:1.6;
  font-size:15px;
}

.sagace-chat-message.assistant{
  width:100%;
  padding:18px 20px;
  background:#fff;
  border:1px solid #dce6ef;
  border-radius:7px 20px 20px 20px;
  box-shadow:0 8px 24px rgba(25,70,113,.065);
  color:#1d2a3e;
}

.sagace-chat-message.assistant::before{
  content:"";
  position:absolute;
  left:-10px;
  top:0;
  width:18px;
  height:18px;
  background:#fff;
  border-left:1px solid #dce6ef;
  transform:skewX(42deg);
  transform-origin:top right;
}

.sagace-chat-message.user{
  padding:13px 16px;
  background:linear-gradient(135deg,#2c77bd,#3f91dc);
  border:1px solid #2870b1;
  border-radius:20px 7px 20px 20px;
  color:#fff;
  white-space:pre-wrap;
  box-shadow:0 7px 20px rgba(34,102,166,.18);
}

.sagace-chat-message.user::after{
  content:"";
  position:absolute;
  right:-10px;
  top:0;
  width:18px;
  height:18px;
  background:#3f91dc;
  border-right:1px solid #2870b1;
  transform:skewX(-42deg);
  transform-origin:top left;
}

.sagace-message-time{
  margin:5px 8px 0;
  color:#8793a2;
  font-size:11px;
  line-height:1;
}

.sagace-chat-row.user .sagace-message-time{
  text-align:right;
}

.sagace-response-intro{
  margin:0;
  padding:0 0 4px;
  border:0;
  background:transparent;
}

.sagace-response-section{
  margin:0;
  padding:18px 0 0;
  border:0;
  background:transparent;
}

.sagace-response-section + .sagace-response-section{
  margin-top:18px;
  border-top:1px solid #e4ebf3;
}

.sagace-response-section-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 0 10px;
  color:#184f87;
  font-size:17px;
  font-weight:850;
  line-height:1.3;
}

.sagace-response-section-head::before{
  content:"";
  width:4px;
  height:22px;
  border-radius:999px;
  background:#2d7bc4;
  flex:0 0 auto;
}

.sagace-response-section-body{
  padding:0;
  color:#1d2a3e;
}

.sagace-response-intro p,
.sagace-response-section-body p{
  margin:0 0 12px;
}

.sagace-response-intro p:last-child,
.sagace-response-section-body p:last-child{
  margin-bottom:0;
}

.sagace-response-intro ul,
.sagace-response-intro ol,
.sagace-response-section-body ul,
.sagace-response-section-body ol{
  margin:8px 0 4px 22px;
  padding:0;
}

.sagace-response-intro li,
.sagace-response-section-body li{
  margin:6px 0;
}

.sagace-response-table-wrap{
  width:100%;
  margin:12px 0 5px;
  overflow-x:auto;
  border:1px solid #d7e2ee;
  border-radius:12px;
  background:#fff;
}

.sagace-response-table{
  width:100%;
  min-width:520px;
  border-collapse:collapse;
  font-size:13px;
}

.sagace-response-table th,
.sagace-response-table td{
  padding:10px 11px;
  border-right:1px solid #e1e9f2;
  border-bottom:1px solid #e1e9f2;
  text-align:left;
  vertical-align:top;
}

.sagace-response-table th:last-child,
.sagace-response-table td:last-child{
  border-right:0;
}

.sagace-response-table tr:last-child td{
  border-bottom:0;
}

.sagace-response-table th{
  background:#f0f6fc;
  color:#173d67;
  font-weight:800;
}

.sagace-response-checklist{
  list-style:none;
  margin-left:0!important;
}

.sagace-response-intro blockquote,
.sagace-response-section-body blockquote{
  margin:12px 0;
  padding:10px 13px;
  border-left:3px solid #6e9bc7;
  border-radius:0 9px 9px 0;
  background:#f4f8fc;
  color:#3a506c;
}

.sagace-response-intro hr,
.sagace-response-section-body hr{
  margin:17px 0;
  border:0;
  border-top:1px solid #dce6ef;
}

.sagace-response-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 6px 0;
}

.sagace-response-action{
  min-height:40px;
  padding:8px 12px;
  border:1px solid #cbdbea;
  border-radius:11px;
  background:#fff;
  color:#1b5d9c;
  font-family:inherit;
  font-size:12px;
  font-weight:750;
  line-height:1.2;
  cursor:pointer;
  box-shadow:0 6px 16px -13px rgba(20,65,110,.8);
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}

.sagace-response-action:hover{
  transform:translateY(-1px);
  border-color:#7eadd8;
  background:#f3f8fd;
}

.sagace-response-action:focus-visible{
  outline:3px solid #74afe7;
  outline-offset:2px;
}

.sagace-response-action:disabled{
  opacity:.72;
  cursor:default;
  transform:none;
}

.sagace-print-frame{
  position:fixed!important;
  right:0!important;
  bottom:0!important;
  width:1px!important;
  height:1px!important;
  border:0!important;
  opacity:.01!important;
  pointer-events:none!important;
}

/* Animation de rédaction */
.sagace-typing-bubble{
  min-width:94px;
  padding:15px 18px!important;
}

.sagace-typing-label{
  margin-bottom:8px;
  color:#6c7a8d;
  font-size:12px;
  font-weight:750;
}

.sagace-typing-dots{
  display:flex;
  align-items:center;
  gap:5px;
  height:12px;
}

.sagace-typing-dots span{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#4383bd;
  opacity:.35;
  animation:sagaceTyping 1.25s infinite ease-in-out;
}

.sagace-typing-dots span:nth-child(2){
  animation-delay:.16s;
}

.sagace-typing-dots span:nth-child(3){
  animation-delay:.32s;
}

@keyframes sagaceTyping{
  0%,60%,100%{transform:translateY(0);opacity:.3}
  30%{transform:translateY(-5px);opacity:1}
}

.sagace-chat-footer{
  padding:14px 22px 20px;
  background:rgba(255,255,255,.78);
  border-top:1px solid #e1eaf2;
}

.sagace-chat-quick{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 12px;
}

.sagace-chat-quick button{
  border:1px solid #cfe0f1!important;
  border-radius:999px!important;
  background:#fff!important;
  color:#1e65a5!important;
  padding:8px 12px!important;
  font-size:13px!important;
  font-weight:750!important;
  cursor:pointer;
}

.sagace-chat-quick button:hover,
.sagace-chat-quick button:focus{
  background:#edf5fd!important;
  color:#164e88!important;
}

.sagace-chat-compose{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
}

.sagace-chat-compose textarea{
  width:100%;
  min-height:88px;
  resize:vertical;
  border:1px solid #ccd9e6!important;
  border-radius:17px!important;
  padding:13px 15px!important;
  color:#18233d!important;
  background:#fff!important;
  box-sizing:border-box!important;
  font:inherit!important;
  box-shadow:inset 0 1px 2px rgba(24,53,82,.035);
}

.sagace-chat-compose textarea:focus{
  outline:0!important;
  border-color:#4b8fca!important;
  box-shadow:0 0 0 4px rgba(75,143,202,.12)!important;
}

.sagace-chat-compose button{
  border:0!important;
  border-radius:999px!important;
  padding:13px 24px!important;
  min-height:49px;
  background:linear-gradient(90deg,#1d6fc2,#3f94e8)!important;
  color:#fff!important;
  font-weight:850!important;
  cursor:pointer;
  box-shadow:0 7px 18px rgba(30,105,177,.20);
}

.sagace-chat-compose button:disabled{
  opacity:.55;
  cursor:wait;
}

/* Chat libre */
.sagace-free-chat .sagace-chat-messages{
  padding-top:18px;
}

@media(max-width:700px){
  .sagace-chat-head{
    padding:15px;
  }

  .sagace-chat-avatar{
    width:66px;
    height:66px;
  }

  .sagace-chat-title{
    font-size:18px;
  }

  .sagace-chat-messages{
    padding:16px 12px 6px;
    gap:15px;
  }

  .sagace-message-avatar,
  .sagace-avatar-fallback{
    width:40px;
    height:40px;
  }

  .sagace-chat-bubble-wrap,
  .sagace-chat-row.user .sagace-chat-bubble-wrap{
    max-width:82%;
  }

  .sagace-chat-message.assistant{
    padding:15px;
  }

  .sagace-response-action{
    min-height:44px;
  }

  .sagace-chat-footer{
    padding:12px;
  }

  .sagace-chat-compose{
    grid-template-columns:1fr;
  }

  .sagace-chat-compose button{
    width:100%;
  }
}

@media(prefers-reduced-motion:reduce){
  .sagace-response-action{transition:none}
}
/* ══════════════════════════════════════════════════════════════
   SAGACE — moteur de livrable
   À ajouter à la fin de assets/css/sagace-chat.css
   Toutes les règles sont préfixées .sgd- pour éviter les conflits.
   ══════════════════════════════════════════════════════════════ */

.sagace-chat-row,
.sagace-chat-message.assistant{
  --sgd-ink:#101f35;
  --sgd-soft:#4c6079;
  --sgd-muted:#8496ac;
  --sgd-line:#e4eaf3;
  --sgd-card:#fff;
  --sgd-tint:#fbfcfe;
  --sgd-key:#176fbb;
  --sgd-navy:#143761;
  --sgd-green:#0f7a52;
  --sgd-green-bg:#eefaf3;
  --sgd-green-line:#b3e6cd;
}

/* ── intro et amorce ── */
.sgd-intro,.sgd-lead{font-size:15px;line-height:1.62;color:var(--sgd-ink)}
.sgd-intro p,.sgd-lead p{margin:0 0 10px}
.sgd-intro p:last-child,.sgd-lead p:last-child{margin:0}
.sgd-lead{margin:0 0 14px}

/* ── le livrable lui-même ── */
.sgd-main{
  position:relative;margin:14px 0 0;padding:20px 22px;border-radius:12px;
  background:var(--sgd-tint);border:1px solid #eaf0f7;
  font-family:Newsreader,Georgia,"Times New Roman",serif;font-size:16px;line-height:1.72;color:#1c2f47;
}
.sgd-main-body p{margin:0 0 12px;font-family:inherit;font-size:inherit;line-height:inherit}
.sgd-main-body p:last-child{margin:0}
.sgd-main-body ul,.sgd-main-body ol{margin:0 0 12px;padding-left:22px}
.sgd-main-body li{margin:0 0 6px}
.sgd-main-body strong{font-weight:600;color:var(--sgd-ink)}
.sgd-main-body table{width:100%;border-collapse:collapse;font-family:inherit;font-size:14px}
.sgd-main-body th{padding:8px 10px;border-bottom:1.5px solid #dfe7f1;color:var(--sgd-soft);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:10.4px;font-weight:700;
  letter-spacing:.05em;text-transform:uppercase;text-align:left}
.sgd-main-body td{padding:9px 10px;border-bottom:1px solid #eef3f8;color:#22364f}
.sgd-main-body tr:last-child td{border-bottom:0}

.sgd-copy-main{
  position:absolute;top:11px;right:11px;display:inline-flex;align-items:center;
  min-height:30px;padding:0 11px;border-radius:8px;cursor:pointer;
  border:1px solid var(--sgd-line);background:#fff;color:var(--sgd-soft);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:11px;font-weight:600;
  opacity:0;transition:opacity .18s,color .18s,border-color .18s;
}
.sgd-main:hover .sgd-copy-main,.sgd-copy-main:focus-visible{opacity:1}
.sgd-copy-main:hover{color:var(--sgd-key);border-color:#bcd6ee}

/* ── régime atelier : pièces indépendantes ── */
.sgd-pieces-bar{
  display:flex;align-items:center;gap:12px;margin:14px 0 10px;padding:9px 13px;border-radius:10px;
  background:#f5f9fd;border:1px solid #dfe9f4;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-pieces-bar span{flex:1;min-width:0;font-size:11.6px;font-weight:700;
  letter-spacing:.04em;text-transform:uppercase;color:#5d7085}
.sgd-copy-all{
  flex:0 0 auto;min-height:32px;padding:0 13px;border-radius:8px;cursor:pointer;
  border:0;background:#143761;color:#fff;font-size:11.8px;font-weight:600;font-family:inherit;
}
.sgd-copy-all:hover{background:#0f2b4d}

.sgd-piece{margin:0 0 12px;border:1px solid var(--sgd-line,#e4eaf3);border-radius:12px;
  overflow:hidden;background:#fff}
.sgd-piece:last-child{margin-bottom:0}
.sgd-piece-head{display:flex;align-items:center;gap:9px;padding:10px 12px;
  background:#fbfdfe;border-bottom:1px solid #eef3f8}
.sgd-piece-n{display:grid;place-items:center;flex:0 0 21px;width:21px;height:21px;border-radius:6px;
  background:#eef4fb;color:#176fbb;font-family:system-ui,sans-serif;font-size:10.8px;font-weight:800}
.sgd-piece-head b{flex:1;min-width:0;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:13px;font-weight:650;color:#14283f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sgd-piece-tools{flex:0 0 auto;display:flex;gap:5px}
.sgd-piece-btn{
  min-height:29px;padding:0 10px;border-radius:7px;cursor:pointer;
  border:1px solid #d5e2ee;background:#fff;color:#42597a;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:11px;font-weight:600;
  transition:.14s;white-space:nowrap;
}
.sgd-piece-btn:hover{border-color:#a9c8e6;color:#143761;background:#f7fbff}
.sgd-piece-btn-ghost{border-style:dashed;color:#7c8ea3}

.sgd-piece-meta{padding:11px 14px 0}
.sgd-meta-row{display:flex;gap:10px;margin:0 0 7px;font-family:system-ui,-apple-system,sans-serif;
  font-size:13px;line-height:1.45}
.sgd-meta-k{flex:0 0 82px;color:#8ba0b7;font-size:10.6px;font-weight:700;
  letter-spacing:.05em;text-transform:uppercase;padding-top:3px}
.sgd-meta-v{flex:1;min-width:0;color:#22364f}
.sgd-meta-row.is-subject .sgd-meta-v{font-weight:650;color:#14283f;font-size:14px}

.sgd-piece-body{padding:12px 14px 14px;font-family:Newsreader,Georgia,serif;
  font-size:15px;line-height:1.66;color:#1c2f47}
.sgd-piece-body p{margin:0 0 9px}.sgd-piece-body p:last-child{margin:0}
.sgd-piece-body ul,.sgd-piece-body ol{margin:0 0 9px;padding-left:20px}

@media (max-width:600px){
  .sgd-piece-head{flex-wrap:wrap}
  .sgd-piece-head b{flex:1 1 100%;white-space:normal;order:2;margin-top:2px}
  .sgd-piece-tools{order:3;flex:1 1 100%;margin-top:6px}
  .sgd-piece-btn{flex:1}
  .sgd-meta-k{flex:0 0 62px}
}
@media print{.sgd-piece-tools,.sgd-copy-all{display:none!important}}

/* ── corrigé masqué ── */
.sgd-reveal{margin:12px 0 0}
.sgd-reveal>summary{display:flex;align-items:center;gap:9px;padding:11px 14px;border-radius:10px;
  border:1px solid var(--sgd-line);background:var(--sgd-tint);cursor:pointer;list-style:none;
  color:var(--sgd-soft);font-size:12.6px;font-weight:600}
.sgd-reveal>summary::-webkit-details-marker{display:none}
.sgd-eye{flex:0 0 15px;width:15px;height:15px;border-radius:50%;
  border:2px solid currentColor;position:relative}
.sgd-eye:after{content:"";position:absolute;inset:3px;border-radius:50%;background:currentColor}
.sgd-reveal[open]>summary{border-radius:10px 10px 0 0;border-bottom-color:transparent;color:var(--sgd-green)}
.sgd-reveal-body{padding:14px 16px;border:1px solid var(--sgd-line);border-top:0;border-radius:0 0 10px 10px;
  background:#fff;font-size:14px;line-height:1.6;color:#22364f}
.sgd-reveal-body p,.sgd-reveal-body li{margin:0 0 8px}

/* ── régime suivi ── */
.sgd-main-track{font-family:inherit;font-size:inherit;padding:16px 18px}
.sgd-progress{display:flex;align-items:center;gap:12px;margin:0 0 13px}
.sgd-progress-bar{flex:1;height:6px;border-radius:99px;background:#e9eff7;overflow:hidden}
.sgd-progress-bar i{display:block;height:100%;width:0;border-radius:99px;
  background:linear-gradient(90deg,var(--sgd-key),#22b8d6);transition:width .3s}
.sgd-progress-count{font-size:12.4px;font-weight:600;color:var(--sgd-soft);white-space:nowrap}

.sgd-track{list-style:none;margin:0;padding:0;font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.sgd-track-item{display:flex;align-items:flex-start;gap:11px;padding:11px 2px;cursor:pointer;
  border-bottom:1px solid #eef3f8;font-size:14.4px;line-height:1.5;color:#22364f}
.sgd-track-item:last-child{border-bottom:0}
.sgd-track-item:focus-visible{outline:2px solid var(--sgd-key);outline-offset:2px;border-radius:6px}
.sgd-box{flex:0 0 19px;width:19px;height:19px;margin-top:1px;border-radius:6px;
  border:1.7px solid #c2d1e2;background:#fff;position:relative;transition:.15s}
.sgd-box:after{content:"";position:absolute;left:5px;top:2px;width:5px;height:9px;
  border:solid #fff;border-width:0 2.4px 2.4px 0;transform:rotate(45deg);opacity:0;transition:.15s}
.sgd-track-item.is-done .sgd-box{background:var(--sgd-green);border-color:var(--sgd-green)}
.sgd-track-item.is-done .sgd-box:after{opacity:1}
.sgd-track-item.is-done .sgd-track-label{color:var(--sgd-muted);text-decoration:line-through}

.sgd-promote{display:flex;align-items:center;gap:13px;margin:14px 0 0;padding:14px 16px;border-radius:12px;
  border:1px solid #cfe1f4;background:linear-gradient(120deg,#f4f9ff,#fff)}
.sgd-promote-copy{flex:1;min-width:0}
.sgd-promote-copy b{display:block;font-size:13.2px;font-weight:600;color:var(--sgd-ink)}
.sgd-promote-copy small{display:block;margin-top:2px;color:var(--sgd-soft);font-size:12px;line-height:1.45}
.sgd-promote-btn{flex:0 0 auto;min-height:40px;padding:0 16px;border-radius:10px;border:0;cursor:pointer;
  background:var(--sgd-navy);color:#fff;font-size:12.6px;font-weight:600}
.sgd-promote-btn:hover{background:#0f2b4d}
.sgd-promote.is-active{border-color:var(--sgd-green-line);background:linear-gradient(120deg,var(--sgd-green-bg),#fff)}

/* ── le repli : une vraie invitation, pas une ligne perdue ── */
.sgd-more{margin:16px 0 0}
.sgd-more>summary{
  display:flex;align-items:center;gap:12px;padding:13px 15px;cursor:pointer;list-style:none;
  border:1px solid #d9e4f0;border-radius:12px;background:#f7fafd;transition:.16s;
}
.sgd-more>summary::-webkit-details-marker{display:none}
.sgd-more>summary:hover{border-color:#b7cfe6;background:#f1f7fc}
.sgd-more[open]>summary{border-radius:12px 12px 0 0;border-bottom-color:transparent;background:#fff}

.sgd-fold-icon{
  flex:0 0 30px;width:30px;height:30px;border-radius:9px;background:#e6f0fa;
  border:1px solid #cfe0f2;position:relative;
}
.sgd-fold-icon:before,.sgd-fold-icon:after{
  content:"";position:absolute;left:8px;right:8px;height:2px;border-radius:2px;background:#4a7fb0;
}
.sgd-fold-icon:before{top:10px}
.sgd-fold-icon:after{top:15px;right:13px}

.sgd-fold-text{flex:1;min-width:0}
.sgd-fold-text b{display:block;font-size:13.4px;font-weight:700;color:#143761;line-height:1.3}
.sgd-fold-text small{
  display:block;margin-top:2px;color:#6b7f96;font-size:11.8px;line-height:1.4;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sgd-fold-chev{
  flex:0 0 9px;width:9px;height:9px;border:solid #7891ab;border-width:2px 2px 0 0;
  transform:rotate(135deg);margin-top:-3px;transition:transform .22s;
}
.sgd-more[open] .sgd-fold-chev{transform:rotate(-45deg);margin-top:3px}

/* contenu riche : on le signale par un liseré coloré */
.sgd-more.is-rich>summary{
  border-color:#c2d9ef;
  background:linear-gradient(120deg,#eef6fd,#f8fbfe);
  box-shadow:inset 3px 0 0 #4a90c4;
}
.sgd-more.is-rich .sgd-fold-text b:after{
  content:"";display:inline-block;width:6px;height:6px;margin-left:7px;border-radius:50%;
  background:#4a90c4;vertical-align:middle;
}

.sgd-more-body{
  padding:16px 15px 14px;border:1px solid #d9e4f0;border-top:0;border-radius:0 0 12px 12px;background:#fff;
}
.sgd-sec{margin:0 0 20px}
.sgd-sec:last-child{margin:0}
.sgd-sec h4{margin:0 0 8px;font-size:12.8px;font-weight:700;color:#143761}
.sgd-sec-body{font-size:13.8px;line-height:1.6;color:#33475f}
.sgd-sec-body p{margin:0 0 8px}
.sgd-sec-body ul,.sgd-sec-body ol{margin:0 0 8px;padding-left:20px}
.sgd-sec-body li{margin:0 0 5px}
.sgd-sec-body table{width:100%;border-collapse:collapse;font-size:12.8px;margin:0 0 10px}
.sgd-sec-body th{padding:8px 10px;background:#f5f9fd;border-bottom:1.5px solid #dfe9f4;
  color:#4c6079;font-size:10.2px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;text-align:left}
.sgd-sec-body td{padding:8px 10px;border-bottom:1px solid #eef3f8;color:#33475f}

/* ── barre d'actions ── */
.sgd-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:14px}
.sgd-act{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 15px;border-radius:10px;
  cursor:pointer;border:1px solid var(--sgd-line);background:#fff;color:var(--sgd-soft);
  font-size:12.6px;font-weight:600;transition:.16s}
.sgd-act svg{width:15px;height:15px;stroke:currentColor;stroke-width:2;fill:none;
  stroke-linecap:round;stroke-linejoin:round}
.sgd-act:hover{color:var(--sgd-navy);border-color:#bcd6ee}
.sgd-act.is-main{border-color:transparent;background:var(--sgd-navy);color:#fff}
.sgd-act.is-main:hover{background:#0f2b4d}
.sgd-act-icon{padding:0 11px}
.sgd-act-icon svg{stroke:none;fill:currentColor}
.sgd-spacer{flex:1}
.sgd-format{color:var(--sgd-muted);font-size:10.8px;font-weight:600;white-space:nowrap}

.sgd-menu{position:relative;display:inline-flex}
.sgd-menu-pop{position:absolute;right:0;bottom:calc(100% + 6px);min-width:200px;padding:5px;border-radius:11px;
  border:1px solid var(--sgd-line);background:#fff;box-shadow:0 18px 40px -20px rgba(16,31,53,.35);
  display:none;z-index:20}
.sgd-menu.is-open .sgd-menu-pop{display:block}
.sgd-menu-pop button{display:flex;align-items:center;gap:9px;width:100%;padding:9px 11px;border:0;
  border-radius:8px;background:none;cursor:pointer;color:var(--sgd-soft);font-size:12.6px;
  font-weight:500;text-align:left}
.sgd-menu-pop button:hover{background:#f4f7fb;color:var(--sgd-navy)}
.sgd-menu-pop svg{width:15px;height:15px;stroke:currentColor;stroke-width:2;fill:none;
  stroke-linecap:round;stroke-linejoin:round;flex:0 0 15px}

/* ── mobile ── */
@media (max-width:600px){
  .sgd-main{padding:16px 15px;font-size:15px}
  .sgd-copy-main{opacity:1}
  .sgd-hint{display:none}
  .sgd-format{display:none}
  .sgd-act .sgd-act-label{display:none}
  .sgd-act.is-main .sgd-act-label{display:inline}
  .sgd-act{padding:0 13px}
  .sgd-promote{flex-wrap:wrap}
  .sgd-promote-btn{width:100%}
}

/* ── impression : le document seul, replis ouverts ── */
@media print{
  .sgd-actions,.sgd-copy-main,.sgd-piece-copy,.sgd-promote{display:none!important}
  .sgd-more>summary,.sgd-reveal>summary{display:none!important}
  .sgd-more,.sgd-reveal{border:0}
  .sgd-more-body,.sgd-reveal-body{display:block!important;padding:0;border:0}
  .sgd-main{background:#fff;border:0;padding:0;margin:8px 0 0}
  .sgd-piece{break-inside:avoid}
  .sgd-track-item{break-inside:avoid}
}

/* ── titres Markdown à l'intérieur d'une section ── */
.sgd-block-title{
  margin:0 0 10px!important;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;
  font-size:15px!important;font-weight:700!important;line-height:1.35!important;
  color:var(--sgd-navy)!important;
}
.sgd-main .sgd-block-title{font-size:16px!important}

/* ── contraste des actions secondaires (thème WordPress prioritaire) ── */
.sgd-actions .sgd-act{
  opacity:1!important;
  background:#fff!important;
  color:#3c5372!important;
  border:1px solid #ccd8e6!important;
  text-transform:none!important;
  letter-spacing:0!important;
}
.sgd-actions .sgd-act:hover{
  color:var(--sgd-navy)!important;
  border-color:#9dbcd9!important;
  background:#f7fafd!important;
}
.sgd-actions .sgd-act.is-main{
  background:#143761!important;
  border-color:#143761!important;
  color:#fff!important;
}
.sgd-actions .sgd-act.is-main:hover{background:#0f2b4d!important;color:#fff!important}
.sgd-actions .sgd-act.is-main svg{stroke:#fff!important}
.sgd-actions .sgd-act.is-main .sgd-act-label{color:#fff!important}
.sgd-actions .sgd-act[disabled]{opacity:.55!important}
.sgd-actions .sgd-act svg{opacity:1!important}

/* ══════════════════════════════════════════════════════════════
   Correctif de densité : le thème WordPress impose de grandes
   marges de paragraphe. Un courrier doit rester compact.
   ══════════════════════════════════════════════════════════════ */
.sagace-chat-message.assistant .sgd-main{
  padding:22px 24px!important;
  font-size:15.4px!important;
  line-height:1.58!important;
}
.sagace-chat-message.assistant .sgd-main-body p,
.sagace-chat-message.assistant .sgd-piece-body p{
  margin:0 0 9px!important;
  padding:0!important;
  font-size:inherit!important;
  line-height:inherit!important;
}
.sagace-chat-message.assistant .sgd-main-body p:last-child,
.sagace-chat-message.assistant .sgd-piece-body p:last-child{margin-bottom:0!important}
.sagace-chat-message.assistant .sgd-main-body ul,
.sagace-chat-message.assistant .sgd-main-body ol{margin:0 0 10px!important;padding-left:20px!important}
.sagace-chat-message.assistant .sgd-main-body li{margin:0 0 4px!important;line-height:1.5!important}
.sagace-chat-message.assistant .sgd-intro p,
.sagace-chat-message.assistant .sgd-lead p,
.sagace-chat-message.assistant .sgd-sec-body p{margin:0 0 8px!important;line-height:1.55!important}
.sagace-chat-message.assistant .sgd-intro p:last-child,
.sagace-chat-message.assistant .sgd-sec-body p:last-child{margin-bottom:0!important}
.sagace-chat-message.assistant .sgd-sec-body li{margin:0 0 4px!important}

/* ── encart « il me manque des informations » ── */
.sgd-need{
  display:block;margin:0 0 14px;padding:14px 16px;border-radius:12px;
  background:#fff8ec;border:1px solid #f3ddb4;color:#7a4a08;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:13.6px;line-height:1.55;
  animation:sgdNeed .28s ease-out;
}
@keyframes sgdNeed{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
.sgd-need b{display:block;margin:0 0 5px;font-size:14px;font-weight:700;color:#7a4a08}
.sgd-need p{margin:0!important;font-size:13.4px!important;line-height:1.55!important;color:#8a5a1a}
.sgd-need ul{margin:6px 0 0!important;padding-left:20px!important}
.sgd-need li{margin:0 0 3px!important;font-size:13.4px!important;color:#8a5a1a}

/* ── bouton « Répondre à la voix » : visible, invitant, mais pas criard ── */
.sgd-actions .sgd-act.sgd-act-voice{
  background:#eef5ff!important;
  border-color:#bfd8f5!important;
  color:#12559b!important;
}
.sgd-actions .sgd-act.sgd-act-voice:hover{
  background:#e2eeff!important;
  border-color:#8fbbec!important;
  color:#0d4478!important;
}
.sgd-actions .sgd-act.sgd-act-voice svg{stroke-width:2.1}

/* le champ du chat doit rester lisible malgré la classe textarea-wrap du thème */
.sagace-chat-compose.textarea-wrap{background:none;border:0;padding:0}

/* ── dictée en direct ── */
.sagace-chat-compose .sgd-mic{
  display:inline-flex!important;align-items:center;gap:7px;
  min-height:40px;padding:0 14px;border-radius:10px;cursor:pointer;
  border:1px solid #bfd8f5!important;background:#eef5ff!important;color:#12559b!important;
  font-size:12.6px;font-weight:600;transition:.16s;
}
.sagace-chat-compose .sgd-mic svg{width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none;
  stroke-linecap:round;stroke-linejoin:round}
.sagace-chat-compose .sgd-mic:hover{background:#e2eeff!important;border-color:#8fbbec!important}
.sagace-chat-compose .sgd-mic.is-listening,
.sgd-actions .sgd-act.is-listening{
  background:#fdecec!important;border-color:#e8a9a9!important;color:#b3261e!important;
  animation:sgdPulse 1.3s ease-in-out infinite;
}
@keyframes sgdPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(179,38,30,.28)}
  50%{box-shadow:0 0 0 7px rgba(179,38,30,0)}
}

.sgd-live{
  display:flex;align-items:center;gap:9px;margin:0 0 9px;padding:10px 13px;border-radius:10px;
  background:#fdecec;border:1px solid #f2cccc;color:#8f2b24;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:12.6px;font-weight:600;
  animation:sgdNeed .25s ease-out;
}
.sgd-live-dot{flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:#d94f45;
  animation:sgdBlink 1s ease-in-out infinite}
@keyframes sgdBlink{0%,100%{opacity:1}50%{opacity:.3}}
.sgd-live-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}

/* ══════════════════════════════════════════════════════════════
   Liste de suivi en phases : une seule ouverte à la fois
   ══════════════════════════════════════════════════════════════ */
.sgd-track-wrap{display:block}

.sgd-progress{display:flex;align-items:center;gap:12px;margin:0 0 14px}
.sgd-progress-bar{flex:1;height:6px;border-radius:99px;background:#e9eff7;overflow:hidden}
.sgd-progress-bar i{display:block;height:100%;width:0;border-radius:99px;
  background:linear-gradient(90deg,#176fbb,#22b8d6);transition:width .3s}
.sgd-progress-count{font-size:12.4px;font-weight:700;color:#4c6079;white-space:nowrap}
.sgd-expand{
  flex:0 0 auto;min-height:30px;padding:0 11px;border-radius:8px;cursor:pointer;
  border:1px solid #dbe5f0;background:#fff;color:#5b7085;font-size:11.2px;font-weight:600;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-expand:hover{border-color:#b7cfe6;color:#143761}

.sgd-phase{margin:0 0 8px;border:1px solid #e6edf5;border-radius:11px;overflow:hidden;background:#fff}
.sgd-phase>summary{
  display:flex;align-items:center;gap:10px;padding:11px 13px;cursor:pointer;list-style:none;
  background:#fafcfe;transition:.15s;
}
.sgd-phase>summary::-webkit-details-marker{display:none}
.sgd-phase>summary:hover{background:#f4f8fc}
.sgd-phase[open]>summary{border-bottom:1px solid #eef3f8;background:#fff}
.sgd-phase-n{
  flex:0 0 22px;width:22px;height:22px;border-radius:7px;display:grid;place-items:center;
  background:#eef4fb;color:#176fbb;font-size:11px;font-weight:800;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-phase-title{
  flex:1;min-width:0;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:13.4px;font-weight:650;color:#1c2f47;line-height:1.35;
}
.sgd-phase-count{
  flex:0 0 auto;padding:3px 9px;border-radius:99px;background:#f1f5fa;color:#6b7f96;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:11px;font-weight:700;
}
.sgd-phase-chev{
  flex:0 0 8px;width:8px;height:8px;border:solid #93a7bd;border-width:2px 2px 0 0;
  transform:rotate(135deg);margin-top:-3px;transition:transform .2s;
}
.sgd-phase[open] .sgd-phase-chev{transform:rotate(-45deg);margin-top:3px}

.sgd-phase.is-complete>summary{background:#f2fbf7}
.sgd-phase.is-complete .sgd-phase-n{background:#dcf5ea;color:#0f7a52}
.sgd-phase.is-complete .sgd-phase-title{color:#6b8296}
.sgd-phase.is-complete .sgd-phase-count{background:#dcf5ea;color:#0f7a52}

.sgd-track{list-style:none;margin:0;padding:6px 13px 10px;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.sgd-track-item{display:flex;align-items:flex-start;gap:11px;padding:10px 2px;cursor:pointer;
  border-bottom:1px solid #f0f4f9;font-size:14.2px;line-height:1.5;color:#22364f}
.sgd-track-item:last-child{border-bottom:0}
.sgd-track-item:focus-visible{outline:2px solid #176fbb;outline-offset:2px;border-radius:6px}
.sgd-box{flex:0 0 19px;width:19px;height:19px;margin-top:1px;border-radius:6px;
  border:1.7px solid #c2d1e2;background:#fff;position:relative;transition:.15s}
.sgd-box:after{content:"";position:absolute;left:5px;top:2px;width:5px;height:9px;
  border:solid #fff;border-width:0 2.4px 2.4px 0;transform:rotate(45deg);opacity:0;transition:.15s}
.sgd-track-item.is-done .sgd-box{background:#0f7a52;border-color:#0f7a52}
.sgd-track-item.is-done .sgd-box:after{opacity:1}
.sgd-track-item.is-done .sgd-track-label{color:#8496ac;text-decoration:line-through}

@media print{
  .sgd-expand{display:none!important}
  .sgd-phase{break-inside:avoid;border-color:#ccc}
  .sgd-phase>summary{display:flex!important;background:#fff}
  .sgd-phase-chev{display:none}
  .sgd-track{display:block!important}
}


/* ══════════════════════════════════════════════════════════════
   Choix en tête de tunnel : qui construit le livrable
   ══════════════════════════════════════════════════════════════ */
.sgd-choice{
  margin:0 0 20px;padding:16px 17px;border-radius:14px;
  border:1.5px solid #d3e3f2;background:linear-gradient(150deg,#f4f9ff,#fff 70%);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-choice-q{
  display:block;margin:0 0 11px;font-size:11.4px;font-weight:800;
  letter-spacing:.06em;text-transform:uppercase;color:#4a7fb0;
}
.sgd-choice-opts{display:flex;gap:10px;flex-wrap:wrap}
.sgd-choice-opt{
  flex:1 1 250px;min-width:0;text-align:left;padding:14px 15px;border-radius:12px;cursor:pointer;
  border:1.5px solid #dde7f2;background:#fff;transition:.16s;font-family:inherit;
}
.sgd-choice-opt b{display:block;font-size:14px;font-weight:700;color:#14283f;line-height:1.3}
.sgd-choice-opt small{display:block;margin-top:5px;font-size:12.4px;line-height:1.5;color:#5d7085;font-weight:400}
.sgd-choice-opt:hover{border-color:#a9c8e6;background:#fbfdff}
.sgd-choice-opt.is-on{
  border-color:#176fbb;background:linear-gradient(125deg,#eaf4fd,#fff);
  box-shadow:0 0 0 1px #176fbb inset, 0 12px 26px -20px rgba(23,111,187,.9);
}
.sgd-choice-opt.is-on b{color:#0f4d86}
.sgd-choice-opt.is-on b:before{
  content:"";display:inline-block;width:7px;height:7px;border-radius:50%;
  background:#176fbb;margin-right:8px;vertical-align:middle;
}
@media (max-width:620px){.sgd-choice-opt{flex:1 1 100%}}
@media print{.sgd-choice{display:none!important}}

/* ══════════════════════════════════════════════════════════════
   Étiquettes sur les cartes de service
   ══════════════════════════════════════════════════════════════ */
.sgd-badge{
  display:inline-flex;align-items:center;gap:5px;margin-top:8px;padding:4px 9px 4px 7px;
  border-radius:999px;border:1px solid;background:#fff;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:10.8px;font-weight:700;letter-spacing:.01em;line-height:1.2;
  white-space:nowrap;vertical-align:middle;
}
.sgd-badge svg{width:12px;height:12px;flex:0 0 12px}

.sgd-badge-choix{border-color:#bcdcf5;background:#eff7fe;color:#0f5b96}
.sgd-badge-document{border-color:#d5dfea;background:#f7fafd;color:#42597a}
.sgd-badge-analyse{border-color:#d9d3ef;background:#f6f4fd;color:#5a4a9c}
.sgd-badge-contenu{border-color:#f2d9c2;background:#fdf7f0;color:#9a5f20}
.sgd-badge-apprendre{border-color:#c5e3d6;background:#f1faf6;color:#1c7355}
.sgd-badge-etapes{border-color:#cfe0ef;background:#f5f9fd;color:#2f6390}

/* la carte reste lisible : l'étiquette ne casse pas la mise en page */
.em-card-copy .sgd-badge{align-self:flex-start}
@media (max-width:600px){
  .sgd-badge{font-size:10.2px;padding:3px 8px 3px 6px}
  .sgd-badge svg{width:11px;height:11px;flex:0 0 11px}
}
@media print{.sgd-badge{display:none!important}}

/* ══════════════════════════════════════════════════════════════
   Graphiques
   ══════════════════════════════════════════════════════════════ */
.sgd-chart{
  margin:16px 0;padding:16px 14px 12px;border-radius:14px;
  border:1px solid #e2eaf3;background:linear-gradient(160deg,#fbfdff,#fff 60%);
}
.sgd-chart svg{display:block;width:100%;height:auto;overflow:visible}
.sgd-chart-head{
  display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:0 4px;
}
.sgd-chart-dl{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;
  min-height:30px;padding:0 11px;border-radius:8px;cursor:pointer;
  border:1px solid #d5e2ee;background:#fff;color:#42597a;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:11.2px;font-weight:600;transition:.16s;
}
.sgd-chart-dl svg{width:13px;height:13px;flex:0 0 13px}
.sgd-chart-dl:hover{border-color:#a9c8e6;color:#143761;background:#f7fbff}
.sgd-chart-title{
  flex:1;min-width:0;margin:0;padding:0;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:13.4px;font-weight:700;color:#14283f;
}
.sgd-chart-legend{
  margin:10px 4px 0!important;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:12.2px!important;line-height:1.5!important;color:#5d7085;
}
.sgd-chart .sgd-grid{stroke:#e8eef6;stroke-width:1}
.sgd-chart .sgd-axis{stroke:#c9d6e4;stroke-width:1.2}
.sgd-chart .sgd-axis-y,
.sgd-chart .sgd-axis-x{
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:11px;fill:#7c8ea3;
}
.sgd-chart .sgd-axis-y{text-anchor:end}
.sgd-chart .sgd-axis-x{text-anchor:middle}
.sgd-chart .sgd-serie-label{
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:11.6px;font-weight:700;
}
.sgd-chart .sgd-threshold{stroke:#c0392b;stroke-width:1.6;stroke-dasharray:5 4;opacity:.8}
.sgd-chart .sgd-threshold-label{
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:11px;font-weight:700;fill:#c0392b;
}
/* repli tableau si le graphique ne peut pas être tracé */
.sgd-chart-plain table{width:100%;border-collapse:collapse;font-size:13px}
.sgd-chart-plain th{padding:8px 10px;border-bottom:1.5px solid #dfe9f4;text-align:left;
  font-family:system-ui,sans-serif;font-size:10.4px;font-weight:700;
  letter-spacing:.05em;text-transform:uppercase;color:#5d7085}
.sgd-chart-plain td{padding:8px 10px;border-bottom:1px solid #eef3f8;color:#22364f}
@media print{
  .sgd-chart{break-inside:avoid;background:#fff;border-color:#ccc}
}

/* ══════════════════════════════════════════════════════════════
   Verdict : lecture immédiate d'un risque ou d'un diagnostic
   ══════════════════════════════════════════════════════════════ */
.sgd-verdict{
  margin:0 0 18px;padding:16px 18px;border-radius:14px;border:1.5px solid;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-verdict-head{display:flex;align-items:flex-start;gap:13px;margin:0 0 11px}
.sgd-verdict-icon{
  flex:0 0 36px;width:36px;height:36px;border-radius:11px;display:grid;place-items:center;
  background:#fff;border:1.5px solid currentColor;
}
.sgd-verdict-icon svg{width:19px;height:19px}
.sgd-verdict-copy{flex:1;min-width:0}
.sgd-verdict-level{
  display:block;font-size:10.6px;font-weight:800;letter-spacing:.08em;
  text-transform:uppercase;margin:0 0 3px;
}
.sgd-verdict-copy b{
  display:block;font-size:16px;font-weight:700;line-height:1.35;color:#14283f;
}
.sgd-verdict-why{
  margin:0 0 12px!important;font-size:14px!important;line-height:1.6!important;color:#33475f!important;
}
.sgd-verdict-points{margin:0 0 12px!important;padding-left:19px!important}
.sgd-verdict-points li{
  margin:0 0 5px!important;font-size:13.4px!important;line-height:1.5!important;color:#3b4f68!important;
}
.sgd-verdict-action{
  display:flex;gap:11px;align-items:baseline;padding:11px 13px;border-radius:10px;
  background:rgba(255,255,255,.72);border:1px solid rgba(0,0,0,.06);
  font-size:13.6px;line-height:1.5;color:#22364f;
}
.sgd-verdict-action-k{
  flex:0 0 auto;font-size:10.4px;font-weight:800;letter-spacing:.06em;
  text-transform:uppercase;color:inherit;opacity:.75;
}
.sgd-verdict-note{
  margin:10px 0 0!important;font-size:11.4px!important;line-height:1.45!important;
  color:#8496ac!important;font-style:italic;
}

.sgd-verdict-ok{border-color:#b3e6cd;background:linear-gradient(150deg,#f0fbf6,#fff 70%);color:#0f7a52}
.sgd-verdict-watch{border-color:#c9dcf0;background:linear-gradient(150deg,#f2f8fe,#fff 70%);color:#1f6399}
.sgd-verdict-warn{border-color:#f0d9ae;background:linear-gradient(150deg,#fdf8ee,#fff 70%);color:#a9701a}
.sgd-verdict-stop{border-color:#f0c4bf;background:linear-gradient(150deg,#fdf2f1,#fff 70%);color:#b3352a}

@media (max-width:600px){
  .sgd-verdict{padding:14px 15px}
  .sgd-verdict-copy b{font-size:15px}
  .sgd-verdict-action{flex-direction:column;gap:4px}
}
@media print{.sgd-verdict{break-inside:avoid;background:#fff}}

/* ── courrier : en-têtes séparés du corps ── */
.sgd-main-letter{padding:0!important;overflow:hidden}
.sgd-letter-tools{
  display:flex;justify-content:flex-end;gap:5px;padding:10px 14px;
  background:#fbfdfe;border-bottom:1px solid #eef3f8;
}
.sgd-main-letter .sgd-piece-meta{padding:13px 18px 0}
.sgd-main-letter .sgd-piece-body{padding:13px 18px 18px}
.sgd-main[data-piece] .sgd-piece-body{
  font-family:Newsreader,Georgia,"Times New Roman",serif;
  font-size:15.4px;line-height:1.58;color:#1c2f47;
}
.sagace-chat-message.assistant .sgd-main[data-piece] .sgd-piece-body p{
  margin:0 0 9px!important;line-height:1.58!important;
}
.sgd-main[data-piece]{position:relative}
.sgd-main[data-piece] .sgd-copy-main{position:absolute;top:11px;right:11px}
.sgd-main-letter .sgd-copy-main{display:none}
@media (max-width:600px){
  .sgd-letter-tools{flex-wrap:wrap}
  .sgd-letter-tools .sgd-piece-btn{flex:1}
}
@media print{.sgd-letter-tools{display:none!important}}

/* ══════════════════════════════════════════════════════════════
   Canal : l'habillage s'adapte au support
   ══════════════════════════════════════════════════════════════ */
.sgd-chan{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;
  padding:3px 9px 3px 7px;border-radius:999px;border:1px solid;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:10.4px;font-weight:700;white-space:nowrap;
}
.sgd-chan svg{width:11px;height:11px;flex:0 0 11px}
.sgd-chan-sms{border-color:#c3e2d4;background:#f1faf6;color:#1c7355}
.sgd-chan-email{border-color:#c6dcec;background:#f2f8fd;color:#1f6399}
.sgd-chan-courrier{border-color:#d8cfc0;background:#faf7f2;color:#7d6642}
.sgd-chan-appel{border-color:#d5d0ea;background:#f6f4fc;color:#5a4a9c}
.sgd-chan-linkedin{border-color:#bcd6ee;background:#eff6fd;color:#12559b}
.sgd-chan-reseau{border-color:#eed0dc;background:#fdf3f7;color:#9c4d65}

.sgd-piece-foot{
  padding:8px 14px 11px;border-top:1px dashed #edf2f7;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-meter{
  display:inline-flex;align-items:center;gap:6px;font-size:11.2px;font-weight:700;
}
.sgd-meter:before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.sgd-meter-ok{color:#1c7355}
.sgd-meter-warn{color:#a9701a}
.sgd-meter-over{color:#b3352a}
.sgd-meter-neutral{color:#8ba0b7;font-weight:600}
.sgd-meter-neutral:before{display:none}

/* SMS : on lit dans une bulle, pas dans un document */
.sgd-piece-sms .sgd-piece-body{
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;
  font-size:14.4px!important;line-height:1.5!important;
  margin:12px 14px;padding:12px 15px;border-radius:16px 16px 16px 5px;
  background:#eef7f2;border:1px solid #d3ebe0;color:#123f30;max-width:min(430px,100%);
}
.sagace-chat-message.assistant .sgd-piece-sms .sgd-piece-body p{margin:0 0 7px!important}

/* Courrier : allure de page, prêt à imprimer */
.sgd-piece-courrier .sgd-piece-body{
  font-family:Newsreader,Georgia,"Times New Roman",serif!important;
  font-size:15.4px!important;line-height:1.7!important;
  padding:20px 24px!important;background:#fffdfa;border-top:1px solid #f0e9de;
}

/* Appel : les tours de parole se distinguent */
.sgd-piece-appel .sgd-piece-body{
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;font-size:14.4px!important;
}
.sagace-chat-message.assistant .sgd-piece-appel .sgd-piece-body p{
  padding-left:13px;border-left:2px solid #ddd7f0;margin:0 0 10px!important;
}

.sgd-letter-spacer{flex:1}
@media print{.sgd-chan,.sgd-piece-foot{display:none!important}}

/* ── commentaire de l'agent, hors du message copiable ── */
.sgd-piece-note{
  margin:11px 14px 0;padding:9px 12px;border-radius:9px;
  background:#f7f9fc;border:1px dashed #dde6f0;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sagace-chat-message.assistant .sgd-piece-note p,
.sagace-chat-message.assistant .sgd-piece-note li{
  margin:0 0 5px!important;font-size:12.2px!important;line-height:1.5!important;color:#6b7f96!important;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;
}
.sagace-chat-message.assistant .sgd-piece-note p:last-child{margin-bottom:0!important}
.sgd-main-letter .sgd-piece-note{margin:11px 18px 0}

/* ══════════════════════════════════════════════════════════════
   Relances — la séance continue avec l'agent
   ══════════════════════════════════════════════════════════════ */
.sgd-relances{
  margin:18px 0 0;padding:14px 15px;border-radius:13px;
  border:1px solid #dbe7f3;background:linear-gradient(140deg,#f5faff,#fff 70%);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-relances-k{
  display:block;margin:0 0 9px;font-size:10.6px;font-weight:800;
  letter-spacing:.07em;text-transform:uppercase;color:#5d7fa3;
}
.sgd-relances-list{display:flex;gap:8px;flex-wrap:wrap}
.sgd-relance{
  min-height:36px;padding:0 14px;border-radius:999px;cursor:pointer;
  border:1px solid #c8dcee;background:#fff;color:#16548c;
  font-family:inherit;font-size:12.6px;font-weight:650;transition:.15s;
}
.sgd-relance:hover{border-color:#8fb9dd;background:#f2f9ff;color:#0f4272}
.sgd-relance:active{transform:translateY(1px)}

/* Corrigé sous condition : chercher avant de voir */
.sgd-gate{
  margin:14px 0 0;padding:15px 16px;border-radius:13px;
  border:1.5px dashed #d7c9a8;background:linear-gradient(140deg,#fffdf6,#fff 70%);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-gate-head{display:flex;align-items:flex-start;gap:12px;margin:0 0 13px}
.sgd-gate-icon{
  flex:0 0 32px;width:32px;height:32px;border-radius:10px;position:relative;
  background:#fdf3dd;border:1px solid #ecdcb4;
}
.sgd-gate-icon:before{
  content:"";position:absolute;left:11px;top:8px;width:10px;height:7px;
  border:2px solid #a9821f;border-bottom:0;border-radius:5px 5px 0 0;
}
.sgd-gate-icon:after{
  content:"";position:absolute;left:8px;top:14px;width:16px;height:11px;
  border-radius:3px;background:#a9821f;
}
.sgd-gate-head b{display:block;font-size:13.6px;font-weight:700;color:#4a3a12;line-height:1.3}
.sgd-gate-head small{display:block;margin-top:3px;font-size:12.2px;line-height:1.45;color:#7b6a45}
.sgd-gate-actions{display:flex;gap:8px;flex-wrap:wrap}
.sgd-gate-try,.sgd-gate-hint,.sgd-gate-open{
  min-height:36px;padding:0 14px;border-radius:999px;cursor:pointer;
  font-family:inherit;font-size:12.4px;font-weight:650;transition:.15s;
}
.sgd-gate-try{border:0;background:#a9821f;color:#fff}
.sgd-gate-try:hover{background:#8e6d18}
.sgd-gate-hint{border:1px solid #e2d3ad;background:#fff;color:#7b6a45}
.sgd-gate-hint:hover{border-color:#cdb887;background:#fffbf0}
.sgd-gate-open{border:1px solid transparent;background:transparent;color:#9b8a63;text-decoration:underline}
.sgd-gate-open:hover{color:#6f6041}
.sgd-gate-body{margin-top:14px;padding-top:13px;border-top:1px solid #eee2c6}
.sgd-gate-body[hidden]{display:none!important}
.sgd-gate.is-open{border-style:solid;border-color:#e6dcc4}
@media print{
  .sgd-relances,.sgd-gate-actions{display:none!important}
  .sgd-gate-body{display:block!important}
  .sgd-gate{border-style:solid;background:#fff}
}

/* ── Mémo Vivante : orientation vers l'atelier dédié ── */
.sgd-memo{
  margin:0 0 18px;padding:17px 18px;border-radius:14px;
  border:1.5px solid rgba(239,68,68,.26);
  background:linear-gradient(140deg,#fff8f8 0%,#fff 55%,#fff1f1 100%);
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-memo-head{display:flex;align-items:flex-start;gap:13px;margin:0 0 14px}
.sgd-memo-spark{
  flex:0 0 34px;width:34px;height:34px;border-radius:11px;display:grid;place-items:center;
  background:#fff;border:1px solid rgba(239,68,68,.28);color:#ef4444;font-size:15px;
  box-shadow:0 10px 22px -16px rgba(239,68,68,.7);
}
.sgd-memo-head b{display:block;font-size:14.4px;font-weight:800;color:#0f2a52;line-height:1.3}
.sgd-memo-head small{display:block;margin-top:4px;font-size:12.6px;line-height:1.5;color:#5d7085}
.sgd-memo-go{
  display:inline-flex;align-items:center;min-height:42px;padding:0 20px;border-radius:999px;
  background:linear-gradient(135deg,#0f2a52,#2563eb);color:#fff!important;
  font-size:13.4px;font-weight:750;text-decoration:none!important;
  box-shadow:0 16px 30px -20px rgba(37,99,235,.95);transition:.16s;
}
.sgd-memo-go:hover{transform:translateY(-1px);box-shadow:0 20px 36px -20px rgba(37,99,235,1)}
.sgd-memo-note{
  margin:11px 0 0!important;font-size:11.8px!important;line-height:1.5!important;color:#8496ac!important;
}
@media print{.sgd-memo-go{display:none!important}}
.sgd-badge-exercices{border-color:#d9cdea;background:#f8f5fd;color:#6b4a9c}
.sgd-badge-enseigner{border-color:#c2d9ef;background:#f2f8fe;color:#1f6399}
.sgd-badge-memo{border-color:rgba(239,68,68,.32);background:linear-gradient(135deg,#fff7f7,#fff);color:#c0392b}

/* ══════════════════════════════════════════════════════════════
   Mathématiques : fractions empilées, lisibles par un élève
   ══════════════════════════════════════════════════════════════ */
.sgd-math{
  display:inline-flex;align-items:center;gap:.28em;flex-wrap:wrap;
  font-family:"Cambria Math","Latin Modern Math",Georgia,"Times New Roman",serif;
  font-size:1.06em;line-height:1;vertical-align:middle;
}
.sgd-math-block{
  display:flex!important;justify-content:center;width:100%;
  margin:14px 0;padding:14px 16px;border-radius:11px;
  background:#f7fafd;border:1px solid #e4ecf5;font-size:1.22em;
}
.sgd-frac{
  display:inline-flex;flex-direction:column;align-items:center;
  vertical-align:middle;margin:0 .16em;line-height:1.12;
}
.sgd-frac-n{padding:0 .32em .1em;border-bottom:1.4px solid currentColor}
.sgd-frac-d{padding:.1em .32em 0}
.sgd-sqrt{display:inline-flex;align-items:flex-start}
.sgd-sqrt-b{border-top:1.3px solid currentColor;padding:.1em .18em 0;margin-left:.06em}
.sgd-math sup,.sgd-math sub{font-size:.66em;line-height:0}
.sgd-math sup{vertical-align:super}
.sgd-math sub{vertical-align:sub}
.sgd-mathtext{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:.9em}
@media print{.sgd-math-block{background:#fff;border-color:#ccc;break-inside:avoid}}

/* ══════════════════════════════════════════════════════════════
   Survols : le thème WordPress ne doit jamais reprendre la main
   ══════════════════════════════════════════════════════════════ */
.sagace-chat-row .sgd-relance,
.sagace-chat-row .sgd-relance:hover,
.sagace-chat-row .sgd-relance:focus,
.sagace-chat-row .sgd-relance:active{
  background:#fff!important;color:#16548c!important;border:1px solid #c8dcee!important;
  text-decoration:none!important;box-shadow:none!important;
}
.sagace-chat-row .sgd-relance:hover{background:#eef6fd!important;border-color:#8fb9dd!important;color:#0f4272!important}

.sagace-chat-row .sgd-gate-try,
.sagace-chat-row .sgd-gate-try:hover,
.sagace-chat-row .sgd-gate-try:focus{
  background:#8a6a15!important;color:#fff!important;border:0!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-gate-try:hover{background:#6f5410!important}

.sagace-chat-row .sgd-gate-hint,
.sagace-chat-row .sgd-gate-hint:hover,
.sagace-chat-row .sgd-gate-hint:focus{
  background:#fff!important;color:#6b5a2f!important;border:1px solid #e2d3ad!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-gate-hint:hover{background:#fdf8ea!important;border-color:#cdb887!important}

.sagace-chat-row .sgd-gate-open,
.sagace-chat-row .sgd-gate-open:hover,
.sagace-chat-row .sgd-gate-open:focus{
  background:transparent!important;color:#8a7c5a!important;border:0!important;
}
.sagace-chat-row .sgd-gate-open:hover{color:#5f5335!important}

.sagace-chat-row .sgd-piece-btn,
.sagace-chat-row .sgd-piece-btn:hover,
.sagace-chat-row .sgd-piece-btn:focus{
  background:#fff!important;color:#42597a!important;border:1px solid #d5e2ee!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-piece-btn:hover{background:#f4f9fe!important;border-color:#a9c8e6!important;color:#143761!important}

.sagace-chat-row .sgd-copy-all,
.sagace-chat-row .sgd-copy-all:hover{background:#143761!important;color:#fff!important;border:0!important}
.sagace-chat-row .sgd-copy-all:hover{background:#0f2b4d!important}

.sagace-chat-row .sgd-chart-dl,
.sagace-chat-row .sgd-chart-dl:hover{background:#fff!important;color:#42597a!important;border:1px solid #d5e2ee!important}
.sagace-chat-row .sgd-chart-dl:hover{background:#f4f9fe!important;color:#143761!important}

.sagace-chat-row .sgd-expand,
.sagace-chat-row .sgd-expand:hover{background:#fff!important;color:#5b7085!important;border:1px solid #dbe5f0!important}
.sagace-chat-row .sgd-expand:hover{background:#f4f9fe!important;color:#143761!important}

.sgd-memo-go,.sgd-memo-go:hover,.sgd-memo-go:focus{color:#fff!important;text-decoration:none!important}
/* ══════════════════════════════════════════════════════════════════
   MISE EN PAGE ÉDUCATION — transposition des maquettes « Papier »
   Palette claire, accents pastel rotatifs, étapes numérotées.
   Ne s'applique qu'aux régimes éducatifs, jamais au professionnel.
   ══════════════════════════════════════════════════════════════════ */

.sagace-chat-row[data-sagace-univers="education"]{
  --edu-bg:#eff3f8;
  --edu-card:#fdfefe;
  --edu-ink:#132a44;
  --edu-soft:#4c6079;
  --edu-muted:#8ba0b7;
  --edu-line:#dde7f0;
  --edu-key:#3d7ba8;
  --edu-key-l:#c6dcec;
  --edu-key-s:#e9f1f8;
}

/* ── Les six accents pastel, appliqués par rotation ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec:nth-of-type(6n+1),
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece:nth-of-type(6n+1){--tone:#e9f1f8;--tone-l:#c6dcec;--tone-i:#2d6389}
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec:nth-of-type(6n+2),
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece:nth-of-type(6n+2){--tone:#e5f2ec;--tone-l:#c3e2d4;--tone-i:#1f7358}
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec:nth-of-type(6n+3),
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece:nth-of-type(6n+3){--tone:#eeecf8;--tone-l:#d5d1ee;--tone-i:#574b9b}
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec:nth-of-type(6n+4),
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece:nth-of-type(6n+4){--tone:#fdefe4;--tone-l:#f5d7bd;--tone-i:#9a5a1f}
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec:nth-of-type(6n+5),
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece:nth-of-type(6n+5){--tone:#fdecef;--tone-l:#f3ccd6;--tone-i:#9c3f5b}
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec:nth-of-type(6n+6),
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece:nth-of-type(6n+6){--tone:#fdf6e0;--tone-l:#eee0b0;--tone-i:#8a6a15}

/* ── Le bloc principal devient une page claire, pas un document ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-main{
  border-radius:16px;border-color:var(--edu-line);
  background:linear-gradient(170deg,#fff 0%,#fbfdff 100%);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-main .sgd-piece-body,
.sagace-chat-row[data-sagace-univers="education"] .sgd-main-body{
  font-family:Newsreader,Georgia,"Times New Roman",serif;
  font-size:16px;line-height:1.72;color:var(--edu-ink);
}

/* ── L'ouverture de l'agent : ton parlé, mise en avant ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-intro{
  padding:15px 17px;border-radius:14px;
  background:var(--edu-key-s);border:1px solid var(--edu-key-l);
}
.sagace-chat-message.assistant .sagace-chat-row[data-sagace-univers="education"] .sgd-intro p,
.sagace-chat-row[data-sagace-univers="education"] .sgd-intro p{
  font-size:15.4px!important;line-height:1.62!important;color:#1c3d5c!important;
}

/* ── Étapes numérotées : chaque exercice porte sa pastille ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece{
  border-color:var(--tone-l,#dde7f0);
  background:linear-gradient(160deg,var(--tone,#f7fafd) 0%,#fff 62%);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece-head{
  background:transparent;border-bottom:1px solid var(--tone-l,#e6edf5);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece-n{
  width:26px;height:26px;flex:0 0 26px;border-radius:50%;
  background:#fff;border:1.5px solid var(--tone-l,#c6dcec);
  color:var(--tone-i,#2d6389);font-size:12px;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece-head b{
  font-size:13.6px;color:var(--tone-i,#132a44);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-piece-body{
  font-family:Newsreader,Georgia,serif;font-size:15.6px;line-height:1.68;
}

/* ── Rubriques du repli : liseré coloré, comme les maquettes ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec{
  padding:2px 0 2px 15px;border-left:3px solid var(--tone-l,#dde7f0);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-sec h4{
  color:var(--tone-i,#2d6389);font-size:13px;
}

/* ── Astuce mémoire : le bloc « hook » des maquettes ── */
.sgd-astuce{
  display:flex;align-items:flex-start;gap:12px;
  margin:14px 0;padding:14px 16px;border-radius:14px;
  background:#eeecf8;border:1px solid #d5d1ee;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-astuce-em{
  flex:0 0 34px;width:34px;height:34px;border-radius:11px;display:grid;place-items:center;
  background:#fff;border:1px solid #d5d1ee;font-size:17px;line-height:1;
}
.sgd-astuce-tx{flex:1;min-width:0;font-size:13.8px;line-height:1.58;color:#3a3268}
.sgd-astuce-tx b{display:block;margin:0 0 4px;font-size:11px;font-weight:800;
  letter-spacing:.06em;text-transform:uppercase;color:#574b9b}

/* ── Point de vérification : celui qui fait produire ── */
.sgd-verif{
  margin:16px 0;padding:15px 17px;border-radius:14px;
  background:linear-gradient(160deg,#fdefe4,#fff 66%);border:1.5px solid #f5d7bd;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-verif-h{display:flex;align-items:center;gap:10px;margin:0 0 10px}
.sgd-verif-n{
  width:26px;height:26px;flex:0 0 26px;border-radius:50%;display:grid;place-items:center;
  background:#9a5a1f;color:#fff;font-size:12px;font-weight:800;
}
.sgd-verif-h span:last-child{font-size:11.4px;font-weight:800;letter-spacing:.06em;
  text-transform:uppercase;color:#9a5a1f}
.sagace-chat-message.assistant .sgd-verif p{
  margin:0 0 8px!important;font-size:15px!important;line-height:1.6!important;color:#5c3a17!important;
  font-family:Newsreader,Georgia,serif!important;
}
.sagace-chat-message.assistant .sgd-verif p:last-child{margin-bottom:0!important}

/* ── Acquis : cases plus douces qu'en professionnel ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-track-item{
  font-size:14.6px;padding:11px 2px;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-box{
  border-radius:8px;border-color:#c3d8e8;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-track-item.is-done .sgd-box{
  background:#1f7358;border-color:#1f7358;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-track-item.is-done .sgd-track-label{
  color:#6e8398;text-decoration:none;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-progress-bar i{
  background:linear-gradient(90deg,#3d7ba8,#5fb39a);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-phase{
  border-color:#dde7f0;border-radius:14px;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-phase-n{
  border-radius:50%;background:#e9f1f8;color:#2d6389;
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-phase.is-complete .sgd-phase-n{
  background:#c3e2d4;color:#1f7358;
}

/* ── Relances : plus chaleureuses en Éducation ── */
.sagace-chat-row[data-sagace-univers="education"] .sgd-relances{
  border-color:#c6dcec;background:linear-gradient(140deg,#e9f1f8,#fff 72%);
}
.sagace-chat-row[data-sagace-univers="education"] .sgd-relances-k{color:#2d6389}

@media (max-width:600px){
  .sgd-astuce{padding:12px 13px;gap:10px}
  .sgd-astuce-em{flex:0 0 30px;width:30px;height:30px;font-size:15px}
  .sagace-chat-row[data-sagace-univers="education"] .sgd-sec{padding-left:12px}
}
@media print{
  .sgd-astuce,.sgd-verif{break-inside:avoid;background:#fff}
  .sagace-chat-row[data-sagace-univers="education"] .sgd-piece{background:#fff}
}

/* ── Éducation : les étapes de la séance, visibles et rythmées ── */
.sgd-step{margin:18px 0 0;padding:0 0 0 16px;border-left:3px solid var(--tone-l,#dde7f0)}
.sgd-step:first-child{margin-top:16px}
.sgd-step h4{
  margin:0 0 8px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:13.4px;font-weight:800;letter-spacing:.01em;color:var(--tone-i,#2d6389);
}
.sgd-step-body{font-family:Newsreader,Georgia,"Times New Roman",serif;
  font-size:15.4px;line-height:1.7;color:#22364f}
.sagace-chat-message.assistant .sgd-step-body p{margin:0 0 10px!important;line-height:1.7!important}
.sagace-chat-message.assistant .sgd-step-body p:last-child{margin-bottom:0!important}
.sgd-step-body ul,.sgd-step-body ol{margin:0 0 10px;padding-left:21px}
.sgd-step-body li{margin:0 0 6px;line-height:1.6}
.sgd-step-body table{width:100%;border-collapse:collapse;font-size:13.4px;margin:0 0 10px;
  font-family:system-ui,sans-serif}
.sgd-step-body th{padding:8px 10px;background:var(--tone,#f5f9fd);border-bottom:1.5px solid var(--tone-l,#dfe9f4);
  font-size:10.4px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;
  color:var(--tone-i,#4c6079);text-align:left}
.sgd-step-body td{padding:8px 10px;border-bottom:1px solid #eef3f8;color:#33475f}

/* accents rotatifs sur les étapes */
.sagace-chat-row[data-sagace-univers="education"] .sgd-step:nth-of-type(6n+1){--tone:#e9f1f8;--tone-l:#c6dcec;--tone-i:#2d6389}
.sagace-chat-row[data-sagace-univers="education"] .sgd-step:nth-of-type(6n+2){--tone:#e5f2ec;--tone-l:#c3e2d4;--tone-i:#1f7358}
.sagace-chat-row[data-sagace-univers="education"] .sgd-step:nth-of-type(6n+3){--tone:#eeecf8;--tone-l:#d5d1ee;--tone-i:#574b9b}
.sagace-chat-row[data-sagace-univers="education"] .sgd-step:nth-of-type(6n+4){--tone:#fdefe4;--tone-l:#f5d7bd;--tone-i:#9a5a1f}
.sagace-chat-row[data-sagace-univers="education"] .sgd-step:nth-of-type(6n+5){--tone:#fdecef;--tone-l:#f3ccd6;--tone-i:#9c3f5b}
.sagace-chat-row[data-sagace-univers="education"] .sgd-step:nth-of-type(6n+6){--tone:#fdf6e0;--tone-l:#eee0b0;--tone-i:#8a6a15}
@media (max-width:600px){.sgd-step{padding-left:12px}.sgd-step-body{font-size:14.8px}}
@media print{.sgd-step{break-inside:avoid}}
.sgd-substep{
  margin:14px 0 7px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:12.8px;font-weight:750;color:#3c5470;
}
.sgd-step-body + .sgd-substep{margin-top:16px}

/* ══════════════════════════════════════════════════════════════
   Séance d'exercices : un à la fois, avec réponse de l'élève
   ══════════════════════════════════════════════════════════════ */
.sgd-exo-bar{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  margin:16px 0 12px;padding:11px 14px;border-radius:12px;
  background:#e9f1f8;border:1px solid #c6dcec;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-exo-count{flex:0 0 auto;font-size:12.6px;font-weight:700;color:#2d6389}
.sgd-exo-count b{font-size:15px;color:#1f7358}
.sgd-exo-hint-text{flex:1;min-width:0;font-size:11.6px;line-height:1.4;color:#5d7fa3}
.sgd-exo-all{
  flex:0 0 auto;min-height:31px;padding:0 12px;border-radius:8px;cursor:pointer;
  border:1px solid #c6dcec;background:#fff;color:#2d6389;
  font-family:inherit;font-size:11.4px;font-weight:650;
}
.sgd-exo-all:hover{background:#f4f9fd;border-color:#a4c8e2}

.sgd-exo{
  margin:0 0 12px;border:1.5px solid #dde7f0;border-radius:15px;overflow:hidden;
  background:#fff;transition:border-color .2s,opacity .2s;
}
.sgd-exo:last-child{margin-bottom:0}
.sgd-exo-head{
  display:flex;align-items:center;gap:11px;padding:12px 14px;
  background:linear-gradient(160deg,#f5f9fd,#fff);border-bottom:1px solid #eef3f8;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-exo-n{
  flex:0 0 27px;width:27px;height:27px;border-radius:50%;display:grid;place-items:center;
  background:#fff;border:1.5px solid #c6dcec;color:#2d6389;font-size:12.4px;font-weight:800;
}
.sgd-exo-head b{flex:1;min-width:0;font-size:13.8px;font-weight:700;color:#14283f}
.sgd-exo-state{
  flex:0 0 auto;padding:4px 10px;border-radius:999px;
  background:#e9f1f8;color:#2d6389;font-size:10.4px;font-weight:800;
  letter-spacing:.05em;text-transform:uppercase;
}
.sgd-exo-body{
  padding:15px 16px;font-family:Newsreader,Georgia,"Times New Roman",serif;
  font-size:15.6px;line-height:1.68;color:#1c2f47;
}
.sagace-chat-message.assistant .sgd-exo-body p{margin:0 0 9px!important}
.sagace-chat-message.assistant .sgd-exo-body p:last-child{margin-bottom:0!important}

.sgd-exo-answer{padding:0 16px 16px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.sgd-exo-label{
  display:block;margin:0 0 7px;font-size:10.6px;font-weight:800;
  letter-spacing:.06em;text-transform:uppercase;color:#5d7fa3;
}
.sgd-exo-input{
  width:100%;padding:11px 13px;border-radius:11px;border:1.5px solid #d3e2ee;
  background:#fbfdff;color:#14283f;font-family:inherit;font-size:14.4px;line-height:1.5;
  resize:vertical;outline:none;transition:.15s;
}
.sgd-exo-input:focus{border-color:#7fb0d8;box-shadow:0 0 0 3px rgba(61,123,168,.12);background:#fff}
.sgd-exo-input[readonly]{background:#f4f7fa;color:#6b7f96}
.sgd-exo-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.sgd-exo-send,.sgd-exo-hint{
  min-height:38px;padding:0 16px;border-radius:999px;cursor:pointer;
  font-family:inherit;font-size:12.8px;font-weight:700;transition:.15s;
}
.sagace-chat-row .sgd-exo-send,
.sagace-chat-row .sgd-exo-send:hover{
  border:0!important;background:#1f7358!important;color:#fff!important;text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-send:hover{background:#175a45!important}
.sagace-chat-row .sgd-exo-send:disabled{background:#a8bcb5!important;cursor:default}
.sagace-chat-row .sgd-exo-hint,
.sagace-chat-row .sgd-exo-hint:hover{
  border:1px solid #d3e2ee!important;background:#fff!important;color:#42597a!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-hint:hover{background:#f4f9fd!important;border-color:#a4c8e2!important}
.sgd-exo-err{
  margin:9px 0 0!important;font-size:12.2px!important;line-height:1.45!important;color:#b3352a!important;
}
.sgd-exo-err[hidden]{display:none!important}

/* Verrouillé : on voit qu'il existe, on ne le lit pas encore */
.sgd-exo[data-state="locked"]{border-style:dashed;border-color:#e3eaf2;background:#fbfcfe}
.sgd-exo[data-state="locked"] .sgd-exo-body,
.sgd-exo[data-state="locked"] .sgd-exo-answer{display:none}
.sgd-exo[data-state="locked"] .sgd-exo-head{background:transparent;border-bottom:0;opacity:.62}
.sgd-exo[data-state="locked"] .sgd-exo-state{background:#f0f3f7;color:#8ba0b7}

/* Envoyé : l'exercice reste lisible mais s'efface visuellement */
.sgd-exo[data-state="done"]{border-color:#c3e2d4;background:#fbfefd}
.sgd-exo[data-state="done"] .sgd-exo-n{border-color:#c3e2d4;background:#e5f2ec;color:#1f7358}
.sgd-exo[data-state="done"] .sgd-exo-state{background:#e5f2ec;color:#1f7358}

@media (max-width:600px){
  .sgd-exo-hint-text{flex:1 1 100%;order:3}
  .sgd-exo-send,.sgd-exo-hint{flex:1}
}
@media print{
  .sgd-exo-answer,.sgd-exo-bar{display:none!important}
  .sgd-exo[data-state="locked"] .sgd-exo-body{display:block!important}
  .sgd-exo[data-state="locked"]{border-style:solid;opacity:1}
  .sgd-exo[data-state="locked"] .sgd-exo-head{opacity:1}
}

/* ── Retour de l'agent, affiché sous l'exercice ── */
.sgd-exo-retour{
  margin:0 16px 16px;padding:13px 15px;border-radius:12px;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
}
.sgd-exo-retour[hidden]{display:none!important}
.sgd-exo-retour.is-loading{
  display:flex;align-items:center;gap:11px;
  background:#f4f8fc;border:1px solid #dde7f0;color:#5d7fa3;font-size:12.8px;
}
.sgd-exo-dots{display:inline-flex;gap:4px}
.sgd-exo-dots i{
  width:6px;height:6px;border-radius:50%;background:#7fb0d8;
  animation:sgdDot 1s infinite ease-in-out;
}
.sgd-exo-dots i:nth-child(2){animation-delay:.15s}
.sgd-exo-dots i:nth-child(3){animation-delay:.3s}
@keyframes sgdDot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

.sgd-exo-retour.is-done{background:linear-gradient(150deg,#effaf5,#fff 70%);border:1.5px solid #c3e2d4}
.sgd-exo-retour.is-hint{background:linear-gradient(150deg,#fdf8ea,#fff 70%);border:1.5px solid #eee0b0}
.sgd-exo-retour.is-error{background:#fdecec;border:1px solid #f2cccc;color:#8f2b24;font-size:12.8px}
.sagace-chat-message.assistant .sgd-exo-retour.is-error p{margin:0!important;color:#8f2b24!important}

.sgd-exo-retour-h{display:flex;align-items:center;gap:9px;margin:0 0 9px}
.sgd-exo-retour-i{
  width:22px;height:22px;flex:0 0 22px;border-radius:7px;position:relative;background:#fff;
  border:1.5px solid currentColor;
}
.sgd-exo-retour.is-done .sgd-exo-retour-h{color:#1f7358}
.sgd-exo-retour.is-hint .sgd-exo-retour-h{color:#8a6a15}
.sgd-exo-retour.is-done .sgd-exo-retour-i:after{
  content:"";position:absolute;left:6px;top:4px;width:6px;height:10px;
  border:solid #1f7358;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.sgd-exo-retour.is-hint .sgd-exo-retour-i:after{
  content:"";position:absolute;left:9px;top:4px;width:2px;height:9px;border-radius:2px;background:#8a6a15;
}
.sgd-exo-retour-h b{font-size:11.2px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.sgd-exo-retour-b{font-size:14.4px;line-height:1.6;color:#22364f}
.sagace-chat-message.assistant .sgd-exo-retour-b p{
  margin:0 0 7px!important;font-size:14.4px!important;line-height:1.6!important;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif!important;color:#22364f!important;
}
.sagace-chat-message.assistant .sgd-exo-retour-b p:last-child{margin-bottom:0!important}
.sgd-exo-retour-f{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.sgd-exo-again,.sgd-exo-next{
  min-height:36px;padding:0 15px;border-radius:999px;cursor:pointer;
  font-family:inherit;font-size:12.4px;font-weight:700;transition:.15s;
}
.sagace-chat-row .sgd-exo-next,.sagace-chat-row .sgd-exo-next:hover{
  border:0!important;background:#1f7358!important;color:#fff!important;text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-next:hover{background:#175a45!important}
.sagace-chat-row .sgd-exo-again,.sagace-chat-row .sgd-exo-again:hover{
  border:1px solid #c3e2d4!important;background:#fff!important;color:#1f7358!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-again:hover{background:#f2fbf7!important}
@media (max-width:600px){.sgd-exo-again,.sgd-exo-next{flex:1}}
@media print{.sgd-exo-retour{display:none!important}}

/* ══════════════════════════════════════════════════════════════
   Verrouillage réel : on voit qu'il y a un exercice, on ne le lit pas
   ══════════════════════════════════════════════════════════════ */
.sgd-exo{position:relative}
.sgd-exo-veil{display:none}
.sgd-exo[data-state="locked"]{border-style:solid;border-color:#e3eaf2;background:#fbfcfe}
.sgd-exo[data-state="locked"] .sgd-exo-body{
  filter:blur(5px);opacity:.55;user-select:none;pointer-events:none;
}
.sgd-exo[data-state="locked"] .sgd-exo-answer{display:none}
.sgd-exo[data-state="locked"] .sgd-exo-head{opacity:.68}
.sgd-exo[data-state="locked"] .sgd-exo-state{background:#f0f3f7;color:#8ba0b7}
.sgd-exo[data-state="locked"] .sgd-exo-veil{
  display:flex;align-items:center;justify-content:center;gap:9px;
  position:absolute;left:0;right:0;top:52px;bottom:0;z-index:2;
  border-radius:0 0 14px 14px;
  background:linear-gradient(180deg,rgba(251,252,254,.55),rgba(251,252,254,.9));
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:12.2px;font-weight:650;color:#7c8ea3;text-align:center;padding:0 16px;
}
.sgd-exo-lock{
  flex:0 0 22px;width:22px;height:22px;position:relative;
}
.sgd-exo-lock:before{
  content:"";position:absolute;left:6px;top:2px;width:10px;height:8px;
  border:2px solid #9fb3c8;border-bottom:0;border-radius:5px 5px 0 0;
}
.sgd-exo-lock:after{
  content:"";position:absolute;left:3px;top:9px;width:16px;height:11px;
  border-radius:3px;background:#9fb3c8;
}

/* « Tout afficher » lève le flou sans ouvrir les champs */
.sgd-exos.is-revealed .sgd-exo[data-state="locked"] .sgd-exo-body{filter:none;opacity:1}
.sgd-exos.is-revealed .sgd-exo[data-state="locked"] .sgd-exo-veil{display:none}

/* À reprendre : l'exercice reste ouvert, on insiste sans punir */
.sgd-exo[data-state="retry"]{border-color:#f0d9ae;background:linear-gradient(160deg,#fffdf7,#fff 60%)}
.sgd-exo[data-state="retry"] .sgd-exo-n{border-color:#eddcb4;background:#fdf8ea;color:#8a6a15}
.sgd-exo[data-state="retry"] .sgd-exo-state{background:#fdf8ea;color:#8a6a15}
.sgd-exo[data-state="skipped"]{opacity:.75}
.sgd-exo[data-state="skipped"] .sgd-exo-state{background:#f0f3f7;color:#8ba0b7}

.sgd-exo-retour.is-retry{background:linear-gradient(150deg,#fdf8ea,#fff 70%);border:1.5px solid #eddcb4}
.sgd-exo-retour.is-retry .sgd-exo-retour-h{color:#8a6a15}
.sgd-exo-retour.is-retry .sgd-exo-retour-i:after{
  content:"";position:absolute;left:9px;top:4px;width:2px;height:9px;border-radius:2px;background:#8a6a15;
}
.sgd-exo-try{
  margin-left:auto;padding:3px 9px;border-radius:999px;background:rgba(255,255,255,.75);
  font-size:10.2px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;opacity:.85;
}
.sgd-exo-fin{font-size:12.6px;font-weight:700;color:#1f7358;align-self:center}
.sgd-exo-hint2,.sgd-exo-skip{
  min-height:36px;padding:0 15px;border-radius:999px;cursor:pointer;
  font-family:inherit;font-size:12.4px;font-weight:700;transition:.15s;
}
.sagace-chat-row .sgd-exo-again,.sagace-chat-row .sgd-exo-again:hover{
  border:0!important;background:#8a6a15!important;color:#fff!important;text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-again:hover{background:#6f5410!important}
.sagace-chat-row .sgd-exo-hint2,.sagace-chat-row .sgd-exo-hint2:hover{
  border:1px solid #eddcb4!important;background:#fff!important;color:#8a6a15!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-hint2:hover{background:#fffbf0!important}
.sagace-chat-row .sgd-exo-skip,.sagace-chat-row .sgd-exo-skip:hover{
  border:0!important;background:transparent!important;color:#9b8a63!important;
  text-decoration:underline!important;
}
@media print{
  .sgd-exo[data-state="locked"] .sgd-exo-body{filter:none!important;opacity:1!important}
  .sgd-exo-veil{display:none!important}
}

/* ══════════════════════════════════════════════════════════════
   Verrouillage réel : on voit qu'il y a la suite, on ne la lit pas
   ══════════════════════════════════════════════════════════════ */
.sgd-exo-lock{display:none}
.sgd-exo[data-state="locked"]{
  border-style:dashed;border-color:#dfe7f0;background:#fbfcfe;position:relative;
}
.sgd-exo[data-state="locked"] .sgd-exo-body{
  filter:blur(5px);opacity:.5;pointer-events:none;user-select:none;
  max-height:74px;overflow:hidden;
}
.sgd-exo[data-state="locked"] .sgd-exo-answer{display:none}
.sgd-exo[data-state="locked"] .sgd-exo-head{opacity:.72}
.sgd-exo[data-state="locked"] .sgd-exo-n{border-color:#e0e7ef;color:#a3b4c7;background:#f5f8fb}
.sgd-exo[data-state="locked"] .sgd-exo-state{background:#f0f3f7;color:#96a8bb}
.sgd-exo[data-state="locked"] .sgd-exo-lock{
  display:flex;align-items:center;justify-content:center;gap:9px;
  padding:11px 14px;margin:0 14px 13px;border-radius:10px;
  background:#f4f7fb;border:1px solid #e4ebf3;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:12.2px;font-weight:600;color:#8ba0b7;
}
.sgd-exo-lock-i{
  flex:0 0 15px;width:15px;height:15px;position:relative;
}
.sgd-exo-lock-i:before{
  content:"";position:absolute;left:3.5px;top:0;width:8px;height:6px;
  border:2px solid #a3b4c7;border-bottom:0;border-radius:4px 4px 0 0;
}
.sgd-exo-lock-i:after{
  content:"";position:absolute;left:1px;top:5.5px;width:13px;height:9px;
  border-radius:2.5px;background:#a3b4c7;
}

/* À reprendre : l'exercice reste ouvert, on n'avance pas */
.sgd-exo[data-state="retry"]{border-color:#f0d9ae;background:#fffdf8}
.sgd-exo[data-state="retry"] .sgd-exo-n{border-color:#eee0b0;background:#fdf8ea;color:#8a6a15}
.sgd-exo[data-state="retry"] .sgd-exo-state{background:#fdf8ea;color:#8a6a15}
.sgd-exo[data-state="done"] .sgd-exo-answer{opacity:.6}

.sgd-exo-retour.is-retry{background:linear-gradient(150deg,#fdf8ea,#fff 70%);border:1.5px solid #eee0b0}
.sgd-exo-retour.is-retry .sgd-exo-retour-h{color:#8a6a15}
.sgd-exo-retour.is-retry .sgd-exo-retour-i:after{
  content:"";position:absolute;left:9px;top:4px;width:2px;height:9px;border-radius:2px;background:#8a6a15;
}
.sgd-exo-retour.is-method{background:linear-gradient(150deg,#eeecf8,#fff 70%);border:1.5px solid #d5d1ee}
.sgd-exo-retour.is-method .sgd-exo-retour-h{color:#574b9b}
.sgd-exo-retour.is-method .sgd-exo-retour-i:after{
  content:"";position:absolute;left:5px;top:6px;width:9px;height:2px;border-radius:2px;
  background:#574b9b;box-shadow:0 4px 0 #574b9b;
}
.sgd-exo-try{
  margin-left:auto;padding:3px 9px;border-radius:999px;background:rgba(0,0,0,.05);
  font-size:10.4px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;opacity:.8;
}
.sgd-exo-fin{
  display:inline-flex;align-items:center;font-size:12.6px;font-weight:700;color:#1f7358;
}
.sagace-chat-row .sgd-exo-hint2,.sagace-chat-row .sgd-exo-skip{
  min-height:36px;padding:0 15px;border-radius:999px;cursor:pointer;
  font-family:inherit;font-size:12.4px;font-weight:700;
  border:1px solid #eee0b0!important;background:#fff!important;color:#8a6a15!important;
  text-decoration:none!important;
}
.sagace-chat-row .sgd-exo-hint2:hover,.sagace-chat-row .sgd-exo-skip:hover{background:#fdf8ea!important}
.sagace-chat-row .sgd-exo-skip{border-style:dashed!important;color:#8ba0b7!important;border-color:#dde7f0!important}
.sagace-chat-row .sgd-exo-skip:hover{color:#5d7085!important;background:#f7fafd!important}
@media print{
  .sgd-exo[data-state="locked"] .sgd-exo-body{filter:none;opacity:1;max-height:none}
  .sgd-exo-lock{display:none!important}
}
