/* Sprint 7 — Advanced automations, macros and intelligent routing */
.automation-kpis{grid-template-columns:repeat(5,minmax(0,1fr))}
.automation-main-grid,.automation-insights-grid{align-items:start}
.automation-rules-panel,.macro-panel{min-width:0}
.automation-rule-list,.macro-list{display:grid;gap:9px}
.automation-rule-card,.macro-card{
  display:grid;
  gap:10px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
}
.automation-rule-card.inactive,.macro-card.inactive{opacity:.68}
.automation-rule-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.automation-rule-card-head>div{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  min-width:0;
}
.automation-rule-card-head b,.macro-card b{font-size:.78rem}
.automation-rule-flow{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}
.automation-rule-flow span{
  padding:6px 9px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel-soft,rgba(45,210,121,.035));
  font-size:.64rem;
  font-weight:800;
}
.automation-rule-flow strong{color:var(--green);font-size:.72rem}
.automation-rule-card p,.macro-card p{
  margin:0;
  color:var(--muted);
  font-size:.67rem;
  line-height:1.48;
}
.automation-rule-card small,.macro-card small{
  color:var(--muted);
  font-size:.6rem;
}
.macro-card{
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
}
.macro-card-main{display:grid;gap:6px;min-width:0}
.macro-card-badges{display:flex;flex-wrap:wrap;gap:6px}
.automation-ranking{display:grid;gap:8px}
.automation-ranking article{
  display:grid;
  grid-template-columns:30px minmax(0,1fr);
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
}
.automation-ranking article>span{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:9px;
  background:var(--panel-soft,rgba(45,210,121,.055));
  font-weight:900;
  font-size:.68rem;
}
.automation-ranking article>div{display:grid;gap:3px;min-width:0}
.automation-ranking b{font-size:.7rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.automation-ranking small{font-size:.6rem;color:var(--muted)}
.automation-how{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}
.automation-how h3{margin:3px 0 6px}
.automation-how p{margin:0;max-width:760px}
.automation-flow-pills{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  justify-content:flex-end;
}
.automation-flow-pills span{
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:.62rem;
  font-weight:900;
}
.automation-flow-pills b{color:var(--green)}
.automation-toggle-row{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin:6px 0 12px;
}
.automation-form-title{
  margin:15px 0 8px;
  padding-top:12px;
  border-top:1px solid var(--line);
  font-size:.74rem;
}
.automation-condition-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
[data-s7-action-field][hidden]{display:none!important}
.macro-active-toggle{align-self:end;min-height:44px}
.macro-body-input{min-height:260px;line-height:1.55}
.macro-picker-dialog{width:min(760px,94vw)}
.macro-picker-list{
  display:grid;
  gap:8px;
  max-height:55vh;
  overflow:auto;
  margin-top:10px;
}
.macro-picker-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  width:100%;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  color:inherit;
  text-align:left;
  cursor:pointer;
}
.macro-picker-item:hover{
  border-color:var(--green);
  background:var(--panel-soft,rgba(45,210,121,.04));
}
.macro-picker-item>div{display:grid;gap:4px;min-width:0}
.macro-picker-item b{font-size:.74rem}
.macro-picker-item span{font-size:.66rem;line-height:1.45;color:var(--muted)}
.macro-picker-item small{font-size:.59rem;color:var(--muted)}
.macro-picker-item strong{font-size:.66rem;color:var(--green)}
.service-composer-tools{
  display:flex;
  align-items:center;
  gap:7px;
  margin-right:auto;
  flex-wrap:wrap;
}
.service-composer-tools .service-composer-knowledge{margin-right:0}
@media(max-width:1250px){
  .automation-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .automation-condition-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .automation-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .automation-condition-grid{grid-template-columns:1fr}
  .macro-card{grid-template-columns:1fr}
  .automation-how{display:grid}
  .automation-flow-pills{justify-content:flex-start}
  .macro-picker-item{grid-template-columns:1fr}
}
