#client-directory-screen { gap:22px; }
#client-directory-screen .page-header p, #client-directory-message { color:var(--text-muted, #97aaa0); }
.client-directory-search { display:grid; gap:8px; max-width:600px; }
.client-directory-list { display:grid; gap:18px; }
.client-company-card { border:1px solid #33443a; border-radius:14px; background:#141f19; padding:22px; }
.client-company-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.client-company-heading h2 { margin:0 0 8px; font-size:20px; overflow-wrap:anywhere; }
.client-company-heading a { color:#bce8cd; overflow-wrap:anywhere; }
.client-company-actions { display:flex; flex-wrap:wrap; gap:8px; flex-shrink:0; }
.client-contacts { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px; }
.client-contact-card { display:grid; gap:7px; border:1px solid #34463b; border-radius:10px; padding:16px; background:#1b2a21; overflow-wrap:anywhere; }
.client-contact-card span, .client-empty { color:#a8b9ae; font-size:13px; }
.client-contact-card button { justify-self:start; margin-top:5px; }
.client-picker { display:grid; gap:8px; min-width:0; }
.client-picker-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.client-picker-heading button { padding:5px 9px; font-size:12px; }
.client-picker .project-team-search, .client-company-selector .project-team-search { margin-bottom:8px; padding:10px 12px; font:inherit; font-size:13px; }
/* Success: descriptions sit below names instead of squeezing them into the team picker's checkbox column. */
.client-picker .project-team-option, .client-company-selector .project-team-option { width:100%; grid-template-columns:minmax(0,1fr); gap:4px; padding:11px 12px; text-align:left; }
.client-picker .project-team-option strong, .client-picker .project-team-option span, .client-company-selector .project-team-option strong, .client-company-selector .project-team-option span { min-width:0; white-space:normal; overflow-wrap:anywhere; line-height:1.4; }
.client-picker .project-team-option span, .client-company-selector .project-team-option span { display:block; font-size:12px; color:#a7b9ae; }
/* Previous short lists compressed grid rows to 50px; intrinsic row heights keep long names inside their own option. */
.client-picker .project-team-options, .client-company-selector .project-team-options { grid-auto-rows:max-content; align-content:start; }
.client-editor { position:fixed; inset:0; z-index:950; background:#000a; display:grid; place-items:center; padding:20px; }
.client-editor-card { width:min(540px,100%); max-height:90vh; overflow:auto; padding:26px; border:1px solid #455a4b; border-radius:18px; background:#16221b; color:#eef5f0; box-shadow:0 18px 60px #0007; }
.client-editor-card h2 { margin:0; }
.client-editor-card form { display:grid; gap:16px; }
.client-editor-card label { display:grid; gap:7px; }
.client-editor-card p { margin:0; color:#b0c3b7; font-size:13px; line-height:1.6; }
.client-editor-card footer { display:flex; justify-content:flex-end; gap:10px; margin-top:4px; }
.client-editor-card [role="alert"] { color:#ffb8b8; }
.client-company-selector-card { display:flex; flex-direction:column; gap:16px; width:min(680px,100%); max-height:calc(100dvh - 40px); }
.client-company-selector-card header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.client-company-selector-card h2 { flex:1; font-size:24px; }
.client-company-selector-body { display:flex; flex-direction:column; gap:12px; min-height:0; overflow-y:auto; }
.client-company-selector-body > * { flex-shrink:0; }
.client-company-select-menu { display:grid; gap:10px; padding:10px; border:1px solid #455a4b; border-radius:12px; background:#101a14; }
.client-company-selector-card form { margin:0; padding:0; }
.client-company-selector-card label { font-size:14px; font-weight:600; }
.client-company-selector-card form input { width:100%; min-height:44px; padding:10px 12px; font:inherit; font-weight:400; }
.client-company-selector-card label .client-optional { color:#a7b9ae; font-size:12px; font-weight:400; }
.client-company-selector-card footer { flex-wrap:wrap; }
.client-company-selector-card footer > .client-danger-action { margin-right:auto; }
.client-selector-close { display:grid; place-items:center; flex-shrink:0; width:36px; height:36px; padding:0; border:1px solid #455a4b; border-radius:9px; background:transparent; color:inherit; font-size:24px; cursor:pointer; }
.client-selector-close svg { display:block; }
.client-company-selector .project-team-search { flex-shrink:0; margin:0; }
.client-company-selector .project-team-options { max-height:340px; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.client-company-selector-card footer { flex-shrink:0; border-top:1px solid #33443a; padding-top:16px; margin:0; }
.client-danger-action { border:1px solid #9b5757; border-radius:10px; padding:10px 14px; background:#442729; color:#ffcbcb; cursor:pointer; font:inherit; font-size:13px; font-weight:600; }
#client-edit-delete { margin-right:auto; }
.client-delete-confirmation { border:1px solid #895050; border-radius:10px; padding:14px; background:#342122; }
.client-delete-confirmation > div { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; margin-top:12px; }
.client-delete-confirmation.hidden, .client-editor .hidden { display:none; }
.client-editor.hidden, .client-picker .hidden { display:none; }
#project-intake-form input[readonly] { opacity:.85; background:#17211c; }
@media(max-width:700px) { .client-company-heading { flex-direction:column; } .client-company-card { padding:16px; } .client-editor-card { padding:20px; } }
@media(max-width:480px) {
  /* Success: keep Cancel and Use company together so mobile actions do not consume three rows. */
  .client-company-selector-card footer > button:not(.client-danger-action) { width:auto; flex:1; }
  .client-company-selector-card footer > .client-danger-action { flex-basis:100%; margin-right:0; }
}
@media(max-height:480px) {
  .client-company-selector { padding:12px; }
  .client-company-selector-card { max-height:calc(100dvh - 24px); padding:16px; gap:10px; }
  .client-company-selector-card h2 { font-size:20px; }
  .client-selector-close { width:32px; height:32px; }
  .client-company-selector .project-team-search { min-height:40px; padding:8px 10px; }
  .client-company-selector-card form { gap:10px; }
  .client-company-selector-card form input { min-height:40px; padding:8px 12px; }
  .client-company-selector-card footer { padding-top:10px; flex-wrap:nowrap; }
  .client-company-selector-card footer button { width:auto; min-height:36px; padding:7px 12px; }
}

/* Success: one popup contains both editors; compact field rows leave room for the company-wide warning. */
.client-modal-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.client-modal-contacts { display:grid; gap:14px; border-top:1px solid #455a4b; padding-top:16px; }
.client-modal-contacts h3 { margin:0; font-size:16px; }
.client-modal-contacts select { width:100%; min-height:44px; padding:10px 12px; border:1px solid #455a4b; border-radius:12px; background:#101a14; color:inherit; font:inherit; }
.client-modal-contacts > button { justify-self:start; }
.client-company-selector-card .client-shared-warning { color:#f3dca5; border-left:3px solid #c4a15c; padding-left:12px; }
@media(max-width:480px) { .client-modal-fields { grid-template-columns:1fr; } }
/* Previous overlay menus could clip inside a scrolling modal; let contact choices occupy their own space. */
.client-modal-contacts .custom-choice-menu { position:static; margin-top:8px; max-height:220px; }
