:root{
  --editorial-brand:#490154;
  --editorial-brand-deep:#31013a;
  --editorial-brand-soft:#f5eef7;
  --editorial-red:#ef001f;
  --editorial-line:#e4dce7;
  --editorial-muted:#6f6874;
  --editorial-shadow:0 10px 28px rgba(49,1,58,.07);
}

/* Les six outils partagent une structure, mais aucun sélecteur ne déborde
   sur les autres espaces métier de RÉDAC 2000. */
.editorial-tool-workspace{
  width:100%;
  max-width:1450px!important;
  margin:0 auto;
  color:#171022;
}
.editorial-tool-workspace .workspace-header{
  display:block!important;
  margin-bottom:22px!important;
}
.editorial-tool-workspace .workspace-label{
  color:var(--editorial-red)!important;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
}
.editorial-tool-workspace .workspace-header h1{
  margin:6px 0 4px;
  color:var(--editorial-brand)!important;
  font-size:clamp(38px,3.4vw,52px)!important;
  line-height:1.06;
  letter-spacing:-.04em;
}
.editorial-tool-workspace .workspace-header p{
  margin:0;
  color:#665b6c;
  font-size:15px;
}
.editorial-tool-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);
  gap:24px;
  align-items:stretch;
}
.editorial-tool-panel{
  min-width:0;
  min-height:560px;
  margin:0!important;
  padding:26px!important;
  border:1px solid var(--editorial-line)!important;
  border-radius:15px!important;
  background:#fff!important;
  box-shadow:var(--editorial-shadow)!important;
}
.editorial-tool-result:not([style*="display:none"]):not([style*="display: none"]){
  display:flex!important;
  flex-direction:column;
}
/* Sur ordinateur, la seconde colonne reste matérialisée avant le premier
   traitement. L'application continue de piloter son véritable état par
   l'attribut style ; sur mobile, son masquage historique reste inchangé. */
@media(min-width:851px){
  .editorial-tool-result[style*="display:none"],
  .editorial-tool-result[style*="display: none"]{
    display:flex!important;
    flex-direction:column;
  }
  .editorial-tool-result[style*="display:none"] .editorial-tool-actions,
  .editorial-tool-result[style*="display: none"] .editorial-tool-actions,
  .editorial-tool-result[style*="display:none"] .editorial-tool-copy,
  .editorial-tool-result[style*="display: none"] .editorial-tool-copy{
    visibility:hidden;
  }
}
.editorial-tool-panel h2{
  margin:0 0 20px;
  color:#261431!important;
  font-size:19px;
  line-height:1.25;
}
.editorial-tool-panel label,.editorial-tool-field-label{
  color:#261431;
  font-size:12px;
  font-weight:800;
}
.editorial-tool-textarea{
  display:block;
  width:100%;
  min-height:350px!important;
  margin:0;
  padding:18px!important;
  resize:vertical;
  color:#21162a;
  background:#fff!important;
  border:1px solid var(--editorial-line)!important;
  border-radius:9px!important;
  box-shadow:none!important;
  font:inherit;
  font-size:14px!important;
  line-height:1.65;
}
.editorial-tool-textarea:focus,
.editorial-tool-panel input:focus,
.editorial-tool-panel select:focus{
  outline:3px solid rgba(73,1,84,.13);
  outline-offset:1px;
  border-color:var(--editorial-brand)!important;
}
.editorial-tool-textarea-small{min-height:145px!important;margin-bottom:16px}
.editorial-tool-panel input[type="text"],
.editorial-tool-panel select{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  color:#27182f;
  background:#fff;
  border:1px solid var(--editorial-line);
  border-radius:7px;
  font:inherit;
  font-size:13px;
}
.editorial-tool-field-label{
  display:block;
  margin:18px 0 8px;
}

