.master-column-filters th {
  padding-top: 0;
  padding-bottom: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.master-column-filters input {
  width: 100%;
  min-width: 125px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
}

.master-column-filters input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.master-column-filters input::placeholder {color: var(--muted);}
.master-scope-label {color: var(--muted); font-size: 11px; font-weight: 400;}
.master-name-cell {min-width: 235px; max-width: 320px;}
.master-text-cell {min-width: 145px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; line-height: 1.6;}
.master-linked-count {display: inline-block; min-width: 30px; padding: 5px 9px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums;}
.master-form-note {margin-bottom: 26px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 13px; font-weight: 400; line-height: 1.65;}
.master-form-note span {display: block; margin-top: 4px; color: var(--muted); font-size: 12px;}
.master-suggestions {top: 75px; z-index: 6;}
.master-picker-empty {padding: 14px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.6;}

.master-profile-form .master-form-note {margin-bottom: 20px;}
/* Only the profile body scrolls. Clipping the outer containers also prevents
   browser focus navigation from scrolling the fixed header/footer away. */
#editor:has(#master-form), #consultant-project-dialog {overflow: clip;}
#editor:has(#master-form) > #editor-content {overflow: clip; height: 100%; flex: 1 1 0; min-height: 0;}
#editor:has(#master-form) .dialog-header, #editor:has(#master-form) .dialog-footer,
#consultant-project-dialog > .dialog-header, #consultant-project-dialog > .dialog-footer {flex: 0 0 auto;}
#master-form, #consultant-project-form {flex: 1 1 0; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain;}
.master-section-title {display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px;}
.master-section-title .form-section-heading {margin: 0;}
.master-section-title + .field-help {margin: 0 0 18px; line-height: 1.6;}
.master-section-help {margin: -8px 5px 22px; line-height: 1.65;}
.master-fixed-value {min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 14px; font-weight: 500;}
.master-assignment-note {padding: 14px 17px; margin: 0 0 20px; border: 1px solid #d8bd9d; border-radius: 10px; background: #faf5ec; color: #795d36; font-size: 13px; line-height: 1.65;}
.master-assignment-note p {margin: 5px 0 0;}
.master-conflict {color: #8d6740;}
.master-contact-list {display: grid; gap: 16px;}
.master-contact-card {padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf7;}
.master-contact-card header {display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px;}
.master-contact-card h4 {margin: 0; color: var(--ink); font-size: 14px; font-weight: 600;}
.master-contact-card [data-remove-contact] {color: #966557; padding: 5px 0 5px 10px;}
.master-contact-card .form-field textarea {min-height: 75px;}
.master-contact-empty, .master-related-empty {padding: 20px; border: 1px dashed #ccd9ce; border-radius: 9px; background: #f8faf7; color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0;}
.master-contact-empty[hidden] {display: none;}
.master-summary-count {font-size: 12px; color: var(--muted); white-space: nowrap;}
.master-related-wrap {border: 1px solid var(--line); border-radius: 10px;}
.master-related-table {width: 100%; min-width: 630px;}
.master-related-table td {padding: 14px 12px; white-space: normal; vertical-align: top; font-size: 13px; line-height: 1.6;}
.master-related-table th {padding: 13px 12px; font-size: 11px; white-space: nowrap;}
.master-related-table td:first-child {min-width: 145px;}
.master-related-table td:last-child {width: 44px; padding-right: 8px;}
.master-related-table strong {font-size: 13px; font-weight: 550; color: var(--ink);}
.master-related-table .secondary-line {font-size: 11px; line-height: 1.55;}
.master-missing-value {color: var(--muted); font-style: italic;}
.master-origin {font-size: 12px; color: #4d685c;}
.master-directory-contact {display: block; margin: 0 0 5px; color: var(--ink);}
.master-directory-contact:last-child {margin-bottom: 0;}
.project-status {background: #edf3eb; border: 1px solid #d8e3d4; color: #4d6953; text-transform: none; white-space: nowrap; font-weight: 500;}
.master-auxiliary-dialog {width: min(820px, 95vw);}
.master-status-dialog {width: min(760px, 94vw);}
.master-status-body {padding: 24px;}
.master-new-status-form {display: flex; align-items: flex-end; gap: 12px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line);}
.master-new-status-form .form-field {flex: 1;}
.master-status-list {display: grid; gap: 14px;}
.master-status-row {display: grid; grid-template-columns: minmax(160px, 1fr) 180px auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf7;}
.master-active-check {display: flex; gap: 8px; align-items: center; padding-top: 21px; font-size: 12px; color: var(--muted); line-height: 1.4;}
.master-active-check input {accent-color: var(--accent); width: 17px; height: 17px; flex-shrink: 0;}
.master-status-row [data-save-status] {margin-top: 21px;}
.master-assigned-input {cursor: default;}

@media (max-width: 650px) {
  .master-contact-card {padding: 15px;}
  .master-section-title {align-items: flex-start;}
  .master-related-section {padding-left: 12px; padding-right: 12px;}
  .master-status-row {grid-template-columns: 1fr; gap: 10px;}
  .master-active-check, .master-status-row [data-save-status] {padding-top: 0; margin-top: 0;}
  .master-status-row [data-save-status] {justify-self: start;}
  .master-new-status-form {align-items: stretch; flex-direction: column;}
  .master-new-status-form .button {align-self: flex-start;}
}

@media (max-width: 650px) {
  .master-name-cell {min-width: 205px;}
  .master-column-filters input {font-size: 14px;}
}
