/* [KAI-REPARATEUR-1006] Bloc « Kai répare » de l'onglet Incidents — jetons de la page (P9). */
#reparations-root { margin-bottom: 18px; }
#reparations-root .rp-intro { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
#reparations-root .rp-carte { border: 1px solid var(--line-2, rgba(11,18,32,.13)); border-left: 4px solid var(--line-2, #ccd); border-radius: 16px;
  background: rgba(255,255,255,.72); padding: 14px 16px 12px; margin: 0 0 12px; }
#reparations-root .rp-carte.rp-warn { border-left-color: var(--warn); }
#reparations-root .rp-carte.rp-crit { border-left-color: var(--crit); }
#reparations-root .rp-carte.rp-ok { border-left-color: var(--ok); }
#reparations-root .rp-carte.rp-info { border-left-color: var(--info); }
#reparations-root .rp-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
#reparations-root .rp-depuis { margin-left: auto; color: var(--muted); font-size: 12.5px; }
#reparations-root .rp-titre { margin: 2px 0 8px; font-weight: 650; font-size: 15.5px; color: var(--ink); line-height: 1.4; }
#reparations-root .rp-bloc { margin: 8px 0; }
#reparations-root .rp-sous { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ag-txt, var(--muted)); margin-bottom: 3px; }
#reparations-root .rp-bloc p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
#reparations-root .rp-afaire { background: var(--warn-lt); color: var(--warn-txt) !important; padding: 8px 10px; border-radius: 10px; }
#reparations-root .rp-faits { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 4px; font-size: 13px; color: var(--ink-2); }
#reparations-root .rp-faits b { color: var(--muted); font-weight: 600; margin-right: 4px; }
#reparations-root .rp-discret { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
#reparations-root .rp-alerte { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--crit-lt); color: var(--crit-txt); font-size: 13px; }
#reparations-root .rp-resultat { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
#reparations-root .rp-resultat.rp-ok { background: var(--ok-lt); color: var(--ok-txt); }
#reparations-root .rp-resultat.rp-crit { background: var(--crit-lt); color: var(--crit-txt); }
#reparations-root .rp-details { margin-top: 10px; border-top: 1px dashed var(--line-2, #dde); padding-top: 8px; }
#reparations-root .rp-details summary { cursor: pointer; color: var(--ag-txt, var(--info-txt)); font-size: 13px; font-weight: 600; list-style: none; }
#reparations-root .rp-details summary::-webkit-details-marker { display: none; }
#reparations-root .rp-details summary::before { content: "▸ "; }
#reparations-root .rp-details[open] summary::before { content: "▾ "; }
#reparations-root .rp-details ol, #reparations-root .rp-details ul { margin: 4px 0 0 18px; padding: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
#reparations-root .rp-histo { list-style: none; margin-left: 0 !important; }
#reparations-root .rp-histo span { color: var(--muted); font-size: 12px; margin-right: 6px; }
#reparations-root .rp-script { margin: 6px 0; }
#reparations-root .rp-script-nom { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
#reparations-root .rp-script pre { margin: 0; max-height: 260px; overflow: auto; background: #0B1220; color: #D7E3F4; border-radius: 10px;
  padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
