.idunnTopBtn{
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
  min-height:34px;
  padding:7px 9px;
  border:1px solid #4a2528;
  border-radius:7px;
  background:#120c0d;
  color:#c7cdd0;
  font:750 11px/1 Inter,system-ui,sans-serif;
  white-space:nowrap;
  cursor:pointer;
}
.idunnTopBtn i{
  color:#cf2b32;
  font-style:normal;
  font-size:12px;
}
.idunnTopBtn:hover,
.idunnTopBtn:focus-visible{
  border-color:#8e3035;
  color:#fff;
  outline:none;
}
.idunnTopBtn.active{
  border-color:#9d2f34;
  background:#1a0e10;
  color:#fff;
}
@media(max-width:980px){
  .idunnTopBtn span{display:none}
  .idunnTopBtn{padding:7px 8px}
}
.idunn-page{
  width:min(100%,980px);
  margin:0 auto;
  padding:34px 28px 60px;
}
.idunn-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:20px;
}
.idunn-head h2{
  margin:4px 0 8px;
  font:700 clamp(34px,5vw,54px)/1 Georgia,"Times New Roman",serif;
  letter-spacing:-.03em;
}
.idunn-head p{
  margin:0;
  max-width:620px;
  color:#8f999d;
  font-size:14px;
  line-height:1.55;
}
.idunn-review-btn{
  flex:0 0 auto;
  min-height:43px;
  padding:10px 16px;
  border:1px solid #7e2429;
  border-radius:8px;
  background:#1c0d0f;
  color:#f0b1b4;
  font-weight:900;
  cursor:pointer;
}
.idunn-review-btn:hover,
.idunn-review-btn:focus-visible{
  border-color:#d02830;
  color:#fff;
  outline:none;
}
.idunn-card{
  overflow:hidden;
  border:1px solid #293034;
  border-radius:13px;
  background:#0b0e10;
  box-shadow:0 20px 55px rgba(0,0,0,.2);
}
.idunn-messages{
  height:min(60vh,620px);
  min-height:360px;
  overflow-y:auto;
  padding:24px;
  scroll-behavior:smooth;
}
.idunn-empty{
  display:grid;
  min-height:290px;
  place-content:center;
  gap:7px;
  text-align:center;
  color:#717b80;
}
.idunn-empty strong{
  color:#c6ccce;
  font:700 24px/1.2 Georgia,"Times New Roman",serif;
}
.idunn-message{
  display:flex;
  margin:0 0 16px;
}
.idunn-message.user{justify-content:flex-end}
.idunn-bubble{
  width:fit-content;
  max-width:min(78%,680px);
  padding:12px 14px;
  border:1px solid #293035;
  border-radius:11px;
  background:#111619;
  color:#d6dbdd;
  font-size:14px;
  line-height:1.55;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.idunn-message.user .idunn-bubble{
  border-color:#642327;
  background:#261013;
  color:#f0dddd;
}
.idunn-message.assistant .idunn-bubble::before{
  content:"IDUNN";
  display:block;
  margin-bottom:7px;
  color:#ba252b;
  font-size:9px;
  font-weight:950;
  letter-spacing:.16em;
}
.idunn-composer{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  padding:14px;
  border-top:1px solid #242a2d;
  background:#090c0e;
}
.idunn-composer textarea{
  width:100%;
  max-height:160px;
  resize:vertical;
  padding:12px 13px;
  border:1px solid #30383c;
  border-radius:8px;
  background:#101416;
  color:#f0f2f2;
  font:500 14px/1.45 Inter,system-ui,sans-serif;
}
.idunn-composer textarea:focus{
  border-color:#9c252b;
  outline:none;
  box-shadow:0 0 0 2px rgba(179,21,24,.1);
}
.idunn-composer button{
  min-width:96px;
  border:1px solid #a1242a;
  border-radius:8px;
  background:linear-gradient(180deg,#c02228,#8e1116);
  color:#fff;
  font-weight:950;
  cursor:pointer;
}
.idunn-composer button:disabled,
.idunn-review-btn:disabled{opacity:.45;cursor:default}
.idunn-footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:0 14px 13px;
  color:#697378;
  font-size:10px;
}
.idunn-footer .idunn-status-error{color:#d7656b}
.idunn-footer button{
  padding:0;
  border:0;
  background:transparent;
  color:#818b8f;
  font:inherit;
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
}
.idunn-typing .idunn-bubble{
  color:#7e898d;
  font-style:italic;
}
@media(max-width:720px){
  .idunn-page{padding:22px 12px 38px}
  .idunn-head{align-items:stretch;flex-direction:column}
  .idunn-review-btn{width:100%}
  .idunn-messages{height:58vh;min-height:320px;padding:16px 12px}
  .idunn-bubble{max-width:90%}
  .idunn-composer{grid-template-columns:1fr}
  .idunn-composer button{min-height:42px}
}


/* IDUNN V2 — outils actionnables */
.idunn-head-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.idunn-tool-btn{
  flex:0 0 auto;
  min-height:43px;
  padding:10px 16px;
  border:1px solid #374044;
  border-radius:8px;
  background:#101517;
  color:#cbd1d3;
  font-weight:900;
  cursor:pointer;
}
.idunn-tool-btn:hover,
.idunn-tool-btn:focus-visible,
.idunn-tool-btn.active{
  border-color:#7d2a2f;
  background:#1a0f11;
  color:#fff;
  outline:none;
}
.idunn-finder{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:10px;
  align-items:end;
  margin:0 0 14px;
  padding:13px;
  border:1px solid #293034;
  border-radius:10px;
  background:#0d1113;
}
.idunn-finder[hidden]{display:none!important}
.idunn-finder label{
  display:grid;
  gap:5px;
}
.idunn-finder label>span{
  color:#778287;
  font-size:9px;
  font-weight:950;
  letter-spacing:.13em;
}
.idunn-finder select{
  width:100%;
  min-height:42px;
  border:1px solid #343d41;
  border-radius:7px;
  background:#101517;
  color:#eff2f3;
  padding:9px 34px 9px 11px;
  font:750 12px/1 Inter,system-ui,sans-serif;
}
.idunn-finder select:focus{
  border-color:#8e2b31;
  outline:none;
}
.idunn-finder>button{
  min-height:42px;
  padding:9px 15px;
  border:1px solid #a1242a;
  border-radius:8px;
  background:linear-gradient(180deg,#c02228,#8e1116);
  color:#fff;
  font-weight:950;
  cursor:pointer;
}
.idunn-finder>button:disabled{opacity:.45;cursor:default}

.idunn-message.has-action{
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
}
.idunn-message.has-action .idunn-bubble{
  margin-bottom:0;
}
.idunn-plan-card{
  width:min(86%,720px);
  overflow:hidden;
  border:1px solid #343d41;
  border-radius:11px;
  background:#0d1214;
}
.idunn-plan-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:13px 14px;
  border-bottom:1px solid #252d30;
  background:linear-gradient(180deg,rgba(183,29,35,.08),transparent);
}
.idunn-plan-head strong{
  display:block;
  color:#edf0f1;
  font:700 18px/1.15 Georgia,"Times New Roman",serif;
}
.idunn-plan-head span{
  display:block;
  margin-top:4px;
  color:#7f898d;
  font-size:10px;
}
.idunn-plan-count{
  flex:0 0 auto;
  padding:5px 8px;
  border:1px solid #3a4245;
  border-radius:999px;
  color:#a7b0b3!important;
  font-size:9px!important;
  font-weight:900;
}
.idunn-plan-list{
  display:grid;
}
.idunn-plan-exercise{
  display:grid;
  grid-template-columns:28px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:10px 13px;
  border-bottom:1px solid #20272a;
}
.idunn-plan-exercise:last-child{border-bottom:0}
.idunn-plan-index{
  display:grid;
  width:26px;
  height:26px;
  place-items:center;
  border:1px solid #363f43;
  border-radius:7px;
  color:#7f898c;
  font-size:9px;
  font-weight:950;
}
.idunn-plan-exercise strong{
  display:block;
  color:#dce1e2;
  font-size:12px;
}
.idunn-plan-exercise small{
  display:block;
  margin-top:3px;
  color:#758085;
  font-size:9px;
  line-height:1.35;
}
.idunn-plan-prescription{
  color:#d4d9da;
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
}
.idunn-plan-add{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:12px 13px;
  border-top:1px solid #293034;
  background:#090d0f;
}
.idunn-plan-add select{
  min-width:0;
  min-height:40px;
  border:1px solid #333c40;
  border-radius:7px;
  background:#101517;
  color:#e8ebec;
  padding:8px 10px;
}
.idunn-plan-add button{
  min-height:40px;
  padding:8px 13px;
  border:1px solid #922a30;
  border-radius:7px;
  background:#201013;
  color:#f0c7c9;
  font-weight:900;
  cursor:pointer;
}
.idunn-plan-add button:hover,
.idunn-plan-add button:focus-visible{
  border-color:#cf3037;
  color:#fff;
  outline:none;
}
.idunn-plan-add button:disabled{opacity:.4;cursor:default}
.idunn-plan-status{
  grid-column:1/-1;
  min-height:14px;
  color:#7f8a8e;
  font-size:9px;
}
.idunn-plan-status.success{color:#76bd8c}
.idunn-plan-status.error{color:#d6656b}

@media(max-width:720px){
  .idunn-head-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .idunn-tool-btn,.idunn-review-btn{width:100%}
  .idunn-finder{grid-template-columns:1fr}
  .idunn-plan-card{width:96%}
  .idunn-plan-add{grid-template-columns:1fr}
  .idunn-plan-add button{min-height:44px}
}