.editorial-tool-note{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin:18px 0;
  padding:14px!important;
  color:#5b3766;
  background:#fbf7fc!important;
  border:1px solid #eadfed!important;
  border-radius:9px!important;
}
.editorial-tool-note p{margin:0;font-size:12px;line-height:1.5}
.editorial-tool-note strong{display:block;margin:0 0 3px;color:var(--editorial-brand);font-size:13px}
.editorial-tool-note-icon{
  position:relative;
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:50%;
  background:#efe3f3;
}
.editorial-tool-note-icon::before{
  content:"";
  position:absolute;
  inset:8px 9px;
  border:2px solid var(--editorial-brand);
  border-radius:8px 8px 10px 10px;
}
.editorial-tool-note-icon::after{
  content:"";
  position:absolute;
  left:15px;
  top:13px;
  width:5px;
  height:8px;
  border-right:2px solid var(--editorial-brand);
  border-bottom:2px solid var(--editorial-brand);
  transform:rotate(45deg);
}
.editorial-tool-run{
  width:100%;
  min-height:50px;
  margin:0!important;
  color:#fff!important;
  background:var(--editorial-red)!important;
  border:1px solid var(--editorial-red)!important;
  border-radius:8px!important;
  box-shadow:0 9px 20px rgba(239,0,31,.14)!important;
  font-size:15px;
  font-weight:800;
}
.editorial-tool-run:hover{background:#d9001c!important;border-color:#d9001c!important}
.editorial-tool-copy{
  width:100%;
  min-height:48px;
  margin:auto 0 0!important;
  color:#fff!important;
  background:var(--editorial-brand)!important;
  border:1px solid var(--editorial-brand)!important;
  border-radius:8px!important;
  box-shadow:none!important;
}
.editorial-tool-actions{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);
  gap:12px;
  margin-top:auto!important;
  padding-top:18px;
}
.editorial-tool-actions button{width:100%;min-height:48px;margin:0!important}
.editorial-tool-actions .secondary{
  color:#fff!important;
  background:var(--editorial-brand)!important;
  border:1px solid var(--editorial-brand)!important;
  box-shadow:none!important;
}
.editorial-tool-copy:hover:not(:disabled),
.editorial-tool-actions .secondary:hover:not(:disabled){
  color:#fff!important;
  background:var(--editorial-brand-deep)!important;
  border-color:var(--editorial-brand-deep)!important;
}

/* Choix visuels synchronisés avec les vrais select lus par app.js. */
.editorial-tool-native-select{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
}
.editorial-tool-choice-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.editorial-tool-choice-row-two{grid-template-columns:repeat(2,minmax(0,1fr))}
.editorial-tool-choice-row button{
  min-height:44px;
  margin:0!important;
  color:var(--editorial-brand)!important;
  background:#fff!important;
  border:1px solid var(--editorial-line)!important;
  border-radius:8px!important;
  box-shadow:none!important;
  font-size:13px;
  font-weight:700;
}
.editorial-tool-choice-row button[aria-pressed="true"]{
  color:#fff!important;
  background:var(--editorial-brand)!important;
  border-color:var(--editorial-brand)!important;
}