#reparations-root .mono { font-family: var(--mono); font-size: 12.5px; }
#reparations-root .rp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#reparations-root .rp-pulse { animation: rp-pulse 1.6s ease-in-out infinite; }
@keyframes rp-pulse { 50% { opacity: .55; } }
@media (max-width: 640px) {
  #reparations-root .rp-carte { padding: 12px; }
  #reparations-root .rp-depuis { margin-left: 0; width: 100%; }
  #reparations-root .rp-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { #reparations-root .rp-pulse { animation: none; } }

/* [KAI-REPONSE-1006] Répondre à Kai : zone de saisie et fil de la conversation */
.rp-repondre { margin-top: 10px; }
.rp-zone { margin-top: 12px; }
.rp-zone textarea { display: block; width: 100%; min-height: 88px; resize: vertical; font: 16px/1.45 var(--sans, system-ui); color: var(--ink, #0B1220);
  background: #fff; border: 1px solid var(--line-2, rgba(11,18,32,.13)); border-radius: 14px; padding: 10px 12px; outline: none; box-sizing: border-box; }
.rp-zone textarea:focus { border-color: var(--ag, #0891B2); box-shadow: 0 0 0 3px rgba(8,145,178,.18); }
.rp-zone-pied { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rp-compteur { flex: 1; min-width: 0; font-size: 12px; color: var(--muted, #586176); }
.rp-fil { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.rp-carte .rp-msg { margin: 0; max-width: 92%; padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.rp-carte .rp-msg.vous { align-self: flex-end; background: linear-gradient(135deg, #0891B2, #0E7490); color: #fff; border-bottom-right-radius: 6px; }
.rp-carte .rp-msg.kai { align-self: flex-start; background: rgba(8,145,178,.09); color: var(--ink, #0B1220); border-bottom-left-radius: 6px; }
.rp-carte .rp-msg.erreur { background: var(--crit-lt, #FEE2E2); color: var(--crit-txt, #B91C1C); }
.rp-carte .rp-msg.attente { color: var(--ag-dp, #0E7490); display: inline-flex; align-items: center; gap: 8px; white-space: normal; }
.rp-point { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; animation: rp-pouls 1.4s ease-in-out infinite; }
@keyframes rp-pouls { 50% { opacity: .3; } }

/* ── [KAI-INCIDENTS-0211] cartes plus lisibles : icône d'état, deux blocs « ce qui se passe / ce que Kai propose », fraîcheur ── */
#reparations-root .rp-carte { border-radius: 20px; padding: 18px 20px 16px; background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  box-shadow: 0 18px 40px -30px rgba(20,50,140,.55); animation: rp-entree .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rp-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#reparations-root .rp-icone { width: 34px; height: 34px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 1.05rem; background: rgba(11,18,32,.05); }
#reparations-root .rp-warn .rp-icone { background: var(--warn-lt); } #reparations-root .rp-crit .rp-icone { background: var(--crit-lt); }
#reparations-root .rp-ok .rp-icone { background: var(--ok-lt); } #reparations-root .rp-info .rp-icone { background: var(--info-lt); }
#reparations-root .rp-titre { font-size: 1.12rem; letter-spacing: -.015em; line-height: 1.35; margin: 6px 0 8px; }
#reparations-root .rp-fraicheur { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
#reparations-root .rp-frais { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(11,18,32,.05); color: var(--ink-2); }
#reparations-root .rp-frais.vieux { background: var(--warn-lt); color: var(--warn-txt); }
#reparations-root .rp-bloc { padding: 10px 14px; border-radius: 14px; background: rgba(11,18,32,.03); border: 1px solid rgba(11,18,32,.05); }
#reparations-root .rp-bloc p { font-size: 14.5px; line-height: 1.6; }
#reparations-root .rp-afaire { background: var(--warn-lt); }
#reparations-root .rp-actions .btn { transition: transform .15s ease, box-shadow .2s; }
#reparations-root .rp-actions .btn:hover { transform: translateY(-1px); }
@media (min-width: 1100px) { #reparations-root .rp-carte > .rp-bloc { max-width: 980px; } }
@media (prefers-reduced-motion: reduce) { #reparations-root .rp-carte { animation: none; } }

/* [KAI-RETOURS-0211] même habillage pour le bloc Retours (sous-onglet Support) */
/* [KAI-REPARATEUR-1006] Bloc « Kai répare » de l'onglet Incidents — jetons de la page (P9). */
#reparations-retours { margin-bottom: 18px; }
#reparations-retours .rp-intro { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
#reparations-retours .rp-carte { border: 1px solid var(--line-2, rgba(11,18,32,.13)); border-left: 4px solid var(--line-2, #ccd); border-radius: 16px;
  background: rgba(255,255,255,.72); padding: 14px 16px 12px; margin: 0 0 12px; }
#reparations-retours .rp-carte.rp-warn { border-left-color: var(--warn); }
#reparations-retours .rp-carte.rp-crit { border-left-color: var(--crit); }
#reparations-retours .rp-carte.rp-ok { border-left-color: var(--ok); }
#reparations-retours .rp-carte.rp-info { border-left-color: var(--info); }
#reparations-retours .rp-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
#reparations-retours .rp-depuis { margin-left: auto; color: var(--muted); font-size: 12.5px; }
#reparations-retours .rp-titre { margin: 2px 0 8px; font-weight: 650; font-size: 15.5px; color: var(--ink); line-height: 1.4; }
#reparations-retours .rp-bloc { margin: 8px 0; }
#reparations-retours .rp-sous { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ag-txt, var(--muted)); margin-bottom: 3px; }
#reparations-retours .rp-bloc p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
#reparations-retours .rp-afaire { background: var(--warn-lt); color: var(--warn-txt) !important; padding: 8px 10px; border-radius: 10px; }
#reparations-retours .rp-faits { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 4px; font-size: 13px; color: var(--ink-2); }
#reparations-retours .rp-faits b { color: var(--muted); font-weight: 600; margin-right: 4px; }
#reparations-retours .rp-discret { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
#reparations-retours .rp-alerte { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--crit-lt); color: var(--crit-txt); font-size: 13px; }
#reparations-retours .rp-resultat { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
#reparations-retours .rp-resultat.rp-ok { background: var(--ok-lt); color: var(--ok-txt); }
#reparations-retours .rp-resultat.rp-crit { background: var(--crit-lt); color: var(--crit-txt); }
#reparations-retours .rp-details { margin-top: 10px; border-top: 1px dashed var(--line-2, #dde); padding-top: 8px; }
#reparations-retours .rp-details summary { cursor: pointer; color: var(--ag-txt, var(--info-txt)); font-size: 13px; font-weight: 600; list-style: none; }
#reparations-retours .rp-details summary::-webkit-details-marker { display: none; }
#reparations-retours .rp-details summary::before { content: "▸ "; }
#reparations-retours .rp-details[open] summary::before { content: "▾ "; }
#reparations-retours .rp-details ol, #reparations-retours .rp-details ul { margin: 4px 0 0 18px; padding: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
#reparations-retours .rp-histo { list-style: none; margin-left: 0 !important; }
#reparations-retours .rp-histo span { color: var(--muted); font-size: 12px; margin-right: 6px; }
#reparations-retours .rp-script { margin: 6px 0; }
#reparations-retours .rp-script-nom { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
#reparations-retours .rp-script pre { margin: 0; max-height: 260px; overflow: auto; background: #0B1220; color: #D7E3F4; border-radius: 10px;
  padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
#reparations-retours .mono { font-family: var(--mono); font-size: 12.5px; }
#reparations-retours .rp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#reparations-retours .rp-pulse { animation: rp-pulse 1.6s ease-in-out infinite; }
@keyframes rp-pulse { 50% { opacity: .55; } }
@media (max-width: 640px) {
  #reparations-retours .rp-carte { padding: 12px; }
  #reparations-retours .rp-depuis { margin-left: 0; width: 100%; }
  #reparations-retours .rp-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { #reparations-retours .rp-pulse { animation: none; } }

/* [KAI-REPONSE-1006] Répondre à Kai : zone de saisie et fil de la conversation */
.rp-repondre { margin-top: 10px; }
.rp-zone { margin-top: 12px; }
.rp-zone textarea { display: block; width: 100%; min-height: 88px; resize: vertical; font: 16px/1.45 var(--sans, system-ui); color: var(--ink, #0B1220);
  background: #fff; border: 1px solid var(--line-2, rgba(11,18,32,.13)); border-radius: 14px; padding: 10px 12px; outline: none; box-sizing: border-box; }
.rp-zone textarea:focus { border-color: var(--ag, #0891B2); box-shadow: 0 0 0 3px rgba(8,145,178,.18); }
.rp-zone-pied { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rp-compteur { flex: 1; min-width: 0; font-size: 12px; color: var(--muted, #586176); }
.rp-fil { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.rp-carte .rp-msg { margin: 0; max-width: 92%; padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.rp-carte .rp-msg.vous { align-self: flex-end; background: linear-gradient(135deg, #0891B2, #0E7490); color: #fff; border-bottom-right-radius: 6px; }
.rp-carte .rp-msg.kai { align-self: flex-start; background: rgba(8,145,178,.09); color: var(--ink, #0B1220); border-bottom-left-radius: 6px; }
.rp-carte .rp-msg.erreur { background: var(--crit-lt, #FEE2E2); color: var(--crit-txt, #B91C1C); }
.rp-carte .rp-msg.attente { color: var(--ag-dp, #0E7490); display: inline-flex; align-items: center; gap: 8px; white-space: normal; }
.rp-point { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; animation: rp-pouls 1.4s ease-in-out infinite; }
@keyframes rp-pouls { 50% { opacity: .3; } }

/* ── [KAI-INCIDENTS-0211] cartes plus lisibles : icône d'état, deux blocs « ce qui se passe / ce que Kai propose », fraîcheur ── */
#reparations-retours .rp-carte { border-radius: 20px; padding: 18px 20px 16px; background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  box-shadow: 0 18px 40px -30px rgba(20,50,140,.55); animation: rp-entree .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rp-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#reparations-retours .rp-icone { width: 34px; height: 34px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 1.05rem; background: rgba(11,18,32,.05); }
#reparations-retours .rp-warn .rp-icone { background: var(--warn-lt); } #reparations-retours .rp-crit .rp-icone { background: var(--crit-lt); }
#reparations-retours .rp-ok .rp-icone { background: var(--ok-lt); } #reparations-retours .rp-info .rp-icone { background: var(--info-lt); }
#reparations-retours .rp-titre { font-size: 1.12rem; letter-spacing: -.015em; line-height: 1.35; margin: 6px 0 8px; }
#reparations-retours .rp-fraicheur { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
#reparations-retours .rp-frais { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(11,18,32,.05); color: var(--ink-2); }
#reparations-retours .rp-frais.vieux { background: var(--warn-lt); color: var(--warn-txt); }
#reparations-retours .rp-bloc { padding: 10px 14px; border-radius: 14px; background: rgba(11,18,32,.03); border: 1px solid rgba(11,18,32,.05); }
#reparations-retours .rp-bloc p { font-size: 14.5px; line-height: 1.6; }
#reparations-retours .rp-afaire { background: var(--warn-lt); }
#reparations-retours .rp-actions .btn { transition: transform .15s ease, box-shadow .2s; }
#reparations-retours .rp-actions .btn:hover { transform: translateY(-1px); }
@media (min-width: 1100px) { #reparations-retours .rp-carte > .rp-bloc { max-width: 980px; } }
@media (prefers-reduced-motion: reduce) { #reparations-retours .rp-carte { animation: none; } }
