/* Contact parity additions keep controls compact while allowing real names to wrap. */
#tab-contacts .contacts-list-filter{min-width:180px;max-width:none}
#tab-contacts .contacts-list-filter select{width:100%;min-width:0;text-overflow:ellipsis}
.contact-filter-row{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;padding:2px 0 10px}
.contact-filter-row label{display:grid;gap:4px;margin:0;font-size:11px;color:#666}
.contact-filter-row select{min-height:34px;margin:0;padding:5px 28px 5px 10px;min-width:145px;font-size:12px}
.contact-filter-row>button{min-height:34px;margin-left:auto;font-size:12px}
#contacts-table table{table-layout:fixed;min-width:760px}
#contacts-table th:first-child{width:26%}
#contacts-table th:nth-child(2){width:18%}
#contacts-table th:nth-child(3){width:8%}
#contacts-table th:nth-child(4){width:10%}
#contacts-table th:nth-child(5){width:15%}
#contacts-table th:nth-child(6){width:14%}
#contacts-table th:last-child{width:64px}
#contacts-table th:last-child,#contacts-table td:last-child{padding-left:4px;padding-right:4px}
#contacts-table th,#contacts-table td{padding-left:10px;padding-right:10px}
#contacts-table .contact-name-button,#contacts-table .contact-company-name{white-space:normal;overflow-wrap:anywhere}
#contacts-table .contact-identity{grid-template-columns:16px 28px minmax(0,1fr);gap:7px}
#contacts-table .contact-avatar{width:28px;height:28px;font-size:9px}
#contacts-table .contact-actions{flex-wrap:nowrap;justify-content:flex-end;max-width:56px;gap:0}
#contacts-table .contact-icon-action,#contacts-table .contact-messenger-icon,#contacts-table .contact-more>summary{width:28px;min-height:28px;height:28px}
#contacts-table .contact-city{white-space:normal;overflow-wrap:anywhere}
.contact-phone-line{display:flex;flex-wrap:wrap;gap:3px 6px;align-items:center}
.contact-phone-line small{font-size:10px}
.contact-communication details{font-size:11px;max-width:100%}
.contact-communication details a{display:block;overflow-wrap:anywhere}
.contact-communication summary{cursor:pointer;color:#555}
#contacts-table .contact-communication,#contacts-table .contact-communication a{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
#contacts-table .contact-communication>.contact-channel-line{display:block}
#contacts-table .contact-campaign-result{min-width:0;white-space:normal;overflow-wrap:anywhere}
#contacts-table .contact-campaign-result>*{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.contact-campaign-result>*{display:block;font-size:11px;line-height:1.45}
.contact-campaign-result>strong{font-size:12px;font-weight:500}
.contact-campaign-result>small,.contact-updated>small{font-size:10px;color:#777;line-height:1.5}
.contact-selection-actions{display:flex;flex-wrap:wrap;gap:7px}
.contact-selection-actions button{font-size:12px;min-height:34px}
#modal.contact-editor{width:min(580px,calc(100vw - 24px))}
#modal.contact-editor .modal-head{justify-content:space-between;padding:14px 22px}
#modal.contact-editor .modal-head h2{position:static;width:auto;height:auto;clip-path:none;font-size:17px}
.contact-phones{padding:8px 0;border:0;margin:16px 0}
.contact-phones legend{font-size:13px;font-weight:550}
.contact-phone-row{display:grid;grid-template-columns:minmax(100px,1fr) 130px auto 28px;gap:6px;align-items:center}
.contact-phone-row label{font-size:11px;margin:5px 0}
.contact-phone-row input,.contact-phone-row select{min-width:0;width:100%;margin-top:4px;padding:7px;font-size:12px}
.contact-phone-row .contact-primary-phone{display:flex;align-items:center;gap:4px;margin-top:20px}
.contact-primary-phone input{width:14px;height:14px;margin:0}
#modal.contact-editor .contact-primary-phone input{width:16px;height:16px;min-height:16px;padding:0;flex:none}
.contact-phone-row>[data-phone-remove]{padding:4px;min-height:28px;margin-top:20px}
.contact-agent-knowledge,.contact-permission-state{border-top:1px solid #e8e8e8;margin-top:22px;padding-top:16px}
.contact-agent-knowledge h3,.contact-permission-state h3{font-size:14px;margin:4px 0 12px}
.contact-agent-knowledge ul{padding-left:20px;overflow-wrap:anywhere}
.contact-agent-knowledge li{margin:10px 0}
.contact-agent-knowledge p{font-size:12px;line-height:1.5}
.contact-research-copy{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:300px;overflow:auto;background:#f7f7f7;padding:10px;border-radius:6px}
.contact-custom-fields{border:0;padding:0;margin:20px 0}.contact-custom-fields legend{font-size:13px;font-weight:550}.contact-custom-row{display:grid;grid-template-columns:1fr 1fr 28px;gap:6px;align-items:center}.contact-custom-row label{min-width:0}.contact-custom-row input{min-width:0;width:100%}.contact-custom-row>button{padding:4px;min-height:28px;margin-top:24px}
.contact-filter-row :focus-visible,.contact-phone-row :focus-visible,.contact-communication summary:focus-visible{outline:2px solid #222;outline-offset:2px}
@media(min-width:761px) and (max-width:1450px){
 #tab-contacts .contacts-controls{grid-template-columns:minmax(0,1fr);gap:10px}
 #tab-contacts .company-lists-toolbar{grid-column:1;grid-row:1;display:flex;flex-wrap:wrap;min-width:0;width:100%}
 #tab-contacts .company-lists-toolbar .contacts-list-filter{flex:1;min-width:180px}
 #tab-contacts .company-lists-toolbar>button{flex:none}
 #tab-contacts #contacts-search{grid-column:1;grid-row:2;min-width:0;width:100%}
 #tab-contacts .contacts-actions{grid-column:1;grid-row:3;display:flex;flex-wrap:wrap;gap:8px;min-width:0;width:100%}
 #tab-contacts .contacts-actions>*{flex:none}
}
@media(max-width:760px){
 #contacts-table table{table-layout:auto;min-width:0}
 #contacts-table th:first-child{width:100%}
 #contacts-table td:last-child{padding-left:0;padding-right:0}
 #contacts-table .contact-actions{max-width:none;justify-content:flex-start}
 #contacts-table .contact-identity{grid-template-columns:16px 28px minmax(0,1fr)}
 .contact-filter-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .contact-filter-row select{width:100%;min-width:0}
 .contact-filter-row>button{margin-left:0}
 .contact-selection-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
 .contact-selection-actions select{max-width:none;grid-column:1/-1}
 .contact-selection-actions button{white-space:normal}
 #modal.contact-editor{width:calc(100vw - 16px)}
 .contact-phone-row{grid-template-columns:minmax(100px,1fr) 120px 28px;gap:4px 6px;padding:7px 0;border-bottom:1px solid #eee}
 .contact-phone-row .contact-primary-phone{grid-column:1/3;grid-row:2;margin:2px 0}
 .contact-phone-row>[data-phone-remove]{grid-column:3;grid-row:1;margin-top:19px}
 .import-history-actions{flex-wrap:wrap;justify-content:flex-start}
}

#contacts-table .contact-updated,#contacts-table .contact-updated small{white-space:normal;overflow-wrap:anywhere;min-width:0}
#contacts-table .contact-more-menu .contact-messenger-icon{display:flex;justify-content:flex-start;gap:8px;width:100%;height:32px;min-height:32px;padding:6px 10px;font-size:12px;color:#444}
#contacts-table .contact-more-menu .contact-messenger-icon svg{flex:none;width:18px;height:18px}
