.follow-ups {
  --follow-up-ink: #17324d;
  --follow-up-muted: #58708a;
  --follow-up-line: #c9d9e8;
  --follow-up-blue: #1769aa;
  --follow-up-blue-soft: #eef7ff;
  color: var(--follow-up-ink);
  display: grid;
  gap: 16px;
  min-width: 0;
}

.follow-ups button,
.follow-ups select,
.follow-ups input,
.follow-ups textarea { font: inherit; }

.follow-ups button {
  min-height: 44px;
  border: 1px solid #9ebbd4;
  border-radius: 8px;
  background: #fff;
  color: #12456e;
  cursor: pointer;
  padding: 8px 13px;
}

.follow-ups button:hover:not(:disabled),
.follow-ups button:focus-visible {
  border-color: var(--follow-up-blue);
  background: var(--follow-up-blue-soft);
  outline: 3px solid rgba(23, 105, 170, .24);
  outline-offset: 1px;
}

.follow-ups button:disabled { cursor: not-allowed; opacity: .55; }
.follow-ups button.follow-up-delete { border-color: #b83a32; color: #97231d; }
.follow-ups button.follow-up-delete:hover:not(:disabled),
.follow-ups button.follow-up-delete:focus-visible { background: #fff2f1; border-color: #97231d; outline-color: rgba(151, 35, 29, .24); }
.record-delete-button.el-button {
  --el-button-bg-color: #9c2621;
  --el-button-border-color: #9c2621;
  --el-button-hover-bg-color: #7f1d1d;
  --el-button-hover-border-color: #7f1d1d;
  --el-button-active-bg-color: #6d1717;
  --el-button-active-border-color: #6d1717;
  --el-button-text-color: #fff;
  color: #fff;
}
.record-delete-button.el-button:focus-visible { outline: 3px solid #7f1d1d; outline-offset: 2px; }
.follow-ups.is-form-only > .follow-up-resource-links,
.follow-ups.is-form-only > .follow-up-subject-link,
.follow-ups.is-form-only > .follow-up-timeline,
.follow-ups.is-form-only > .follow-up-pager,
.follow-ups.is-form-only > .follow-ups-summary { display: none; }
.follow-ups.is-form-only { gap: 10px; }

.follow-ups-heading,
.follow-up-form > header,
.follow-up-resource-links > header,
.follow-up-subject-link > header,
.follow-up-timeline article > header,
.follow-up-timeline article > footer,
.follow-up-pager {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.follow-ups-heading {
  background: linear-gradient(135deg, #f2faff, #fff);
  border: 1px solid #c7dfef;
  border-radius: 12px;
  padding: 18px;
}

.follow-ups-heading p,
.follow-ups-heading h3,
.follow-ups-heading span,
.follow-up-form h4,
.follow-up-form p,
.follow-up-resource-links h4,
.follow-up-resource-links p,
.follow-up-subject-link h4,
.follow-up-subject-link p { margin: 0; }

.follow-ups-heading p { color: #16629a; font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.follow-ups-heading h3 { font-size: 20px; line-height: 1.3; }
.follow-ups-heading span,
.follow-up-form header p,
.follow-up-resource-links header p,
.follow-up-subject-link header p { color: var(--follow-up-muted); display: block; font-size: 13px; margin-top: 5px; }
.follow-ups-heading-actions > button,
.follow-up-form footer button { background: var(--follow-up-blue); border-color: var(--follow-up-blue); color: #fff; font-weight: 700; }
.follow-ups-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.follow-ups-filters,
.follow-up-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.follow-up-filter-toggle { display: none; }

.follow-ups label {
  color: #244660;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 5px;
  min-width: 0;
}

.follow-ups input,
.follow-ups select,
.follow-ups textarea {
  background: #fff;
  border: 1px solid #aac3d8;
  border-radius: 7px;
  box-sizing: border-box;
  color: #17324d;
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

.follow-ups textarea { min-height: 82px; resize: vertical; }
.follow-ups input:focus,
.follow-ups select:focus,
.follow-ups textarea:focus { border-color: var(--follow-up-blue); outline: 3px solid rgba(23, 105, 170, .18); }
.follow-ups-search { grid-column: span 2; }
.follow-up-form-grid .span-2 { grid-column: span 2; }

.follow-ups-summary,
.follow-ups-state,
.follow-ups-notice,
.follow-ups-error,
.follow-up-selected,
.follow-up-resource-links,
.follow-up-subject-link,
.follow-up-form,
.follow-up-timeline article {
  border: 1px solid var(--follow-up-line);
  border-radius: 10px;
  padding: 14px;
}

.follow-ups-summary { align-items: baseline; background: #f6fbff; display: flex; flex-wrap: wrap; gap: 9px; }
.follow-ups-summary strong { color: #145888; }
.follow-ups-summary small { color: var(--follow-up-muted); }
.follow-ups-state { background: #f7fafc; color: #49637a; }
.follow-ups-notice { background: #edf9f1; border-color: #8fc9a4; color: #15623b; }
.follow-ups-error { background: #fff3f2; border-color: #ecaaa3; color: #9a291f; }
.follow-ups-error button { margin-left: 8px; }
.follow-up-plan-warning { color: #8b4f00; font-size: 13px; font-weight: 700; grid-column: span 2; margin: 0; }
.follow-up-legacy-warning { background: #fff8e8; border-left: 4px solid #b76d00; color: #704100; padding: 8px 10px; }
.follow-up-selected { background: #f4f9fd; color: #244660; }

.follow-up-form,
.follow-up-resource-links,
.follow-up-subject-link { background: #fff; display: grid; gap: 13px; }
.follow-up-form footer { display: flex; justify-content: flex-end; }
.follow-up-profile-update {
  background: #f7fbff;
  border: 1px solid #bfd8eb;
  border-radius: 9px;
  display: grid;
  gap: 10px;
  padding: 12px;
}
.follow-up-profile-update > button { justify-self: start; }
.follow-up-profile-hint,
.follow-up-profile-denied { color: var(--follow-up-muted); font-size: 13px; line-height: 1.5; margin: 0; }
.follow-up-profile-denied { background: #fff8e8; border-left: 4px solid #b76d00; color: #704100; padding: 8px 10px; }
.follow-up-profile-group { border: 1px solid #d2e1ee; border-radius: 8px; padding: 10px; }
.follow-up-profile-group summary { color: #185c8b; cursor: pointer; font-weight: 700; }
.follow-up-profile-group[open] summary { margin-bottom: 12px; }
.follow-up-profile-options { border: 1px solid #d2e1ee; border-radius: 7px; display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0; min-width: 0; padding: 9px; }
.follow-up-profile-options legend { color: #244660; font-size: 13px; font-weight: 700; }
.follow-up-profile-options label { align-items: center; display: flex; font-weight: 400; }
.follow-up-profile-options input { min-height: 18px; width: auto; }
.follow-up-profile-preview,
.follow-up-profile-history { background: #edf7ff; border: 1px solid #bfd8eb; border-radius: 8px; padding: 10px; }
.follow-up-profile-preview dl,
.follow-up-profile-history dl { display: grid; gap: 5px; margin: 8px 0 0; }
.follow-up-profile-preview dl div,
.follow-up-profile-history dl div { display: grid; gap: 8px; grid-template-columns: 100px minmax(0, 1fr); }
.follow-up-profile-preview dt,
.follow-up-profile-history dt { color: var(--follow-up-muted); }
.follow-up-profile-preview dd,
.follow-up-profile-history dd { margin: 0; overflow-wrap: anywhere; }
.follow-up-profile-history summary { color: #185c8b; cursor: pointer; font-weight: 700; }
.follow-up-profile-history p { color: var(--follow-up-muted); font-size: 13px; margin: 8px 0 0; }
.follow-up-candidates,
.follow-up-resource-candidates,
.follow-up-link-list,
.follow-up-media-options { display: grid; gap: 8px; }
.follow-up-candidates { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.follow-up-candidates button { text-align: left; }
.follow-up-candidates .is-selected { background: #dff1ff; border-color: #277caf; }

.follow-up-visit-fields { border: 1px solid #c7dce9; border-radius: 8px; padding: 11px; }
.follow-up-visit-fields summary { color: #185c8b; cursor: pointer; font-weight: 700; margin-bottom: 12px; }
.follow-up-media-picker { background: #f5faff; border-radius: 8px; display: grid; gap: 6px; margin-top: 12px; padding: 11px; }
.follow-up-media-picker span { color: var(--follow-up-muted); font-size: 13px; }
.follow-up-media-options label { align-items: center; display: flex; font-weight: 400; }
.follow-up-media-options input { min-height: 18px; width: auto; }

.follow-up-resource-candidates article,
.follow-up-link-list article { background: #f8fbfe; border: 1px solid #d3e1ec; border-radius: 8px; display: grid; gap: 7px; padding: 11px; }
.follow-up-resource-candidates span,
.follow-up-link-list span,
.follow-up-link-list small { color: var(--follow-up-muted); font-size: 13px; }
.follow-up-link-list article.is-inactive { background: #f6f7f8; opacity: .78; }
.follow-up-resource-candidates article > button,
.follow-up-link-list article > button { justify-self: start; }

.follow-up-timeline { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.follow-up-timeline article { background: #fff; display: grid; gap: 10px; overflow-wrap: anywhere; }
.follow-up-timeline article > header > div { display: grid; gap: 3px; }
.follow-up-timeline article > header span { color: var(--follow-up-muted); font-size: 13px; }
.follow-up-timeline article > header > span { background: #edf7ff; border-radius: 999px; color: #176093; padding: 3px 8px; text-align: center; }
.follow-up-timeline article p { line-height: 1.55; margin: 0; white-space: pre-wrap; }
.follow-up-timeline dl { display: grid; gap: 5px; margin: 0; }
.follow-up-timeline dl div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; }
.follow-up-timeline dt { color: var(--follow-up-muted); }
.follow-up-timeline dd { margin: 0; overflow-wrap: anywhere; }
.follow-up-next-done { color: #17623f; }
.follow-up-timeline footer { justify-content: flex-end; }
.follow-up-pager { justify-content: center; }

@media (max-width: 700px) {
  .follow-ups-heading,
  .follow-up-form > header,
  .follow-up-resource-links > header,
  .follow-up-subject-link > header,
  .follow-up-timeline article > header,
  .follow-up-timeline article > footer { align-items: stretch; flex-direction: column; }
  .follow-ups-heading-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .follow-ups-heading-actions > button { width: 100%; }
  .follow-ups-filters,
  .follow-up-form-grid { grid-template-columns: 1fr; }
  .follow-up-filter-toggle { display: block; text-align: left; }
  .follow-ups-filters.is-mobile-collapsed { display: none; }
  .follow-ups-search,
  .follow-up-form-grid .span-2,
  .follow-up-plan-warning { grid-column: auto; }
  .follow-up-profile-update > button { width: 100%; }
  .follow-up-profile-preview dl div,
  .follow-up-profile-history dl div { grid-template-columns: 1fr; gap: 2px; }
  .follow-up-timeline article > header > span { align-self: flex-start; }
  .follow-up-timeline footer button { width: 100%; }
  .follow-up-pager { align-items: stretch; flex-wrap: wrap; }
  .follow-up-pager button { flex: 1 1 130px; }
}
