/* Schedules: the section on the Tests page, the inline editor, and a schedule's page. Same tokens
   and components as the rest of the console (list rows, pills, segmented choice, fields). */

.sched-section { margin-top: 36px; }
.sched-head { margin-bottom: 14px; }
.sched-h { font-size: 18px; }
.sched-list .sched-item { align-items: flex-start; }
.sched-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.sched-item:last-child { border-bottom: 0; }
.sched-main { flex: 1 1 420px; min-width: 0; display: grid; gap: 6px; }
.sched-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sched-title-row .test-name { overflow-wrap: anywhere; }
.sched-desc { margin: 0; overflow-wrap: anywhere; }
.sched-bad { color: var(--bad); font-weight: 600; }
.sched-facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 2px 0 0; }
.sched-facts > div { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.sched-facts dt { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--text-dim); }
.sched-facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.sched-row-actions { align-self: center; }
.sched-msg { flex-basis: 100%; margin: 0; }
.sched-msg:empty { display: none; }
.sched-msg-bad { color: var(--bad); }
.run-ref { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); min-width: 0; }
.run-ref:hover .run-id { text-decoration: underline; }
.run-ref .run-id { overflow-wrap: anywhere; }
.pill-sched-paused { background: var(--panel-2); color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--border); }
.pill-sched-done { background: var(--panel-2); color: var(--text); }
.sched-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; }
.sched-tag:hover { text-decoration: underline; }
.sched-tag .icon { width: 13px; height: 13px; }

.sched-callout { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text); }
.sched-callout > .icon { margin-top: 2px; color: var(--warn); }
.sched-callout-bad { background: var(--bad-soft); }
.sched-callout-bad > .icon { color: var(--bad); }
.sched-callout p { margin: 0; overflow-wrap: anywhere; }
.sched-callout-title { font-weight: 700; }
.sched-callout-next { margin-top: 2px !important; }

.sched-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--panel); }
.sched-empty > div { flex: 1 1 320px; min-width: 0; }
.sched-empty p { margin: 4px 0 0; max-width: 70ch; }
.sched-empty .state-icon { width: 38px; height: 38px; }

/* Editor. */
.sched-editor-slot:not(:empty) { margin-bottom: 16px; }
.sched-editor { display: grid; gap: 14px; padding: 16px 18px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.sched-editor .sec-title { outline: none; }
.sched-grid { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.sched-editor .seg { display: flex; padding: 0; border: 0; background: none; }
.sched-kind { display: grid; gap: 8px; }
.sched-kind .field-pair { margin-top: 0; }
.sched-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-chip { min-height: 30px; padding: 4px 10px; border-color: var(--border); background: var(--inset); color: var(--text-dim); font-size: 13px; font-weight: 600; }
.btn-chip:hover:not(:disabled) { color: var(--text); }
.sched-tz .input { max-width: 360px; }
.sched-preview { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--border-soft); min-height: 52px; }
.sched-preview[data-state="bad"] { border-color: var(--bad); }
.sched-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.sched-sentence > .icon { color: var(--accent); }
.sched-sentence-bad > .icon { color: var(--bad); }
.sched-next { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.sched-options { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.sched-options summary { cursor: pointer; font-weight: 600; color: var(--text-dim); width: fit-content; }
.sched-options summary:hover { color: var(--text); }
.sched-options-body { display: grid; gap: 12px; margin-top: 10px; }
.sched-options .select { min-width: 0; width: 100%; }
.sched-summary:empty { display: none; }
.sched-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Page. */
.sched-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.sched-page-head .sched-sentence { font-size: 16px; }
.sched-page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; margin: 16px 0; }
.sched-page-grid .kvs dd { margin: 0; overflow-wrap: anywhere; }
.sched-outcomes { display: grid; gap: 10px; }
.sched-fires td { vertical-align: top; }
.sched-trigger { display: block; font-size: 12px; }
.sched-fires time { white-space: nowrap; }
.sched-fires time .muted { display: block; white-space: normal; font-size: 12.5px; }
.col-why { min-width: 260px; overflow-wrap: anywhere; }
.sched-next-action { display: block; margin-top: 2px; color: var(--text-dim); }

@media (max-width: 640px) {
  .sched-item { padding: 12px; }
  .sched-row-actions { width: 100%; }
  .sched-row-actions .btn { flex: 1 1 auto; justify-content: center; }
  .sched-editor { padding: 14px 12px; }
  .col-why { min-width: 200px; }
}
