/* Shared rule manager: compact summaries, visible counts and predictable actions. */
.studio-shell .studio-rule-collection{grid-column:1/-1;min-width:0;width:100%;margin:0 0 24px;color:var(--studio-text,#172033)}
.studio-shell .studio-rule-section-heading{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.studio-rule-section-heading>div:first-child{flex:1 1 240px;min-width:0}
.studio-shell .studio-rule-section-heading :is(h2,h3){display:inline;font-size:20px;font-weight:700;line-height:28px;margin:0}
.studio-rule-section-heading p,.studio-rule-help{font-size:13px;line-height:1.6;color:var(--studio-muted,#526078);margin:8px 0 0}
.studio-rule-count{display:inline-flex;align-items:center;min-height:26px;margin-left:8px;padding:2px 8px;border-radius:6px;background:var(--studio-field,#f9fafb);color:var(--studio-muted,#526078);font-size:12px;font-weight:600;white-space:nowrap}
.studio-rule-section-actions,.studio-rule-row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:none}
.studio-shell .studio-rule-collection .studio-rule-card{display:block;min-width:0;max-width:100%;padding:16px;margin:0 0 12px;border:1px solid var(--studio-border,#d1d5db);border-radius:10px;background:var(--studio-surface,#fff)}
.studio-shell .studio-rule-collection .studio-rule-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0}
.studio-rule-heading{flex:1;min-width:0}.studio-rule-heading h3{font-size:15px;font-weight:700;line-height:22px;margin:0}
.studio-rule-summary{margin:5px 0 0;color:var(--studio-muted,#526078);font-size:14px;line-height:21px;overflow-wrap:anywhere}
.studio-shell .studio-rule-collection .studio-rule-card [data-rule-toggle],.studio-shell .studio-rule-collection .studio-rule-remove{min-height:44px;padding:8px 12px;border:1px solid var(--studio-border,#d1d5db);border-radius:8px;background:var(--studio-surface,#fff);color:var(--studio-link,#2563eb);font:inherit;font-size:14px;white-space:nowrap}
.studio-shell .studio-rule-collection .studio-rule-remove{color:#dc2626}
.studio-shell .studio-rule-collection [data-add-rule]{min-height:44px;font-size:14px}
.studio-shell .studio-rule-collection .studio-rule-card [data-rule-body]{margin-top:20px}
.studio-shell .studio-rule-collection .studio-rule-card[data-collapsed=true] [data-schedule-help]{display:none}
.studio-shell .studio-rule-collection .studio-rule-card>.studio-rule-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:18px;max-width:100%;min-width:0}
.studio-shell .studio-rule-collection .studio-rule-card>.studio-keyword-fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr))}
.studio-shell .studio-rule-collection .studio-rule-card>.studio-rule-fields>div{min-width:0;max-width:100%;margin:0}
.studio-rule-fields label{display:block;font-size:14px;font-weight:600;margin-bottom:8px}.studio-rule-fields label span{font-size:12px;font-weight:400;color:var(--studio-muted,#526078)}
.studio-shell .studio-rule-collection .studio-rule-fields input[type=text]{box-sizing:border-box;display:block;width:100%;max-width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1px solid var(--studio-border,#d1d5db);border-radius:8px;background:var(--studio-field,#f9fafb);color:var(--studio-text,#172033);font-size:16px}
.studio-rule-fields>.studio-rule-help,.studio-rule-fields>.studio-rule-error{grid-column:1/-1;margin:0}
.studio-rule-empty{padding:22px 16px;margin:0 0 16px;border:1px dashed var(--studio-border,#d1d5db);border-radius:10px;background:var(--studio-field,#f9fafb);color:var(--studio-muted,#526078);font-size:14px;line-height:1.6;text-align:center}
.studio-rule-notice{margin:0 0 16px;padding:10px 12px;border-left:3px solid #f59e0b;background:var(--studio-field,#fffbeb);color:var(--studio-text,#172033);font-size:13px;line-height:1.6}
.studio-rule-error{color:#dc2626;font-size:14px;line-height:1.6;margin:8px 0}
.studio-shell .studio-rule-collection [hidden]{display:none!important}
.studio-shell .studio-rule-collection button:disabled{opacity:.5;cursor:not-allowed}
.studio-shell .studio-schedules .studio-schedule-fields [data-schedule-weekdays]{margin-top:12px}
.sc-calendar .sc-dialog [data-weekday-field]{margin-top:18px}
html[data-studio-theme=dark] .studio-rule-error,html[data-studio-theme=dark] .studio-shell .studio-rule-remove{color:#fca5a5}
@media(max-width:767px){
 .studio-shell .studio-rule-collection .studio-rule-card{padding:14px}
 .studio-shell .studio-rule-collection .studio-rule-card>header{flex-wrap:wrap;gap:10px}
 .studio-rule-heading{flex:1 1 100%}
 .studio-rule-row-actions{width:100%;justify-content:flex-end}
 .studio-rule-section-actions{width:100%}
 .studio-rule-section-actions>button{flex:1 1 auto}
 .studio-shell .studio-rule-collection .studio-rule-card>.studio-rule-fields,.studio-shell .studio-rule-collection .studio-rule-card>.studio-keyword-fields{grid-template-columns:minmax(0,1fr);gap:16px}
 .studio-shell .studio-rule-section-heading>div:first-child{flex-basis:100%}
 .studio-rule-count{margin-left:0;margin-top:4px}
}
