.job-dialog {
  width: min(600px, calc(100% - 24px));
  overflow: hidden;
}

.job-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
}

.job-dialog .dialog-head, .job-dialog .dialog-footer { flex: 0 0 auto; }
.job-dialog .dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
.job-dialog .dialog-head .icon-button { flex: 0 0 auto; }
.job-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.job-field-pair > .field { min-width: 0; }
.job-assignee-field {
  min-width: 0;
  margin: 0;
  padding: 7px 10px 10px;
  border: 1px solid var(--line);
  background: #f8fafd;
}
.job-assignee-field legend { max-width: 100%; padding-inline: 4px; font-size: 13px; font-weight: 700; }
.job-assignee-count, .job-assignee-empty { margin: 0; padding-block: 3px; }
.job-assignee-search {
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #bac9da;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
.job-assignee-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  max-height: min(220px, 30dvh);
  overflow-y: auto;
  padding-inline: 3px;
}
.job-assignee-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  padding: 5px 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.job-assignee-option:has(:checked) { background: #eaf2fb; }
.job-assignee-option input { flex: 0 0 17px; width: 17px; height: 17px; margin: 0; accent-color: var(--steel); }
.job-date-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.job-date-control input, .job-date-control .icon-button { min-height: 42px; }
.job-date-control .icon-button { border-left: 0; width: 40px; min-width: 40px; }
.job-date-control .icon-button[aria-expanded="true"] { background: #eaf2fb; color: #244d75; }
.job-date-control :focus-visible { position: relative; z-index: 2; }

.job-date-icon {
  position: relative;
  width: 17px;
  height: 16px;
  border: 1.5px solid currentColor;
}

.job-date-icon::before, .job-date-icon::after { position: absolute; left: 0; right: 0; content: ""; }
.job-date-icon::before { top: 3px; border-top: 1.5px solid currentColor; }
.job-date-icon::after { top: -3px; height: 3px; inset-inline: 3px; border-inline: 1.5px solid currentColor; }

.job-date-picker {
  min-width: 0;
  border: 1px solid var(--line);
  padding: 9px 10px 11px;
  background: #f8fafd;
}

.job-picker-top, .job-picker-month { display: flex; align-items: center; gap: 8px; }
.job-picker-top { justify-content: space-between; font-size: 13px; }
.job-picker-month { justify-content: center; margin: 4px 0 5px; }
.job-picker-month p { min-width: 130px; text-align: center; font-size: 14px; font-weight: 750; }
.job-picker-month p::first-letter { text-transform: uppercase; }
.job-date-picker .icon-button { min-height: 32px; min-width: 33px; }

.job-picker-days .job-picker-day {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.job-picker-day:not(:disabled):hover { background: #f0f6fc; }
.job-picker-days .job-picker-day.other-month { background: #f8fafd; color: #66788e; }
.job-picker-days .job-picker-day[aria-current="date"] { border-color: #597fa6; }
.job-picker-days .job-picker-day[aria-pressed="true"] { background: #eaf2fb; box-shadow: inset 0 0 0 1px #597fa6; }
.job-picker-days .job-picker-day:disabled { opacity: .55; cursor: not-allowed; }
.job-picker-day:focus-visible { outline-offset: -3px; }

.job-notes { min-width: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.job-notes-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 13px; }
.job-notes-head h3 { font-size: 16px; margin: 0; letter-spacing: -.015em; }
.job-note-list { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.job-note-list details { min-width: 0; border: 1px solid var(--line); background: #fafbfd; }
.job-note-list summary {
  cursor: pointer;
  padding: 7px 9px;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}
.job-note-list details p { margin: 1px 9px 9px; color: var(--muted); white-space: pre-wrap; font-size: 13px; }
.job-note-list details button { min-height: 34px; margin: 0 9px 9px; padding: 4px 7px; font-size: 12px; }
.job-note-editor { display: grid; gap: 9px; margin-top: 9px; padding: 10px; border: 1px solid var(--line); background: #f8fafd; }
.job-note-editor textarea {
  width: 100%;
  min-height: 75px;
  resize: vertical;
  padding: 7px 9px;
  border: 1px solid #bac9da;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.job-note-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.job-note-actions .button, .job-notes-head .button { min-height: 35px; padding: 6px 9px; font-size: 13px; }

@media (max-width: 470px) {
  .job-dialog .dialog-head, .job-dialog .dialog-footer { padding-inline: 12px; }
  .job-dialog-body { gap: 12px; padding-inline: 12px; }
  .job-field-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .job-date-control input { padding-inline: 5px; }
  .job-dialog .dialog-head .icon-button, .job-date-control .icon-button { min-width: 44px; min-height: 44px; }
  .job-date-picker { padding-inline: 6px; }
  .job-assignee-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .job-field-pair:has(.job-date-control) { grid-template-columns: minmax(0, 1fr); }
}
