.automation-page .automation-workspace { min-width: 0; }
.automation-page .automation-workspace-panel { display: grid; gap: 16px; min-width: 0; }
.automation-page .automation-workspace-panel[hidden] { display: none; }
.automation-page .automation-workspace-muted,
.automation-detail-dialog .automation-workspace-muted {
  color: var(--enh-muted, var(--text-secondary, #64748b));
  font-size: .875rem;
  margin: 8px 0;
}
.automation-page .automation-workspace-freshness { margin: 0 0 14px; }
.automation-page .automation-workspace-list-heading { margin: 0; flex-wrap: wrap; }
.automation-page .automation-workspace-list-heading h2 { color: var(--enh-ink, var(--text-primary, currentColor)); }
.automation-page .automation-card-actions .automation-ghost-button { background: var(--enh-surface, #f8fafc); color: var(--enh-ink, #1e293b); border-color: var(--enh-line, #dbeafe); box-shadow: none; }
.automation-page .automation-side-panel .automation-ghost-button { margin-top: 12px; }
.automation-page .automation-event details { margin-top: 8px; overflow-wrap: anywhere; }
.automation-page .automation-event summary { color: var(--enh-ink, currentColor); cursor: pointer; font-size: .8125rem; font-weight: 750; }
.automation-page .automation-workspace-confirm { box-shadow: none; color: var(--enh-ink, currentColor); }
.automation-page .automation-workspace-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.automation-page .automation-workspace-filters label { display: grid; gap: 5px; flex: 1 1 13rem; min-width: 0; font-size: .8125rem; font-weight: 800; color: var(--enh-ink, currentColor); }
.automation-page .automation-workspace-filters input,
.automation-page .automation-workspace-filters select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--enh-line, #cbd5e1);
  border-radius: 12px;
  background: var(--enh-surface, #f8fafc);
  color: var(--enh-ink, #1e293b);
  font: inherit;
}
.automation-page .automation-workspace-filters input::placeholder { color: var(--enh-muted, #64748b); }
.automation-page .automation-workspace :is(button, input, select, summary):focus-visible { outline: 2px solid var(--enh-accent, #7c3aed); outline-offset: 2px; }
.automation-page .automation-workspace :is(.automation-scheduler-list,.automation-timing-grid,.automation-metric-row) strong { white-space: normal; overflow-wrap: anywhere; }
.automation-page .automation-scheduler-list div > span { color: var(--enh-muted, #64748b); display: block; font-size: 12px; font-weight: 800; }
.automation-page .automation-header .automation-ghost-button:disabled { opacity: .75; cursor: wait; transform: none; }
.automation-page .automation-counter {
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  min-width: 0;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.automation-page .automation-counter:hover { border-color: var(--enh-accent, currentColor); }
.automation-page .automation-counter .automation-counter-link {
  color: var(--enh-ink, currentColor);
  font-size: .76rem;
  text-decoration: underline;
  text-underline-offset: .18em;
  margin-top: 4px;
}
.automation-page .automation-metric-row > .automation-counter {
  background: var(--enh-surface, Canvas);
  border: 1px solid var(--enh-line, #cbd5e1);
  border-radius: 13px;
  color: var(--enh-ink, CanvasText);
  padding: 11px;
}
.automation-page .automation-result { display: grid; gap: 8px; }
.automation-page .automation-message.neutral,
.automation-detail-dialog .automation-message.neutral { color: var(--enh-ink, CanvasText); border: 1px solid var(--enh-line, #cbd5e1); background: var(--enh-surface, Canvas); }
.automation-page .automation-message.warning,
.automation-detail-dialog .automation-message.warning {
  background: color-mix(in srgb, var(--enh-warning, #b7791f) 13%, var(--enh-surface, Canvas));
  color: var(--enh-ink, CanvasText);
  border: 1px solid color-mix(in srgb, var(--enh-warning, #b7791f) 60%, var(--enh-line, transparent));
}
.automation-page .automation-result-tag,
.automation-detail-dialog .automation-result-tag {
  width: fit-content;
  display: inline-flex;
  margin: .25rem 0;
  padding: .25rem .5rem;
  border-radius: 99px;
  border: 1px solid currentColor;
  color: var(--enh-muted, CanvasText);
  font-size: .75rem;
  font-weight: 850;
}
.automation-result-tag.danger { --enh-muted: var(--enh-danger, #a62034); }
.automation-result-tag.warning { --enh-muted: var(--enh-warning, #8a520b); }
.automation-result-tag.success { --enh-muted: var(--enh-success, #167044); }
:root[data-theme="dark"] .automation-result-tag.danger { --enh-muted: #fca5a5; }
:root[data-theme="dark"] .automation-result-tag.warning { --enh-muted: #fde68a; }
:root[data-theme="dark"] .automation-result-tag.success { --enh-muted: #86efac; }
.automation-rule-workspace { display: grid; gap: 14px; min-width: 0; }
.automation-rule-templates { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.automation-rule-config { min-width: 0; margin: 0; padding: 0; border: 0; }
.automation-rule-group {
  border: 1px solid var(--enh-line, #cbd5e1);
  border-radius: 13px;
  min-width: 0;
  margin: 0 0 12px;
  padding: 12px;
}
.automation-rule-group legend,
.automation-rule-group summary { color: var(--enh-ink, CanvasText); font-weight: 800; }
.automation-rule-group summary { cursor: pointer; }
.automation-rule-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.automation-rule-checks label { display: flex; align-items: center; gap: 7px; color: var(--enh-ink, CanvasText); font-size: .875rem; min-height: 32px; }
.automation-rule-checks input[type="checkbox"] { accent-color: var(--enh-accent, #7c3aed); width: 17px; height: 17px; flex: 0 0 17px; }
.automation-rule-people { margin-top: 12px; }
.automation-rule-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.automation-rule-preview { margin-top: 12px; }
.automation-rule-form .automation-rule-fields { align-items: start; }
.automation-detail-dialog { width: min(54rem, calc(100% - 24px)); max-height: 85dvh; overflow: auto; color: var(--enh-ink, CanvasText); padding: 0; margin: auto; }
.automation-detail-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.automation-detail-dialog-body { padding: clamp(12px,3vw,22px); }
.automation-detail-list { display: grid; gap: 8px; padding: 0; margin: 10px 0; list-style: none; }
.automation-detail-list .automation-event { grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; }
.automation-detail-list .automation-event a { color: inherit; text-decoration: underline; text-underline-offset: .18em; }
.automation-detail-dialog :is(.automation-card-actions,.automation-detail-list) { margin-top: 12px; }
@media (max-width: 760px) {
  .automation-page .automation-workspace :is(.automation-workspace-filters select, .automation-workspace-filters input, .automation-workspace-filters button) { min-height: 44px; }
  .automation-page .automation-workspace .automation-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-page .automation-workspace .automation-kpi { align-items: start; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .automation-rule-templates { grid-template-columns: minmax(0,1fr); }
  .automation-detail-dialog .automation-panel-heading { flex-wrap: wrap; }
}
