/* Running jobs only, shared by the desktop and mobile header. */
.header-active-job {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  width: auto;
  height: 44px;
  padding: 0 7px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--action-radius);
  corner-shape: var(--corner-curve);
  color: var(--muted, #666);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
}
.header-active-job[hidden], .header-active-job--mobile { display: none; }
.header-active-job:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.header-active-job:active { background: color-mix(in srgb, currentColor 9%, transparent); }
.header-active-job__spinner { position: relative; display: block; width: 20px; height: 20px; flex: 0 0 20px; }
.header-active-job__spinner i {
  position: absolute; top: 0; left: 9px; display: block; width: 2px; height: 6px;
  border-radius: var(--corner-handle); background: currentColor;
  transform-origin: 1px 10px; transform: rotate(calc(var(--tick) * 45deg));
  opacity: .25; animation: header-job-tick 1s linear infinite;
  animation-delay: calc(var(--tick) * .125s - 1s);
}
@keyframes header-job-tick { 0% { opacity: 1; } 100% { opacity: .25; } }
.header-job-panel {
  position: fixed; z-index: 120; top: 72px; right: clamp(12px, 3.5vw, 50px);
  width: min(390px, calc(100% - 24px)); max-height: min(650px, calc(100dvh - 84px));
  overflow: auto; overscroll-behavior: contain; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-panel); corner-shape: var(--corner-curve);
  background: var(--surface-raised); color: var(--text);
  box-shadow: 0 18px 54px rgb(0 0 0 / .16);
}
.header-job-panel[hidden], .header-job-toast[hidden] { display: none; }
.header-job-panel__close, .header-job-toast button {
  min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer;
}
.header-job-panel__close { position: absolute; top: 8px; right: 8px; font-size: 23px; }
.header-job-panel__section { margin-top: 14px; }
.header-job-panel__section:first-of-type { margin-top: 0; }
.header-job-panel__section h3 { margin: 0 0 6px; color: var(--muted); font: 600 12px/1.4 var(--font-ui); }
.header-job-panel__section:first-of-type h3 { display: flex; align-items: center; min-height: 28px; padding-right: 40px; }
.header-job-panel__list { margin: 0; padding: 0; list-style: none; }
.header-job-panel__item + .header-job-panel__item { border-top: 1px solid var(--line); }
.header-job-panel__link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
  min-height: 56px; padding: 8px 4px; color: inherit; text-decoration: none;
}
.header-job-panel__link:hover { background: color-mix(in srgb, currentColor 5%, transparent); }
.header-job-panel__name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 13px/1.3 var(--font-ui); }
.header-job-panel__meta { grid-row: 2; min-width: 0; color: var(--muted); font: 400 11px/1.3 var(--font-ui); }
.header-job-panel__status { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); font: 600 11px/1.3 var(--font-ui); }
.header-job-toast {
  position: fixed; z-index: 121; right: clamp(12px, 3.5vw, 50px); bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; width: min(400px, calc(100vw - 24px));
  min-height: 56px; padding: 7px 8px 7px 18px; border: 1px solid var(--line); border-radius: var(--radius-panel); corner-shape: var(--corner-curve);
  background: var(--surface-raised); color: var(--text); box-shadow: 0 14px 44px rgb(0 0 0 / .16);
  font: 500 13px/1.4 var(--font-ui);
}
.header-job-toast > span { flex: 1; min-width: 0; }
.header-job-toast a { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; color: inherit; font-weight: 700; }
.header-job-toast button { flex: 0 0 44px; font-size: 20px; }
@media (hover: hover) and (pointer: fine) {
  .header-active-job:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
}
@media (max-width: 959px) {
  .header-active-job--mobile:not([hidden]) { display: inline-flex; }
  .site-header:has(.header-active-job--mobile:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  /* A block text box is required for ellipsis: inline-flex clips its anonymous
     flex child instead. The existing full home-link aria-label is unchanged. */
  .site-header:has(.header-active-job--mobile:not([hidden])) .brand {
    display: block; width: 100%; min-width: 0; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}
@media (max-width: 600px) {
  .header-job-panel { top: 70px; right: 12px; max-height: calc(100dvh - 82px); border-radius: var(--radius-panel-mobile); }
  .header-job-toast { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .header-active-job__spinner i { animation: none; opacity: .7; } }
@media (forced-colors: active) { .header-active-job { color: LinkText; } .header-job-panel, .header-job-toast { border-color: CanvasText; background: Canvas; color: CanvasText; } }