/* Dépôt de fichiers : l'input métier reste présent et reçoit le fichier. */
.editorial-tool-file-input{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
}
.editorial-tool-upload{
  display:flex!important;
  min-height:220px;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:7px;
  padding:22px;
  color:var(--editorial-brand)!important;
  background:#fff;
  border:1px dashed #cdbfd1;
  border-radius:9px;
  cursor:pointer;
  text-align:center;
}
.editorial-tool-upload:hover{background:#fcf9fd;border-color:var(--editorial-brand)}
.editorial-tool-upload strong{font-size:15px}
.editorial-tool-upload > span:not(.editorial-tool-upload-button):not(.editorial-tool-file-icon):not(.editorial-tool-cloud-icon){
  color:var(--editorial-muted);
  font-size:12px;
  font-weight:500;
}
.editorial-tool-upload-button{
  display:inline-flex;
  min-height:42px;
  align-items:center;
  justify-content:center;
  margin-top:9px;
  padding:9px 20px;
  color:var(--editorial-brand);
  background:#fff;
  border:1px solid var(--editorial-brand);
  border-radius:7px;
  font-size:13px;
  font-weight:800;
}
.editorial-tool-cloud-icon{
  position:relative;
  width:46px;
  height:34px;
  border:3px solid var(--editorial-brand);
  border-top-color:transparent;
  border-radius:18px 18px 12px 12px;
}
.editorial-tool-cloud-icon::before{
  content:"";
  position:absolute;
  left:9px;
  top:-10px;
  width:22px;
  height:22px;
  background:#fff;
  border:3px solid var(--editorial-brand);
  border-bottom:0;
  border-radius:50% 50% 0 0;
}
.editorial-tool-cloud-icon::after{
  content:"";
  position:absolute;
  left:13px;
  top:3px;
  z-index:1;
  width:15px;
  height:20px;
  background:var(--editorial-brand);
  clip-path:polygon(42% 30%,20% 52%,0 52%,50% 0,100% 52%,80% 52%,58% 30%,58% 100%,42% 100%);
}
.editorial-tool-file-icon{
  display:flex;
  width:66px;
  height:78px;
  align-items:flex-end;
  justify-content:center;
  padding-bottom:12px;
  color:#fff!important;
  background:var(--editorial-red);
  border-radius:7px 7px 10px 10px;
  font-size:17px!important;
  font-weight:900!important;
  clip-path:polygon(0 0,73% 0,100% 22%,100% 100%,0 100%);
}
.editorial-tool-pdf-upload{min-height:320px}
.editorial-tool-upload-compact{min-height:185px}
.editorial-tool-file-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editorial-tool-help{
  margin:18px 0;
  color:var(--editorial-muted);
  font-size:12px;
  line-height:1.55;
  text-align:center;
}
.editorial-tool-speakers{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px!important;
  margin:18px 0 0;
}
.editorial-tool-speakers label{display:grid;gap:7px}
.editorial-tool-info{
  margin:14px 0!important;
  padding:10px 12px!important;
  color:#65586a;
  background:#faf8fb!important;
  border:1px solid var(--editorial-line)!important;
  border-radius:7px!important;
  font-size:12px;
}

#pdfTextWorkspace .editorial-tool-textarea,
#interviewWorkspace .editorial-tool-textarea{min-height:480px!important}
#correctorWorkspace .editorial-tool-textarea,
#summarizerWorkspace .editorial-tool-textarea,
#formatterWorkspace .editorial-tool-textarea{min-height:390px!important}
#translationWorkspace .editorial-tool-textarea{min-height:230px!important}

@media(max-width:1000px){
  .editorial-tool-grid{gap:16px}
  .editorial-tool-panel{padding:20px!important}
  .editorial-tool-speakers{grid-template-columns:1fr}
}

@media(max-width:850px){
  .editorial-tool-workspace{padding:24px 16px 104px!important}
  .editorial-tool-workspace .workspace-header h1{font-size:38px!important}
  .editorial-tool-grid{grid-template-columns:1fr}
  .editorial-tool-panel{min-height:0;padding:20px!important}
  .editorial-tool-textarea,
  #pdfTextWorkspace .editorial-tool-textarea,
  #interviewWorkspace .editorial-tool-textarea,
  #correctorWorkspace .editorial-tool-textarea,
  #summarizerWorkspace .editorial-tool-textarea,
  #formatterWorkspace .editorial-tool-textarea{
    min-height:300px!important;
  }
  #translationWorkspace .editorial-tool-textarea{min-height:220px!important}
  .editorial-tool-pdf-upload{min-height:230px}
}

@media(max-width:460px){
  .editorial-tool-workspace{padding-right:12px!important;padding-left:12px!important}
  .editorial-tool-panel{padding:17px!important;border-radius:12px!important}
  .editorial-tool-choice-row{gap:7px}
  .editorial-tool-choice-row button{padding:8px 5px;font-size:12px}
  .editorial-tool-actions{grid-template-columns:1fr}
  .editorial-tool-upload{min-height:190px;padding:18px 12px}
  .editorial-tool-textarea{font-size:13px!important}
}
