/* Dispatch's own pages, on keel's look (keel/web/static/css/keel.css: the tokens, the
   shell, cards, tables, buttons, fields, windows, menus). Runs, jobs, schedules, hosts,
   Docker, the job editor, trends and the assistant. Colours only through keel's tokens. */

.took { font-variant-numeric: tabular-nums; }
.activity-btn { border: 1px solid var(--af-line-strong); background: var(--af-card); border-radius: 999px; font-weight: 600; color: var(--af-ink); padding: .2rem .8rem; display: inline-flex; align-items: center; gap: .35rem; }
.activity-btn:hover { background: var(--af-inset); }
.activity-btn.is-busy { border-color: var(--af-info-mark); box-shadow: 0 0 0 3px rgba(47, 90, 168, .15); }
.activity-btn .running-count { background: var(--af-info-wash); color: var(--af-info-ink); border: 1px solid var(--af-info-edge); }
.activity-btn.is-stale { border-style: dashed; color: var(--af-ink-soft); }
.activity-btn .review-count { background: var(--af-danger-solid); color: #fff; }
.table tr.row-problem > td:first-child { box-shadow: inset 4px 0 0 var(--af-danger-ink); }
.table tr.row-problem:not(.is-reviewed) > td { --cui-table-bg: var(--af-danger-row); }
.group-cell { max-width: 28rem; }
.group-chip { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--af-primary-ink); background: var(--af-info-wash); border: 1px solid var(--af-info-edge); border-radius: 999px; padding: .05rem .5rem; margin: 0 .25rem .25rem 0; text-decoration: none; white-space: nowrap; }
.group-chip:hover { background: var(--af-primary); color: #fff; border-color: var(--af-primary); }
.group-chip.is-inherited { background: var(--af-card); border-style: dashed; }
.group-chip.is-current { background: var(--af-primary); color: #fff; border-color: var(--af-primary); }
.job-section > .card-header { font-size: 1rem; }
/* Run history's All | Succeeded | Failed switch: the chosen one is filled in its colour. */
.status-switch { display: inline-flex; align-items: center; border: 1px solid var(--af-line-strong); border-radius: 999px; background: var(--af-card); padding: 2px; gap: 2px; }
.status-switch > .btn, .status-switch .status-more > .btn { border: 0; border-radius: 999px; font-weight: 600; color: var(--af-ink-soft); padding: .2rem .8rem; }
.status-switch > .btn:hover, .status-more > .btn:hover { background: var(--af-inset); color: var(--af-ink); }
.status-switch .seg-count { font-size: .75rem; font-weight: 600; margin-left: .25rem; padding: 0 .4rem; border-radius: 999px; background: var(--af-neutral-wash); color: var(--af-neutral-ink); font-variant-numeric: tabular-nums; }
.btn-check:checked + .status-all { background: var(--af-primary); color: #fff; }
.btn-check:checked + .status-ok { background: var(--af-success-solid); color: #fff; }
.btn-check:checked + .status-bad { background: var(--af-danger-solid); color: #fff; }
.btn-check:checked + .btn .seg-count { background: rgba(255, 255, 255, .22); color: #fff; }
.status-bad .seg-count { color: var(--af-danger-ink); background: var(--af-danger-wash); }
.status-more:has(.btn-check:checked) > .btn { background: var(--af-neutral-solid); color: #fff; }
.status-more .dropdown-item { cursor: pointer; }
.status-more .btn-check:checked + .dropdown-item { font-weight: 700; background: var(--af-inset); }
/* Outcomes must read at a glance: good runs solid green, error runs solid red. */
.badge.run-status.is-succeeded { background: var(--af-success-solid) !important; color: #fff !important; border-color: var(--af-success-solid); }
.badge.run-status.is-failed, .badge.run-status.is-timed_out, .badge.run-status.is-lost { background: var(--af-danger-solid) !important; color: #fff !important; border-color: var(--af-danger-solid); }
.run-status i { font-size: .8em; }
.exit-code { font-family: var(--af-mono); font-size: .85rem; font-weight: 600; }
.exit-code.is-ok, .exit-code.is-bad { border: 1px solid transparent; border-radius: 5px; padding: .05rem .4rem; }
.exit-code.is-ok { color: var(--af-ink); background: var(--af-cap); border-color: var(--af-line-strong); }
.exit-code.is-bad { color: #fff; background: var(--af-danger-solid); }
.exit-code.is-none { color: var(--af-ink-faint); }
.run-outcome { display: flex; align-items: center; gap: .6rem; border-radius: var(--af-radius-sm); padding: .6rem .9rem; font-size: 1.1rem; font-weight: 700; border: 1px solid transparent; }
.run-outcome.is-succeeded { background: var(--af-success-solid); color: #fff; }
.run-outcome.is-failed, .run-outcome.is-timed_out, .run-outcome.is-lost { background: var(--af-danger-solid); color: #fff; }
.run-outcome.is-running { background: var(--af-info-wash); color: var(--af-info-ink); border-color: var(--af-info-edge); }
.run-outcome.is-running i { animation: keel-pulse 1.2s ease-in-out infinite; }
.run-outcome.is-queued, .run-outcome.is-waiting { background: var(--af-neutral-wash); color: var(--af-neutral-ink); border-color: var(--af-neutral-edge); }
/* Three takeaways at a glance: green good, red bad, yellow "not normal, not bad". */
.run-outcome.is-cancelled, .run-outcome.is-skipped { background: var(--af-warning-wash); color: var(--af-warning-ink); border-color: var(--af-warning-edge); }
.run-strip { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: .35rem; }
.run-strip .pip { display: inline-block; width: 9px; height: 16px; border-radius: 2px; background: var(--af-neutral-edge); }
.run-strip.is-large .pip { width: 14px; height: 26px; border-radius: 3px; }
.run-strip .pip:hover { outline: 2px solid var(--af-ink); outline-offset: 1px; }
.run-strip .pip.is-succeeded { background: var(--af-success-ink); }
.run-strip .pip.is-failed, .run-strip .pip.is-timed_out, .run-strip .pip.is-lost { background: var(--af-danger-ink); }
.run-strip .pip.is-running, .run-strip .pip.is-queued, .run-strip .pip.is-waiting { background: var(--af-info-mark); }
.run-strip .pip.is-cancelled, .run-strip .pip.is-skipped { background: var(--af-warning-mark); }
.last-failure { color: var(--af-ink-soft); text-decoration: none; font-variant-numeric: tabular-nums; }
.last-failure:hover { text-decoration: underline; }
.last-failure.needs-review { color: var(--af-danger-ink); font-weight: 700; }
.results-counts { font-weight: 600; display: flex; gap: 1rem; }
.run-status.is-running i { animation: keel-pulse 1.2s ease-in-out infinite; }
.target-choice { display: grid; gap: .5rem; }
.target-option { display: flex; gap: .65rem; align-items: flex-start; border: 1px solid var(--af-line); border-radius: var(--af-radius-sm); padding: .6rem .8rem; cursor: pointer; background: var(--af-field); }
.target-option:has(input:checked) { border-color: var(--af-primary); background: var(--af-card); box-shadow: 0 0 0 .15rem var(--af-focus-ring); }
.target-option input { margin-top: .3rem; accent-color: var(--af-primary); }
.target-option small { display: block; color: var(--af-ink-soft); }
.schedule-preview { background: var(--af-inset); border: 1px solid var(--af-line-soft); border-radius: var(--af-radius-sm); padding: .5rem .75rem; min-height: 2.4rem; }
.cron-example { border: 0; background: none; padding: 0; margin-left: .35rem; white-space: nowrap; }  /* a button, so the keyboard reaches it */
.cron-builder { background: var(--af-inset); border: 1px solid var(--af-line-soft); border-radius: var(--af-radius-sm); padding: .5rem .75rem; margin-bottom: .5rem; }
.cron-builder-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; font-size: .875rem; }
.cron-builder-row > span { display: inline-flex; align-items: center; gap: .35rem; }
.cron-builder-row > span[hidden] { display: none; }
.cron-builder-kind { width: auto; font-weight: 500; }
.cron-builder-num { width: 4.5rem; }
.cron-builder-days { gap: .2rem !important; }
.cron-builder-days .btn { padding: .1rem .45rem; font-size: .78rem; }
.cron-legend { display: flex; gap: .35rem; margin-top: .35rem; }
.cron-legend span { display: inline-flex; flex-direction: column; align-items: center; min-width: 4.5rem; padding: .15rem .4rem; border: 1px solid var(--af-line-soft); border-radius: 6px; background: var(--af-card); }
.cron-legend code { color: var(--af-navy-ink); font-weight: 600; }
.cron-legend small { color: var(--af-ink-soft); font-size: .7rem; white-space: nowrap; }
.cron-example:hover code, .cron-example:focus-visible code { text-decoration: underline; }
.run-view { display: flex; flex-direction: column; min-height: 0; gap: .5rem; }
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.run-title { font-weight: 650; color: var(--af-ink); text-decoration: none; }
.run-title:hover { text-decoration: underline; }
.run-facts { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .85rem; color: var(--af-ink-soft); }
.run-facts i { color: var(--af-ink-faint); margin-right: .15rem; }
.run-actions { margin-left: auto; display: flex; gap: .4rem; }
.ack-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--af-danger-wash); border: 1px solid var(--af-danger-edge); color: var(--af-danger-ink); border-radius: var(--af-radius-sm); padding: .4rem .6rem; font-weight: 600; font-size: .9rem; }
.ack-bar .form-control { flex: 1 1 14rem; max-width: 26rem; }
.ack-done { color: var(--af-success-ink); }
.log-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.log-toolbar .btn-group .btn.active { background: var(--af-primary); border-color: var(--af-primary); color: #fff; }
.run-log {
  background: var(--af-log-bg); color: var(--af-log-ink);
  font-family: var(--af-mono); font-size: .8rem; line-height: 1.5;
  border-radius: 10px; padding: .75rem 1rem; margin: 0;
  min-height: 14rem; max-height: 70vh; overflow: auto; white-space: pre;
}
.run-view.is-full .run-log { max-height: calc(100vh - 20rem); min-height: 6rem; }
.run-log.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.run-log .o-stderr { color: var(--af-log-err); }
.run-log .o-system { color: var(--af-log-sys); font-style: italic; }
.run-log.only-stdout .o-stderr, .run-log.only-stdout .o-system,
.run-log.only-stderr .o-stdout, .run-log.only-stderr .o-system { display: none; }
.run-log:focus-visible { outline: 2px solid var(--af-accent); outline-offset: 2px; }
.float-window-body > .run-view { flex: 1; }
.float-window-body > .run-view > .run-log { flex: 1; max-height: none; min-height: 6rem; }
.activity-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--af-ink-soft); margin: .75rem 0 .35rem; }
.activity-title:first-child { margin-top: 0; }
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--af-line-soft); }
.activity-list a { color: var(--af-ink); text-decoration: none; }
.activity-list a:hover { text-decoration: underline; }@media (max-width: 991.98px) {
  .run-actions { margin-left: 0; }
}
/* Jobs: one line per job; groups are divider rows in one table. */
.jobs-table .group-row th {
  background: var(--af-cap); color: var(--af-ink); font-size: .78rem; font-weight: 650;
  text-transform: none; letter-spacing: 0; padding-top: .35rem; padding-bottom: .35rem;
  border-top: 1px solid var(--af-line);
}
.jobs-table .group-row a { color: var(--af-ink); text-decoration: none; }
.jobs-table .group-row a:hover { text-decoration: underline; }
.jobs-table .group-row i { color: var(--af-ink-faint); margin-right: .3rem; }
.group-count { font-size: .7rem; font-weight: 600; color: var(--af-ink-soft); background: var(--af-neutral-wash); border-radius: 999px; padding: 0 .45rem; margin-left: .35rem; }
.jobs-table .group-continued { font-weight: 400; color: var(--af-ink-soft); }
/* width + max-width:0 lets the cell take its share and the description ellipsis, instead
   of the cell growing to fit it and pushing the other columns off screen. */
/* The job column takes whatever the other (no-wrap) columns leave; its description
   ellipsises instead of pushing them off screen. */
.job-cell { width: 100%; max-width: 0; overflow: hidden; }
.job-line { display: flex; align-items: center; gap: .1rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.job-line > * { flex: none; }
.job-line > .job-desc { flex: 1 1 auto; }
.job-name { font-weight: 600; }
.job-desc { color: var(--af-ink-soft); font-size: .78rem; margin-left: .5rem; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* The customer is its own column: as wide as the longer names, then an ellipsis (the
   whole name in its title). */
.jobs-table .job-cell { min-width: 13rem; }
.jobs-table td.col-customer { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.customer-name { color: var(--af-ink); }
.customer-name.is-inactive { color: var(--af-ink-soft); font-style: italic; }
.avg-failed { color: var(--af-danger-ink); }
/* Several jobs at once (jobs/index.html #bulkJobs): a bar above the list while jobs are
   ticked, kept in view as the list scrolls. */
.bulk-bar { position: sticky; top: 3.5rem; z-index: 1005; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .5rem .75rem; border-color: var(--af-navy-soft); box-shadow: var(--af-shadow); }
.bulk-bar[hidden] { display: none; }
.bulk-bar > .form-select { width: auto; }
.bulk-field { min-width: 14rem; }
.bulk-field[hidden] { display: none; }
.bulk-count { font-weight: 600; font-size: .875rem; white-space: nowrap; }
.run-strip .pip { height: 14px; width: 8px; }
.review-more { font-size: .8rem; }
.scheduler-down { background: var(--af-danger-solid); color: #fff; padding: .45rem 1.25rem; font-size: .85rem; }
.scheduler-down code { color: #fff; background: rgba(255, 255, 255, .15); padding: 0 .3rem; border-radius: 4px; }
/* Version diffs */
.diff-block { white-space: pre; }
.diff-block .diff-add { background: var(--af-success-wash); color: var(--af-success-ink); display: block; }
.diff-block .diff-del { background: var(--af-danger-wash); color: var(--af-danger-ink); display: block; }
.diff-block .diff-hunk { color: var(--af-ink-soft); display: block; }
.diff-block .diff-same { display: block; }
.diff-fields .diff-old { color: var(--af-danger-ink); text-decoration: line-through; }
.diff-fields .diff-new { color: var(--af-success-ink); font-weight: 600; }
.run-params-used { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.run-params-used code { font-size: .75rem; background: var(--af-inset); border: 1px solid var(--af-line-soft); border-radius: 5px; padding: 0 .35rem; }
/* Launchpad */
.launch-heading { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--af-ink-soft); margin: 1rem 0 .5rem; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .75rem; }
.launch-card { background: var(--af-card); border: 1px solid var(--af-line); border-radius: var(--af-radius); box-shadow: var(--af-shadow); padding: .85rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.launch-card.is-bad { border-color: var(--af-danger-edge); }
.launch-card h3 { font-size: .98rem; font-weight: 650; margin: 0; }
.launch-card p { font-size: .82rem; color: var(--af-ink-soft); margin: 0; }
.launch-last { font-size: .76rem; color: var(--af-ink-soft); margin-top: auto; }
.launch-actions { display: flex; align-items: center; gap: .25rem; }

/* Runs on several hosts: one chip per host. */
.host-results { display: flex; flex-wrap: wrap; gap: .25rem .4rem; align-items: center; margin-bottom: .5rem; }
.host-result { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--cui-border-color); }
.host-result.is-ok { color: var(--cui-success-text-emphasis); background: var(--cui-success-bg-subtle); border-color: var(--cui-success-border-subtle); }
.host-result.is-bad { color: var(--cui-danger-text-emphasis); background: var(--cui-danger-bg-subtle); border-color: var(--cui-danger-border-subtle); font-weight: 600; }
.host-result code { color: inherit; }

/* Maintenance */
.maint-note { white-space: pre-line; }
.badge-maint { background: var(--cui-warning-bg-subtle); color: var(--cui-warning-text-emphasis); border: 1px solid var(--cui-warning-border-subtle); }

/* Docker: the mode choice, the host picker, the pre-flight checks */
.docker-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.docker-mode { display: flex; gap: .4rem; align-items: flex-start; padding: .35rem .5rem; border: 1px solid var(--cui-border-color); border-radius: var(--af-radius-xs); cursor: pointer; }
.docker-mode:has(input:checked) { border-color: var(--cui-primary); background: var(--cui-primary-bg-subtle); }
.docker-mode span { display: flex; flex-direction: column; line-height: 1.2; }
.docker-mode small { color: var(--cui-secondary-color); font-size: .75rem; }
.docker-fields { margin-top: .5rem; }
.docker-picker { border: 1px dashed var(--cui-border-color); border-radius: var(--af-radius-xs); padding: .5rem; max-height: 18rem; overflow: auto; }
.docker-stack summary { cursor: pointer; padding: .15rem 0; }
.docker-items { list-style: none; margin: 0 0 .25rem; padding-left: .75rem; }
.docker-item { display: flex; align-items: center; gap: .4rem; width: 100%; text-align: start; border: 0; background: none; padding: .15rem .35rem; border-radius: .25rem; }
.docker-item:hover:not(:disabled), .docker-item.is-chosen { background: var(--cui-primary-bg-subtle); }
.docker-item:disabled { opacity: .55; }
.docker-item .dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; background: var(--cui-secondary-color); }
.docker-item .dot.is-up { background: var(--cui-success); }
.docker-checks { list-style: none; padding: 0; margin: 0 0 .5rem; font-size: .8125rem; }
.docker-checks li { padding: .1rem 0; }
.docker-checks .is-ok i { color: var(--cui-success); }
.docker-checks .is-warn i { color: var(--cui-warning); }
.docker-checks .is-fail i { color: var(--cui-danger); }
.docker-fix { margin-left: 1.25rem; color: var(--cui-body-color); font-family: var(--cui-font-monospace); font-size: .75rem; }
.docker-stack-row { padding: .2rem 0; border-bottom: 1px solid var(--cui-border-color-translucent); }

/* Send to CSM */
.csm-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.csm-panel { min-width: min(34rem, 100%); }
.csm-head { display: grid; grid-template-columns: auto 1fr; gap: .1rem .75rem; margin-bottom: .5rem; }
.csm-head dt { color: var(--cui-secondary-color); font-weight: 500; }
.csm-head dd { margin: 0; }

/* Host health */
.health { display: inline-flex; align-items: center; gap: .25rem; font-size: .8125rem; font-weight: 500; }
.health.is-ok { color: var(--cui-success-text-emphasis); }
.health.is-unreachable, .health.is-failing { color: var(--cui-danger-text-emphasis); font-weight: 600; }
.health.is-maintenance { color: var(--cui-warning-text-emphasis); }
.health.is-unknown { color: var(--cui-secondary-color); }
.health-strip { display: flex; gap: 2px; margin: .25rem 0; }
.health-strip a { width: .55rem; height: .9rem; border-radius: 2px; background: var(--cui-success); }
.health-strip a.is-bad { background: var(--cui-danger); }
.health-strip a.is-unreached { background: repeating-linear-gradient(45deg, var(--cui-danger), var(--cui-danger) 2px, transparent 2px, transparent 4px); border: 1px solid var(--cui-danger); }

/* Trends (job page): plain SVG bar charts */
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.25rem; }
.trend { margin: 0; }
.trend-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .8125rem; margin-bottom: .25rem; }
.trend svg { display: block; width: 100%; height: 90px; background: var(--cui-tertiary-bg); border-radius: .25rem; }
.trend .bar.is-ok { fill: var(--af-success-ink); opacity: .85; }
.trend .bar.is-bad { fill: var(--af-danger-ink); }
.trend .bar.is-other { fill: var(--cui-secondary-color); opacity: .6; }
.trend .bar.is-warn { fill: var(--af-warning-mark); }
.trend a:hover .bar { opacity: 1; stroke: var(--cui-body-color); stroke-width: .5; }
.trend-plot { display: grid; grid-template-columns: 4.25rem 1fr; }
.trend-scale { position: relative; height: 90px; font-size: .6875rem; color: var(--cui-secondary-color); }
.trend-scale span { position: absolute; right: .4rem; transform: translateY(-50%); white-space: nowrap; line-height: 1; font-variant-numeric: tabular-nums; }
.trend-scale span:first-child { transform: none; }  /* the top label sits inside the box */
.trend-scale .is-average { color: var(--af-info-ink); font-weight: 600; }
.trend-scale .is-max { color: var(--cui-body-color); font-weight: 600; }
.trend .guide { stroke-width: 1; }
.trend .guide { pointer-events: none; }
.trend .guide.is-grid { stroke: var(--cui-body-color); opacity: .3; }
.trend .guide.is-max { stroke: var(--cui-body-color); opacity: .45; }
.trend .guide.is-average { stroke: var(--af-info-ink); stroke-dasharray: 6 3; }
.trend .guide.is-median { stroke: var(--cui-body-color); stroke-dasharray: 2 3; opacity: .7; }
.trend-key { display: inline-flex; gap: .75rem; }
.trend-key-line { display: inline-block; width: 1rem; vertical-align: middle; border-top: 1px dashed var(--cui-body-color); }
.trend-key-line.is-average { border-top: 2px dashed var(--af-info-ink); }
.trend-key-line.is-median { border-top-style: dotted; }
.trend-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--cui-secondary-color); padding-left: 4.25rem; }

/* Schedule: timeline (Gantt) and the upcoming calendar */
.gantt { padding: .5rem .75rem .75rem; }
.gantt-row { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; align-items: center; gap: .75rem; min-height: 1.6rem; }
.gantt-row + .gantt-row { border-top: 1px solid var(--cui-border-color-translucent); }
.gantt-name { font-size: .8125rem; }
.gantt-track { position: relative; height: 1.1rem; }
.gantt-axis .gantt-track { height: 1.2rem; }
.gantt-tick { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--cui-secondary-color); white-space: nowrap; }
.gantt-grid { position: absolute; top: -.25rem; bottom: -.25rem; border-left: 1px dashed var(--cui-border-color); }
.gantt-bar { position: absolute; top: .15rem; bottom: .15rem; min-width: 3px; border-radius: 2px; background: var(--af-success-ink); opacity: .85; }
.gantt-bar:hover { opacity: 1; outline: 1px solid var(--cui-body-color); z-index: 1; }
.gantt-bar.is-failed, .gantt-bar.is-timed_out, .gantt-bar.is-lost { background: var(--af-danger-ink); }
.gantt-bar.is-running, .gantt-bar.is-waiting { background: var(--cui-primary); animation: keel-pulse 1.2s ease-in-out infinite; }
.gantt-bar.is-cancelled, .gantt-bar.is-skipped { background: var(--af-warning-mark); }
.cal-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-bottom: .75rem; }
.cal-hour { position: relative; height: 1.4rem; border-radius: 2px; background: color-mix(in srgb, var(--cui-primary) calc(var(--n) * 85%), var(--cui-tertiary-bg)); }
.cal-hour em { position: absolute; top: 100%; left: 0; font-style: normal; font-size: .65rem; color: var(--cui-secondary-color); }
.cal-due { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .2rem; font-size: .875rem; }
.cal-due li { display: grid; grid-template-columns: minmax(5rem, max-content) auto 1fr; gap: .5rem; align-items: baseline; }
.cal-time { font-variant-numeric: tabular-nums; max-width: 40rem; }
/* Schedule › Load: jobs running per bucket (one hue, height = runs at once), per-host
   heat rows on one scale, and a lane per job; off hours shaded, quiet windows gold. One
   grid, so the chart, the hosts and the lanes share the time axis; it scrolls sideways
   inside its card on a phone (never the page). */
.load-scroll { overflow-x: auto; position: relative; }
.load-grid { --load-names: 13rem; display: grid; grid-template-columns: var(--load-names) minmax(0, 1fr); column-gap: .75rem; align-items: center; padding: .75rem .75rem .5rem; min-width: calc(var(--load-names) + 1.5rem + var(--n) * var(--load-col, 6px)); }
.load-grid.is-dense { --load-col: 3px; }
.load-label { font-size: .8125rem; min-width: 0; }
.load-scale { align-self: stretch; text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: .6875rem; color: var(--af-ink-faint); font-variant-numeric: tabular-nums; }
.load-chart { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); height: 7.5rem; border-bottom: 1px solid var(--af-line); }
.load-col { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; padding: 0 1px; }
.load-grid.is-dense .load-col { padding: 0; }
.load-grid.is-dense .load-col i { border-radius: 0; }
.load-col.is-off { background: var(--af-canvas-deep); }
.load-col.is-quiet { background: var(--af-accent-wash); box-shadow: inset 0 -3px 0 var(--af-accent); }
.load-col i { display: block; width: 100%; max-width: 24px; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--af-chart-mark); }
.load-col:hover { outline: 1px solid var(--af-line-strong); outline-offset: -1px; }
.load-col:hover i { background: var(--af-link-hover); }
.load-now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--af-ink-soft); pointer-events: none; }
.load-axis { height: 1.2rem; margin-top: .15rem; }
.load-section { margin-top: .75rem; padding-bottom: .2rem; border-bottom: 1px solid var(--af-line-soft); font-weight: 600; align-self: stretch; }
.load-heat { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1px; height: 1rem; }
.load-heat span { border-radius: 1px; background: color-mix(in srgb, var(--af-chart-mark) calc(var(--v) * 85%), var(--af-inset)); }
.load-heat span:hover { outline: 1px solid var(--af-ink-soft); }
.load-lane { height: 1.9rem; border-bottom: 1px solid var(--cui-border-color-translucent); }
.load-band { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.load-band.is-off { background: var(--af-canvas-deep); }
.load-band.is-quiet { background: var(--af-accent-wash); }
.load-bar { position: absolute; top: .45rem; bottom: .45rem; min-width: 2px; border-radius: 2px; background: var(--af-chart-mark); }
.load-bar.is-estimated { background: color-mix(in srgb, var(--af-chart-mark) 45%, var(--af-card)); }
.load-bar:hover { background: var(--af-link-hover); }
.load-key { display: inline-block; width: .75rem; height: .6rem; border-radius: 2px; }
.load-key.is-running { background: var(--af-chart-mark); }
.load-key.is-estimated { background: color-mix(in srgb, var(--af-chart-mark) 45%, var(--af-card)); }
.load-key.is-off { background: var(--af-canvas-deep); border: 1px solid var(--af-line); }
.load-key.is-quiet { background: var(--af-accent-wash); box-shadow: inset 0 -3px 0 var(--af-accent); }
.load-quiet td { font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .load-grid { --load-names: 7.5rem; }
}
@media (forced-colors: active) { .load-col i, .load-bar { background: CanvasText; } .load-col.is-quiet, .load-band.is-quiet { background: Highlight; }
}

/* Run history: the matching output line under a run */
.output-snippet { font-family: var(--cui-font-monospace); font-size: .75rem; color: var(--cui-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 36rem; }

/* Draining banner and the sidebar's "update available" */
.drain-banner { background: var(--cui-warning-bg-subtle); color: var(--cui-warning-text-emphasis); border-bottom: 1px solid var(--cui-warning-border-subtle); padding: .5rem 1.25rem; font-size: .875rem; }

/* Job form: one host or a host group, and how a group runs */
.aim-choice { display: inline-flex; border: 1px solid var(--cui-border-color); border-radius: var(--af-radius-xs); overflow: hidden; }
.aim-option { margin: 0; cursor: pointer; }
.aim-option input { position: absolute; opacity: 0; }
.aim-option span { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; font-size: .875rem; }
.aim-option + .aim-option span { border-left: 1px solid var(--cui-border-color); }
.aim-option:has(input:checked) span { background: var(--cui-primary); color: #fff; }
.aim-option:has(input:focus-visible) span { outline: 2px solid var(--cui-primary); outline-offset: -2px; }
.host-modes { display: grid; gap: .35rem; }
.host-mode { display: flex; gap: .5rem; align-items: flex-start; padding: .4rem .6rem; border: 1px solid var(--cui-border-color); border-radius: var(--af-radius-xs); cursor: pointer; margin: 0; }
.host-mode:has(input:checked) { border-color: var(--cui-primary); background: var(--cui-primary-bg-subtle); }
.host-mode span { display: flex; flex-direction: column; line-height: 1.25; }
.host-mode small { color: var(--cui-secondary-color); font-size: .75rem; }

/* Host groups: a host as a chip coloured by its health */
.hostchip { display: inline-block; margin: 0 .25rem .25rem 0; padding: .05rem .5rem; border-radius: 999px; font-size: .8125rem; border: 1px solid var(--cui-border-color); text-decoration: none; color: var(--cui-body-color); }
.hostchip.is-ok { border-color: var(--cui-success-border-subtle); background: var(--cui-success-bg-subtle); }
.hostchip.is-unreachable, .hostchip.is-failing { border-color: var(--cui-danger-border-subtle); background: var(--cui-danger-bg-subtle); }
.hostchip.is-maintenance { border-color: var(--cui-warning-border-subtle); background: var(--cui-warning-bg-subtle); }
.hostchip.is-off { opacity: .55; text-decoration: line-through; }
.group-checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.where-text { max-width: 14rem; }

/* A run's CPU and memory over its lifetime */
.run-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.usage-chart svg { height: 70px; }
.usage-chart .line { fill: none; stroke-width: 1.5; }
.usage-chart.is-cpu .line { stroke: var(--cui-primary); }
.usage-chart.is-cpu .area { fill: var(--cui-primary); opacity: .15; }
.usage-chart.is-mem .line { stroke: var(--cui-info); }
.usage-chart.is-mem .area { fill: var(--cui-info); opacity: .15; }

/* The job editor: a sticky bar with what matters at a glance (name, schedule switch, where
   and when, Save), then the sections, a list on the left and the chosen one on the right
   (app.js [data-panels]); on a phone the list is a sideways strip. Without JS the
   sections stack. */
.job-keybar { position: sticky; top: 3.5rem; z-index: 1010; margin-bottom: 1rem; padding: .75rem 1rem .6rem; box-shadow: var(--af-shadow), 0 10px 24px -20px rgba(31, 41, 51, .5); }
.job-keybar-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; }
.job-keybar-name { flex: 1 1 22rem; min-width: 0; }
.job-keybar-name .form-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--af-ink-soft); margin-bottom: .15rem; }
.job-keybar-name .form-control { font-size: 1.1rem; font-weight: 600; }
.job-keybar-enabled { margin: 0 0 .45rem; white-space: nowrap; }
.job-keybar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; padding-bottom: .1rem; }
.job-keybar .unsaved-chip { display: none; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 600; white-space: nowrap; margin-right: .25rem; }
.job-form.is-dirty .job-keybar { border-color: var(--af-navy-soft); }
.job-form.is-dirty .job-keybar .unsaved-chip { display: inline-flex; }
.job-facts { display: flex; flex-wrap: wrap; gap: .35rem 1.75rem; margin: .65rem 0 0; padding-top: .55rem; border-top: 1px solid var(--af-line-soft); font-size: .85rem; }
.job-facts > div { display: flex; align-items: baseline; gap: .45rem; min-width: 0; }
.job-facts dt { font-weight: 500; color: var(--af-ink-soft); white-space: nowrap; font-size: .78rem; }
.job-facts dd { margin: 0; min-width: 0; }
.job-facts a { color: var(--af-ink); font-weight: 600; text-decoration: none; }
.job-facts a:hover { color: var(--af-link); text-decoration: underline; }
.job-facts a.is-muted { color: var(--af-ink-soft); font-weight: 500; }@media (max-width: 991.98px) {
  .job-keybar { position: static; }
}

