/* Keegan & Donato: consistent text spacing across reference pages. */
#wpb-content-root .wpb_text_column p {
  line-height: 1.65 !important;
  word-spacing: normal;
}
#wpb-content-root .wpb_text_column p + p {
  margin-top: 1em !important;
}
#wpb-content-root .wpb_text_column h2 + p,
#wpb-content-root .wpb_text_column h3 + p {
  margin-top: 0.65em !important;
}
#wpb-content-root .wpb_text_column li {
  line-height: 1.65;
}
#wpb-content-root .wpb_text_column li + li {
  margin-top: 0.45em;
}
#wpb-content-root .wpb_text_column p:empty {
  display: none;
}
/* Shared layout polish: let flex/grid gaps control their own spacing. */
#wpb-content-root .wpb_text_column :is([style*="display:flex"],[style*="display: flex"],[style*="display:grid"],[style*="display: grid"]) > br { display:none !important; }
#wpb-content-root .wpb_text_column :is([style*="display:flex"],[style*="display: flex"],[style*="display:grid"],[style*="display: grid"]) > p { margin-bottom:0 !important; }
#wpb-content-root .wpb_text_column :is([style*="display:flex"],[style*="display: flex"],[style*="display:grid"],[style*="display: grid"]) > :is(p,h2,h3) + p:not(.kd-service-more) { margin-top:0 !important; }
/* Center incomplete rows and keep cards at consistent widths. */
#wpb-content-root .kd-related-grid { display:flex !important; flex-wrap:wrap; justify-content:center; align-items:stretch; gap:24px !important; }
#wpb-content-root .kd-related-grid > div { flex:0 0 calc((100% - 48px)/3) !important; width:auto !important; min-width:0 !important; max-width:none !important; box-sizing:border-box; }
#wpb-content-root .kd-related-grid > div > h3:has(+p:not(:empty)) { min-height:2.7em; }
#wpb-content-root .kd-services-card .kd-service-more { margin-top:auto !important; }
/* Keep wrapped headings and contact details readable on small screens. */
#wpb-content-root .wpb_text_column h2, #wpb-content-root .wpb_text_column h3 { overflow-wrap:break-word; }
#wpb-content-root .wpb_text_column a[href^="mailto:"] { overflow-wrap:anywhere; }
@media(max-width:900px) {
 #wpb-content-root .kd-related-grid > div { flex-basis:calc((100% - 24px)/2) !important; }
}
@media(max-width:650px) {
 #wpb-content-root .kd-related-grid > div { flex-basis:100% !important; }
 #wpb-content-root .kd-related-grid > div > h3 { min-height:0; }
 #wpb-content-root .wpb_text_column :is([style*="display:flex"],[style*="display: flex"]) > :is(div,p) { min-width:0; }
}