/* Automations page (frontend/automations/automations-page.js): the Control UI's Automations page
   (ui/src/styles/cron.css, cron-jobs-pagination.css, agent-row-chip.css; 9.7 also cron-transcript.css, folded into chat/transcript-feed.css in 11.x) on the
   settings-page surfaces it shares with Settings (settings-page.css: rows, groups, inputs, switches,
   buttons). Colours are ClawChats' theme; the status tokens come from composer-tokens.css. */

/* ── Page shell: replaces the chat area while open ── */
.app.automations-open > .main,
.app.automations-open > .right-panel { display: none; }

.automations-view {
  --settings-card: color-mix(in srgb, var(--bg-primary) 94%, #fff);
  --settings-line: rgba(var(--ink), 0.08);
  --settings-line-strong: rgba(var(--ink), 0.14);
  --settings-control: rgba(var(--ink), 0.05);
  --settings-danger: #ef4444;
  --space-1: 4px;
  --space-3: 12px;
  --space-6: 24px;
  --space-7: 28px;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 14px;
  scrollbar-width: thin;
}
[data-theme="light"] .automations-view {
  --settings-card: var(--input-bg);
  --settings-line: rgba(var(--ink), 0.1);
  --settings-line-strong: rgba(var(--ink), 0.16);
  --settings-control: rgba(255, 255, 255, 0.72);
  --settings-danger: #dc2626;
}
.automations-view[hidden] { display: none; }
.automations-view__inner {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 36px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.automations-view__inner > .settings-page { padding: 0 0 40px; }
.automations-view .muted { color: var(--text-muted); }

/* Header: title + subtitle, agent scope and close on the right (fixed slots) */
.automations-header { margin-bottom: 0; padding: 0; }
.automations-header__lead { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.automations-header__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.automations-header__menu {
  display: none;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.automations-header__menu:hover { background: rgba(var(--ink), 0.06); color: var(--text-primary); }
.automations-header__menu svg { width: 18px; height: 18px; }
.automations-view .automations-scope { min-width: 150px; }
.automations-close svg { width: 15px; height: 15px; }

/* Rail button: sits above the cog at the bottom of the rail */
.project-rail-automations-btn { margin-top: auto; flex-shrink: 0; }
.project-rail-automations-btn + .project-rail-cog-wrapper { margin-top: 2px; }

/* ── Controls from the settings surface ── */
.automations-view .settings-select,
.automations-view .settings-input {
  height: 32px;
  border: 1px solid var(--settings-line-strong);
  border-radius: 10px;
  background-color: var(--settings-control);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}
.automations-view .settings-select {
  min-width: 140px;
  max-width: 100%;
  padding: 0 32px 0 10px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.automations-view .settings-select option { background: var(--bg-secondary); color: var(--text-primary); }
.automations-view .settings-input { width: 100%; min-width: 0; padding: 0 10px; }
/* Value inputs in a row read right-aligned, as in the Control UI (settings.css); search boxes and stacked rows don't */
.automations-view .settings-row:not(.settings-row--stacked) .settings-row__control input.settings-input { text-align: right; }
.automations-view .settings-input.mono,
.automations-view .cron-payload-code { font-family: var(--mono); }
.automations-view .settings-select:focus,
.automations-view .settings-input:focus { border-color: color-mix(in srgb, var(--accent-color) 60%, transparent); }
.automations-view .settings-input:disabled,
.automations-view .settings-select:disabled { opacity: 0.55; cursor: default; }
.automations-view .cron-textarea { height: auto; min-height: 120px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.automations-view .settings-btn svg { width: 13px; height: 13px; flex: 0 0 auto; }
.automations-view .settings-btn.active { border-color: color-mix(in srgb, var(--accent-color) 45%, transparent); color: var(--text-primary); }
.automations-view .settings-row--stacked { flex-direction: column; align-items: stretch; gap: 8px; }
.automations-view .settings-row--stacked .settings-row__control { max-width: none; justify-content: flex-start; }
.automations-view .settings-row__control { max-width: 60%; }
.automations-view .settings-row--toggle { cursor: pointer; }
.automations-view button.settings-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.automations-view button.settings-row:hover { background: rgba(var(--ink), 0.04); }
.automations-view .settings-group > .settings-row ~ .settings-row,
.automations-view .settings-group > .cron-schedule-summary { border-top: 1px solid var(--settings-line); }

.cron-page { min-width: 0; }
.cron-page .settings-group:has(.cron-table),
.cron-page .settings-group:has(.cron-runs) { overflow: visible; }
.cron-page[data-panel-mode="overview"] { gap: 16px; }
.cron-page--detail { gap: 20px; }

/* ── Overview chrome ── */
.cron-overview-header,
.cron-tab-panel,
.cron-banners { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cron-banners:empty { display: none; }
.cron-tab-panel { gap: 16px; }

.cron-toolbar { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cron-toolbar__primary,
.cron-toolbar__filters { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.cron-toolbar__primary { margin-block: 8px; }
.cron-toolbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.cron-new-task svg { width: 14px; height: 14px; }

.cron-search-box { position: relative; flex: 1 1 auto; min-width: 0; }
.cron-search-box__icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); pointer-events: none; display: flex; }
.cron-search-box__icon svg { width: 100%; height: 100%; }
.automations-view .cron-search-box input { padding-left: 32px; }

.cron-refresh--loading svg { animation: cron-spin 0.9s linear infinite; }
@keyframes cron-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cron-refresh--loading svg, .cron-table__state--running svg { animation: none; } }

/* Tabs (the Control UI's hub tabs): underline on the active one */
.cron-tabs { display: flex; gap: 8px; min-width: 0; overflow-x: auto; border-bottom: 1px solid color-mix(in srgb, var(--settings-line-strong) 70%, transparent); scrollbar-width: none; }
.cron-tab {
  position: relative;
  padding: 6px 8px 8px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}
.cron-tab:hover { color: var(--text-primary); }
.cron-tab--active { color: var(--text-primary); }
.cron-tab--active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-color); }
.cron-tabs--sub { gap: 4px; }
.cron-tabs--sub .cron-tab { padding: 3px 8px 6px; font-size: 11px; }

/* Menus and popovers: ClawChats dropdowns (frontend/ui/dropdown.js), opening downwards */
.automations-view .cc-dd > .cc-dd__menu { top: calc(100% + 6px); bottom: auto; }
.automations-view .cron-menu,
.automations-view .cron-filter-popover__panel {
  min-width: 170px;
  padding: var(--menu-padding, 4px);
  border: 1px solid var(--overlay-border, var(--settings-line-strong));
  border-radius: var(--menu-radius, 10px);
  background: var(--bg-elevated, var(--bg-secondary));
  box-shadow: var(--overlay-shadow, 0 8px 24px rgb(0 0 0 / 0.24));
}
.automations-view .cc-item { font-size: 13px; min-height: 30px; }
.cron-menu__danger { color: var(--settings-danger); }
.cron-menu__separator { height: 1px; margin: 4px 0; background: var(--settings-line); }
.cron-check { width: 16px; height: 16px; color: var(--accent-text); }
.automations-view .cc-item > [slot="details"] svg { width: 14px; height: 14px; color: var(--accent-text); }

.automations-view .cron-filter-popover__panel { width: min(280px, calc(100vw - 48px)); padding: 12px; }
.cc-dd[open] > .cron-filter-popover__panel { display: grid; gap: 12px; }
.cron-filter-field { display: grid; gap: 4px; font-size: 12px; color: var(--text-muted); }
.automations-view .cron-filter-field .settings-select { width: 100%; }

.cron-error-banner {
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  background: var(--danger-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}

.cron-notice-banner {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}
.cron-scratch__field { display: grid; gap: 6px; margin: 12px 0 4px; }
.cron-scratch .settings-btn { margin-right: 6px; }

/* ── Jobs table ── */
.cron-table { --cron-table-columns: minmax(220px, 1.8fr) minmax(160px, 1.05fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) 116px; }
.cron-table__head,
.cron-table__row { display: grid; grid-template-columns: var(--cron-table-columns); gap: 12px; align-items: center; padding: 0 16px; }
.cron-table__head {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--settings-line);
}
.cron-table__row { padding-top: 8px; padding-bottom: 8px; cursor: pointer; transition: background 0.1s; }
.cron-table__row + .cron-table__row { border-top: 1px solid var(--settings-line); }
.cron-table__row:hover,
.cron-table__row:focus-within { background: rgba(var(--ink), 0.04); }
.cron-table__row--paused .cron-table__name-text,
.cron-table__row--paused .cron-table__cell { color: var(--text-muted); }

.cron-table__name {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.cron-table__state { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-top: 2px; color: var(--text-muted); }
.cron-table__state svg { width: 13px; height: 13px; }
.cron-table__state-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.cron-table__state--running { color: var(--accent-text); }
.cron-table__state--running svg { animation: cron-spin 1s linear infinite; }
.cron-table__state--error { color: var(--danger); }
.cron-table__name-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cron-table__name-line,
.cron-table__name-meta { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cron-table__name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-table__description { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--text-muted); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.cron-table__paused-note { flex: 0 0 auto; font-size: 11px; font-weight: 400; }
.cron-table__meta-separator { color: var(--text-muted); }
.cron-table__running { color: var(--accent-text); }
.cron-table__auto-disabled { color: var(--danger); }
.cron-table__cell { color: var(--text-secondary); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-table__cell-label { display: none; }
.cron-table__cell-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-table__last { display: flex; align-items: center; }
.cron-table__last-run { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.cron-last-glyph { flex: 0 0 auto; display: inline-flex; color: var(--text-muted); }
.cron-last-glyph svg { width: 13px; height: 13px; stroke-width: 2.5; }
.cron-last-glyph--ok { color: var(--ok); }
.cron-last-glyph--error { color: var(--danger); }
.cron-table__last-time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-table__actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; cursor: default; }
.automations-view .cron-row-run,
.automations-view .cron-job-menu__trigger { width: 28px; height: 28px; }
.automations-view .cron-row-run svg { width: 11px; height: 11px; }
.cron-table__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--settings-line); font-size: 12px; }

/* Agent chip (agent-row-chip.css) */
.agent-row-chip { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; color: var(--text-muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
.agent-row-chip__avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: var(--settings-control); font-size: 10px; }
.agent-row-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cron-trigger-icon { display: inline-flex; flex: 0 0 auto; width: 14px; height: 14px; color: var(--accent-text); vertical-align: middle; }
.cron-trigger-icon svg,
.cron-trigger-summary svg { width: 100%; height: 100%; }
.cron-chevron { display: inline-flex; width: 14px; height: 14px; color: var(--text-muted); }
.cron-chevron svg { width: 100%; height: 100%; }

.cron-empty-state { padding: 24px 16px; display: grid; gap: 4px; justify-items: center; text-align: center; color: var(--text-muted); font-size: 12px; }
.cron-empty-state__title { color: var(--text-primary); font-size: 13px; font-weight: 650; }
.cron-empty-state__copy { color: var(--text-muted); font-size: 12px; line-height: 1.45; }

/* ── Detail view ── */
.cron-back-row { display: flex; }
.cron-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 0;
  cursor: pointer;
}
.cron-back:hover { color: var(--text-primary); }
.cron-back svg { width: 13px; height: 13px; }
.cron-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cron-detail-header__copy { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cron-detail-title { color: var(--text-primary); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-detail-description { max-width: 72ch; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.cron-detail-description__label { color: var(--text-muted); font-weight: 600; }
.cron-detail-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cron-detail-sub { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cron-enabled-toggle { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cron-enabled-toggle--slot { visibility: hidden; } /* system rows keep the switch's slot: buttons never shift */
.cron-enabled-toggle + .cron-detail-sub { border-left: 1px solid var(--settings-line-strong); padding-left: 10px; }
.cron-detail-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* ── Editor ── */
.cron-editor { display: flex; flex-direction: column; gap: var(--space-7); min-width: 0; margin: 0; padding: 0; border: 0; }
.cron-history,
.cron-activity { padding: 12px 16px; }
.cron-control { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; min-width: 0; width: min(320px, 100%); }
.cron-control .cron-help { text-align: right; }
.cron-control--wide { width: 100%; align-items: stretch; }
.cron-control--wide .cron-help { text-align: left; }
.cron-control > .settings-select { width: 100%; }
.cron-payload-code {
  margin: 0;
  width: 100%;
  height: 240px;
  min-height: 96px;
  resize: vertical;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
  padding: 10px 12px;
  border: 1px solid var(--settings-line-strong);
  border-radius: 10px;
  background: var(--settings-control);
  color: var(--text-primary);
  font-size: 12px;
  box-sizing: border-box;
}
.cron-payload-code:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent-color) 70%, transparent); outline-offset: 1px; }
.cron-inline-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; width: 100%; }
.cron-inline-controls .settings-select { min-width: 0; width: 100%; }
.cron-model-picker { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.cron-model-picker .settings-select { width: 100%; }
.cron-help { color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.cron-help[hidden] { display: none; }
.cron-error { color: var(--danger); }
.cron-required-marker { color: var(--danger); font-weight: 700; margin-left: 3px; }
.cron-required-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.automations-view .cron-editor [aria-invalid="true"] { border-color: var(--danger); }

.cron-segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--settings-line-strong); border-radius: 10px; background: var(--settings-control); }
.cron-segmented__option { height: 26px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; }
.cron-segmented__option:hover { color: var(--text-primary); }
.cron-segmented__option--active { background: var(--settings-card); color: var(--text-primary); box-shadow: 0 1px 2px rgb(0 0 0 / 0.18); }

.cron-schedule-summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 12.5px; line-height: 1.4; }
.cron-schedule-summary[hidden] { display: none; }
.cron-schedule-summary svg { flex: 0 0 auto; width: 13px; height: 13px; color: var(--text-muted); }

.cron-advanced__summary { cursor: pointer; }
.cron-advanced > .cron-advanced__desc { margin: 8px 0 0; }
.cron-advanced > .settings-group { margin-top: 12px; }
.cron-trigger-summary { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--accent-text); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; vertical-align: middle; }
.cron-trigger-summary svg { width: 13px; height: 13px; }
.cron-trigger-script { min-height: 160px; white-space: pre; }

.cron-form-status { border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-subtle); border-radius: 10px; padding: 12px; }
.cron-form-status__title { color: var(--text-primary); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cron-form-status__list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.cron-form-status__link { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12px; line-height: 1.4; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cron-form-status__link:hover { color: var(--text-primary); }

/* Sticky save bar: stays visible while the long form scrolls */
.cron-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--settings-line-strong);
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cron-submit-reason { color: var(--text-muted); font-size: 12px; line-height: 1.4; }

/* ── Run history ── */
.cron-runs,
.cron-runs__region { display: flex; flex-direction: column; gap: 12px; }
.cron-runs__region > .settings-btn { align-self: flex-start; }
.cron-runs__empty { font-size: 13px; }
.cron-runs__list { display: flex; flex-direction: column; }
.cron-run-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cron-run-filter-search { flex: 1 1 220px; }
.cron-filter-dropdown { min-width: 0; flex: 0 0 auto; }
.cron-filter-dropdown__trigger { justify-content: space-between; gap: 6px; }
.cron-filter-dropdown__trigger svg { color: var(--text-muted); }
.automations-view .cron-filter-dropdown .cron-menu { width: min(240px, calc(100vw - 48px)); }

.cron-condition-activity { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(390px, 2fr); align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--settings-line); }
.cron-condition-activity__intro { min-width: 0; }
.cron-condition-activity__intro .settings-row__title { display: flex; align-items: center; gap: 7px; }
.cron-condition-activity__icon { display: inline-flex; color: var(--accent-text); }
.cron-condition-activity__icon svg { width: 13px; height: 13px; }
.cron-condition-activity__metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; margin: 0; }
.cron-condition-activity__metric { min-width: 0; padding-left: 16px; border-left: 1px solid var(--settings-line-strong); }
.cron-condition-activity__metric dt { color: var(--text-muted); font-size: 12px; }
.cron-condition-activity__metric dd { margin: 2px 0 0; color: var(--text-primary); font-size: 13px; font-weight: 600; }

.cron-run-entry { padding: 12px 0; min-width: 0; }
.cron-run-entry + .cron-run-entry { border-top: 1px solid var(--settings-line); }
.cron-run-entry--highlighted { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent-color) 75%, transparent); padding-left: 12px; }
.cron-run-entry__header { display: flex; flex-direction: column; align-items: baseline; gap: 8px; width: 100%; }
@media (min-width: 1200px) {
  .cron-run-entry__header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); gap: 16px; align-items: start; }
  .cron-run-entry__meta { text-align: right; }
}
.cron-run-entry__main { min-width: 0; }
.cron-run-entry__title { color: var(--text-primary); font-size: 13px; font-weight: 600; }
.cron-run-entry__facts { margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.cron-run-entry__meta { min-width: 0; font-size: 12px; display: grid; gap: 2px; }
.cron-run-entry__meta .settings-btn { height: 26px; margin-top: 4px; font-size: 12px; }
.cron-run-entry__body { padding-top: 8px; font-size: 13px; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.cron-run-entry__body pre,
.cron-run-entry__body table { overflow-x: auto; max-width: 100%; }
.cron-run-entry__body > :first-child { margin-top: 0; }
.cron-run-entry__body code,
.cron-transcript__msg code { font-size: 0.9em; }
.cron-run-entry__body > :last-child { margin-bottom: 0; }
.automations-view .cron-load-more { align-self: center; }

/* Run transcript (pages/cron/run-transcript.tsx, which embeds the chat transcript feed: styles/chat/transcript-feed.css) */
.cron-transcript { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; outline: none; }
.cron-transcript__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cron-transcript__title { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 650; }
.cron-transcript__earlier { align-self: center; }
.cron-transcript__feed { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.cron-transcript__msg { padding: 10px 12px; border: 1px solid var(--settings-line); border-radius: 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.cron-transcript__msg--user { background: var(--settings-control); }
.cron-transcript__role { margin-bottom: 4px; color: var(--text-muted); font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.cron-transcript__activity { margin-bottom: 4px; font-size: 12px; }
.cron-transcript__msg .message-content > :last-child { margin-bottom: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  /* Keep every table fact, but label and arrange it as a compact card. */
  .cron-table__head { display: none; }
  .cron-table__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding-top: 12px; padding-bottom: 12px; }
  .cron-table__name,
  .cron-table__schedule { grid-column: 1 / -1; }
  .cron-table__cell { display: flex; align-items: baseline; gap: 4px; color: var(--text-muted); font-size: 12px; white-space: normal; }
  .cron-table__cell-label { display: inline; flex: 0 0 auto; font-size: 11px; font-weight: 600; }
  .cron-table__cell-label::after { content: ':'; }
  .cron-table__cell-value { white-space: normal; overflow-wrap: anywhere; }
  .cron-table__actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 24px; }
}
@media (max-width: 768px) {
  .automations-view__inner { padding: 16px 12px 0; }
  .automations-header__menu { display: inline-flex; }
  .automations-header { flex-wrap: wrap; row-gap: 12px; }
  .automations-header__actions { margin-left: auto; }
  .automations-view .settings-row { flex-wrap: wrap; }
  .automations-view .settings-row__control { max-width: 100%; }
  .cron-condition-activity { grid-template-columns: 1fr; }
  .cron-condition-activity__metric:first-child { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .cron-toolbar__primary,
  .cron-detail-meta,
  .cron-detail-actions { flex-wrap: wrap; }
  .cron-detail-header { flex-direction: column; }
  .cron-detail-title,
  .cron-detail-sub { white-space: normal; overflow-wrap: anywhere; }
  .cron-control { width: 100%; align-items: stretch; }
  .cron-control .cron-help { text-align: start; }
  .cron-inline-controls { grid-template-columns: minmax(0, 1fr); }
  .cron-editor-actions > .settings-btn { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  .cron-new-task span { display: none; }
  .automations-view .cron-new-task { width: 36px; padding: 0; }
}