/* Jira (run view bar, run history key, the window). */
.jira-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; min-width: 0; }
.jira-bar .text-truncate { max-width: 32rem; }
.jira-key { display: inline-block; margin-left: .25rem; padding: 0 .35rem; border-radius: 4px; font-size: .72rem; font-weight: 600; color: var(--af-info-ink); background: var(--af-info-wash); border: 1px solid var(--af-info-edge); text-decoration: none; vertical-align: middle; }
.jira-key:hover { text-decoration: underline; }
.jira-linked { padding: .5rem .75rem; background: var(--af-inset); border: 1px solid var(--af-line-soft); border-radius: var(--af-radius-sm); }

/* Unusual run time (core.durations): a slow run in amber, a fast one in blue. */
.time-flag { display: inline-flex; align-items: center; gap: .2rem; margin-left: .25rem; padding: 0 .35rem; border-radius: 999px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.time-flag.is-slow { color: var(--af-warning-ink); background: var(--af-warning-wash); border: 1px solid var(--af-warning-edge); }
.time-flag.is-fast { color: var(--af-info-ink); background: var(--af-info-wash); border: 1px solid var(--af-info-edge); }
/* The schedule preview's warning: scheduled runs meet a maintenance window (core.windows). */
.window-warning { padding: .5rem .65rem; border-radius: var(--af-radius-sm); color: var(--af-warning-ink); background: var(--af-warning-wash); border: 1px solid var(--af-warning-edge); }
/* Ran into a maintenance window of its hosts (core.windows): not normal, not bad. */
.time-flag.is-window { color: var(--af-warning-ink); background: var(--af-warning-wash); border: 1px solid var(--af-warning-edge); text-transform: none; letter-spacing: 0; }
.trend rect.bar.flag-slow { stroke: var(--af-slow-mark); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.trend rect.bar.flag-fast { stroke: var(--af-info-ink); stroke-width: 2px; vector-effect: non-scaling-stroke; }

/* Comparing two runs' output (runs/compare.html): a unified diff, older run's lines in
   red, newer run's in green, unchanged context in between and folded gaps. */
.compare-bar { align-items: center; }
.compare-heads { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.compare-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .8rem; background: var(--af-card); border: 1px solid var(--af-line); border-radius: var(--af-radius-sm); color: var(--af-ink); text-decoration: none; }
.compare-head:hover { border-color: var(--af-navy-soft); }
.compare-head.is-older { border-left: 4px solid var(--af-danger-edge); }
.compare-head.is-newer { border-left: 4px solid var(--af-success-edge); }
.compare-side { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--af-ink-soft); }
.diff-count { font-weight: 700; font-family: var(--cui-font-monospace, monospace); }
.diff-count.is-add { color: var(--af-success-ink); }
.diff-count.is-del { color: var(--af-danger-ink); }
.diff { font-family: var(--cui-font-monospace, ui-monospace, monospace); font-size: .8rem; line-height: 1.45; overflow-x: auto; }
.diff-line { display: grid; grid-template-columns: 3.5rem 3.5rem 1.25rem minmax(0, 1fr); }
.diff-line > span { padding: 0 .35rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-no { color: var(--af-ink-faint); text-align: right; user-select: none; border-right: 1px solid var(--af-line-soft); }
.diff-mark { user-select: none; text-align: center; }
.diff-line.is-add { background: var(--af-success-wash); }
.diff-line.is-add .diff-mark { color: var(--af-success-ink); font-weight: 700; }
.diff-line.is-del { background: var(--af-danger-wash); }
.diff-line.is-del .diff-mark { color: var(--af-danger-ink); font-weight: 700; }
.diff-gap { padding: .2rem .75rem; color: var(--af-ink-soft); background: var(--af-inset); border-top: 1px solid var(--af-line-soft); border-bottom: 1px solid var(--af-line-soft); font-family: inherit; font-size: .75rem; }
@media (max-width: 575.98px) { .compare-heads { grid-template-columns: 1fr; } .diff-line { grid-template-columns: 2.5rem 2.5rem 1rem minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
  .run-strip.is-large { display: flex; width: 100%; max-width: 100%; }
  .run-strip.is-large .pip { flex: 1 1 0; width: auto; min-width: 2px; }
  .jobs-table .job-cell { min-width: 11rem; }
  .jobs-table .job-desc { display: none; }
  .jobs-table .col-minor { display: none; }
  .jobs-table td.col-customer { max-width: 7rem; }
  .bulk-bar { top: 3rem; }
}
.gantt-legend { display: inline-flex; flex-wrap: wrap; gap: .25rem .75rem; color: var(--af-ink-soft); }
.gantt-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.gantt-legend i { width: .75rem; height: .6rem; border-radius: 2px; display: inline-block; }
.gantt-legend i.is-succeeded { background: var(--af-success-ink); }
.gantt-legend i.is-failed { background: var(--af-danger-ink); }
.gantt-legend i.is-skipped { background: var(--af-warning-mark); }
.gantt-legend i.is-running { background: var(--cui-primary); }
.review-chip { display: inline-block; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--af-danger-ink); background: var(--af-danger-wash); border: 1px solid var(--af-danger-edge); vertical-align: middle; }
.activity-times { font-size: .72rem; font-weight: 700; color: var(--af-ink-soft); }
/* A day heading inside a list of runs (Today is not shown when the list starts with it). */
.day-row th { padding: .45rem .75rem .3rem; background: var(--af-canvas-deep); color: var(--af-ink-soft); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--af-line); }
.ask { display: flex; flex-direction: column; height: 100%; min-height: 20rem; gap: .6rem; }
.ask-page .ask { min-height: calc(100vh - 16rem); }
.ask-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; padding: .25rem .1rem; overscroll-behavior: contain; }
.ask-row { display: flex; align-items: flex-end; gap: .5rem; max-width: 92%; }
.ask-row.is-user { align-self: flex-end; flex-direction: row-reverse; max-width: 75%; }
.ask-mark { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--af-canvas-deep); color: var(--af-ink-soft); }
.ask-row.is-user .ask-mark { background: var(--af-navy-fill); color: #fff; }
.ask-bubble { padding: .55rem .8rem; border: 1px solid var(--af-line); border-radius: 1rem; border-bottom-left-radius: .3rem; background: var(--af-card); line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.ask-row.is-user .ask-bubble { background: var(--af-navy-fill); color: #fff; border-color: var(--af-navy-fill); border-radius: 1rem; border-bottom-right-radius: .3rem; white-space: pre-wrap; }
.ask-bubble.is-error { border-color: var(--af-danger-edge); background: var(--af-danger-wash); color: var(--af-danger-ink); }
.ask-bubble p { margin: 0 0 .5rem; } .ask-bubble p:last-child { margin-bottom: 0; }
.ask-bubble ul, .ask-bubble ol { margin: 0 0 .5rem; padding-left: 1.2rem; }
.ask-bubble table { width: 100%; font-size: .88rem; margin: .25rem 0 .5rem; display: block; overflow-x: auto; }
.ask-bubble th, .ask-bubble td { padding: .2rem .5rem; border-bottom: 1px solid var(--af-line-soft); }
.ask-bubble th { text-align: left; font-weight: 600; border-bottom-color: var(--af-line); white-space: nowrap; }
.ask-bubble table { border-collapse: collapse; }
.ask-bubble code { background: var(--af-inset); color: var(--af-ink); padding: 0 .2rem; border-radius: .2rem; }
.ask-dots { display: inline-flex; gap: .25rem; }
.ask-dots i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--af-ink-faint); animation: ask-breathe 1.2s infinite ease-in-out; }
.ask-dots i:nth-child(2) { animation-delay: .15s; } .ask-dots i:nth-child(3) { animation-delay: .3s; }
.ask-suggestions { display: flex; flex-wrap: wrap; gap: .4rem; padding-left: 2.4rem; }
.ask-chip { border: 1px solid var(--af-line); background: var(--af-card); color: var(--af-ink-soft); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; }
.ask-chip:hover { border-color: var(--af-navy-fill); color: var(--af-ink); }
.ask-composer { display: flex; align-items: flex-end; gap: .5rem; border: 1px solid var(--af-line); border-radius: 1.3rem; padding: .35rem .35rem .35rem .9rem; background: var(--af-card); box-shadow: var(--af-shadow); }
.ask-input { flex: 1; border: 0; resize: none; outline: none; background: transparent; max-height: 200px; padding: .35rem 0; line-height: 1.4; }
.ask-send { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 0; background: var(--af-navy-fill); color: #fff; }
.ask-send:disabled { opacity: .5; }
.ask-foot { display: flex; justify-content: space-between; align-items: center; }
.ask-off { padding: 1rem; }
.activity-list li.is-chosen { background: var(--af-info-wash); box-shadow: inset 3px 0 0 var(--af-navy); padding-left: .5rem; }

/* A run's Cancel and Run again forms are .d-inline, which would beat [hidden]. */
.run-actions form[hidden] { display: none !important; }

/* Touch targets: small marks (run-strip squares, health-strip ticks, timeline bars) keep
   their look but take a press 24 px tall, through an invisible extension. */
.run-strip .pip, .health-strip a, .gantt-bar { position: relative; }
.gantt-bar { position: absolute; }
.run-strip .pip::after, .health-strip a::after, .gantt-bar::after { content: ""; position: absolute; inset: -5px -1px; }

/* ---------------------------------------------------------------- Demo Sites */
.demo-sites .demo-comment { min-width: 16rem; max-width: 32rem; }
.demo-sites tr.is-running > td { background: var(--cui-warning-bg-subtle); }
.demo-groups { max-height: 16rem; overflow-y: auto; }
.demo-by-inline { display: none; }
/* On a phone each site (and each rebuild in History) is a card: its name, then short
   labelled lines (the comment; when, how long ago and by whom; the result), then its
   buttons, full width, so nothing scrolls sideways (sales rebuild from their phones). */
@media (max-width: 767.98px) {
  .demo-cards thead, .demo-cards td.demo-by { display: none; }
  .demo-cards, .demo-cards tbody, .demo-cards tr { display: block; width: 100%; }
  .demo-cards tr { padding: .7rem 1rem; border-bottom: 1px solid var(--af-line); }
  .demo-cards tr:last-child { border-bottom: 0; }
  .demo-cards tr.is-running { background: var(--cui-warning-bg-subtle); }
  .demo-cards td { display: block; border: 0; padding: .1rem 0; white-space: normal !important; text-align: start !important; background: transparent; }
  .demo-cards td.is-empty { display: none; }
  .demo-cards td[data-label]:not(.is-empty, .demo-by) { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); align-items: baseline; }
  .demo-cards td[data-label]::before { content: attr(data-label); white-space: nowrap; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--cui-secondary-color); }
  .demo-cards .demo-by-inline { display: inline; }
  .demo-cards .demo-comment .edit-link { padding: 0 .4rem; }
  .demo-cards .demo-site { font-size: 1.05rem; padding-bottom: .25rem; }
  .demo-cards .demo-comment { min-width: 0; max-width: none; }
  .demo-cards .demo-actions { display: flex; gap: .5rem; padding-top: .55rem; }
  .demo-cards .demo-actions .btn { padding: .45rem .9rem; font-size: .95rem; }
  .demo-cards .demo-actions .btn-primary, .demo-cards .demo-actions .btn-outline-primary { flex: 1; }
  .demo-rebuild-form .btn-primary { width: 100%; padding: .55rem 1rem; font-size: 1rem; }
}

