@media screen{
 .automation-consult-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
 .automation-consultation{display:flex;flex-direction:column;min-height:0}
 .automation-consultation>.table-wrap{max-height:calc(100dvh - 300px);overflow:auto;border-radius:0 0 12px 12px}
 .automation-consultation thead th{position:sticky;top:0;z-index:2}
 .automation-consultation td:nth-child(3){white-space:normal;min-width:220px}
 .automation-consultation .automation-actions{justify-content:flex-start;white-space:nowrap;flex-wrap:nowrap}
 #automationManagerDialog{width:min(1280px,96vw);max-width:96vw;height:min(920px,92dvh);max-height:92dvh;padding:0;border:1px solid #b7c9dd;border-radius:14px;overflow:hidden}
 #automationManagerDialog[open]{display:flex;flex-direction:column}
 #automationManagerDialog::backdrop{background:#0b203b66}
 #automationManagerDialog>.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;flex:none}
 #automationManagerDialog>.dialog-head h2{margin:0}
 #automationManagerDialog .automation-manager-body{padding:18px;overflow:auto;min-height:0;flex:1;background:#edf2f7}
 #automationManagerDialog .automation-editor textarea{max-height:45dvh;min-height:220px}
 #automationManagerDialog .automation-run-detail pre{white-space:pre-wrap}
 @media(max-width:760px){
  #automationManagerDialog{width:98vw;max-width:98vw;height:94dvh;max-height:94dvh}
  #automationManagerDialog .automation-manager-body{padding:12px}
  .automation-consultation>.table-wrap{max-height:calc(100dvh - 350px)}
 }
}

/* V3.4.441 : lancement sur la page ; éditeur et tuiles dans la gestion des scripts. */
@media screen{
 .automation-tabs.automation-main-tabs{display:flex;flex-wrap:wrap;margin:0 0 12px;gap:0}
 .automation-main-tabs>button{flex:0 1 auto;min-width:150px}
 #automationMainBody{min-width:0;outline-offset:2px}
 #automationMainBody .automation-schedules>.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
 #automationScheduleEditor[hidden]{display:none}
 #automationScheduleForm{padding:0 0 18px;margin-bottom:18px;border-bottom:1px solid var(--line)}
 #automationManagerDialog .automation-editor{margin:0}
 #automationManagerDialog .automation-editor>.panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
 #automationManagerDialog #automationScriptSave{margin-left:auto;flex:0 0 auto}
 #automationSaveStatus:empty{display:none}
 .automation-variable-help summary{cursor:pointer;color:var(--muted);font-size:12px}
 #automationMainBody .automation-pagination{padding:8px 12px}
 @media(max-width:760px){
  .automation-main-tabs>button{flex:1 1 120px;min-width:0}
  .automation-consult-actions{width:100%;flex-wrap:nowrap}
  .automation-consult-actions #automationManage{width:auto}
  .automation-consult-actions #automationRefresh{width:40px;flex:0 0 40px}
 }
}

/* La gestion conserve son éditeur et son catalogue en tuiles. */
@media screen{
 #automationManagerDialog .automation-script-library{margin-top:18px;min-width:0}
 #automationManagerDialog .automation-library-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
 #automationManagerDialog .automation-library-head h3{margin:0}
 #automationManagerDialog .automation-card{min-width:0;margin:0}
 #automationManagerDialog .automation-card>.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
 #automationManagerDialog .automation-card>.panel-head>div{min-width:0;flex:1 1 200px}
 #automationManagerDialog .automation-card h3,#automationManagerDialog .automation-card p{overflow-wrap:anywhere}
 #automationManagerDialog .automation-card pre{max-height:180px;overflow:auto;overflow-wrap:anywhere}
}

@media screen{
 .automation-target-summary{grid-column:1/-1;padding:0 0 8px}
 .automation-target-summary p{margin:0 0 8px}
 .automation-target-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
 .automation-target-count{font-size:12px;color:var(--muted)}
 .automation-agent span{min-width:0;overflow-wrap:anywhere}
 .automation-agent .automation-presence{font-weight:700}
 .automation-agent .automation-presence.online{color:#087443}
 .automation-agent .automation-presence.offline{color:#935d00}
 .automation-agent-unavailable{border-style:dashed}
 .automation-agent-unavailable .automation-presence{color:var(--muted)}
}
