#panel:has(> .contact-directory) { height: 100%; min-height: 21rem; }
.contact-directory {
  --directory-pad: clamp(14px, 2.1cqw, 30px);
  --directory-check-size: 18px;
  display: flex; flex-direction: column; height: 100%; padding: 0;
}
body:not(.light) .contact-directory { --wash: linear-gradient(115deg, #0b1a2be6, #151528da); }
.directory-tools {
  position: relative; z-index: 3; display: grid; grid-template-columns: minmax(12rem, 1fr) auto auto auto;
  align-items: start; gap: 10px; padding: var(--directory-pad) var(--directory-pad) 0;
}
.directory-tools > .directory-download { width:150px; }
.directory-tools .directory-export { width:100%;min-height:48px; }
.contact-search, .directory-control {
  display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 48px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
}
.contact-search { position: relative; padding-inline: 14px 5px; background: var(--field); color: var(--sub); }
.contact-search:focus-within { border-color: var(--hot); box-shadow: 0 0 0 1px var(--hot); }
.contact-search > svg, .directory-control > svg { flex: none; }
.contact-search input {
  flex: 1; align-self: stretch; appearance: none; padding: 7px 0;
  border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 16px;
}
.contact-search input:focus-visible { outline: 0; }
.contact-search input::-webkit-search-cancel-button { display: none; }
.contact-search > button, .row-actions { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; }
.contact-search > button:hover, .row-actions:hover, .row-actions[aria-expanded=true] { background: var(--raised); color: var(--hot); }
.directory-control { justify-content: center; padding: 0 13px; background: var(--raised); font-size: 14px; font-weight: 700; }
.directory-control:hover, .directory-control[aria-expanded=true] { border-color: var(--hot); }
.directory-control > svg { width: 17px; height: 17px; }
.filter-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border-radius: 50%; background: var(--hot); color: var(--bg); font-size: 11px; }
.directory-sort { position: relative; min-width: 190px; height:48px; }
.directory-sort > svg { position: absolute; top: 50%; left: 12px; width: 17px; height: 17px; transform: translateY(-50%); pointer-events: none; }
.directory-sort .cn-select-trigger { height: 100%; padding-left: 38px; background: var(--raised); font-weight: 700; }
.directory-filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px var(--directory-pad) 0; }
.directory-filters label { flex: 1 1 130px; max-width: 250px; color: var(--sub); }
.directory-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap:wrap; gap:8px 14px; min-height: 42px; padding: 5px var(--directory-pad); color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }
.directory-summary .link { font-size: inherit; }
.directory-actions { display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px 14px;margin-left:auto; }
.directory-download { display:grid;justify-items:end;min-width:150px;max-width:100%; }
.directory-export { min-height:44px;min-width:150px;padding-inline:12px;font-size:13px;white-space:nowrap; }
.directory-export:focus-visible { outline:2px solid var(--hot);outline-offset:3px; }
.directory-export:disabled { cursor:not-allowed;color:var(--sub);opacity:.7; }
.directory-export-error { margin:8px 0 0;max-width:320px;color:var(--hot);font-size:13px; }
.directory-export-spin { animation:directory-export-spin 1s linear infinite; }
@keyframes directory-export-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .directory-export-spin { animation:none; } }
.contact-directory > .error { padding: 4px var(--directory-pad); }
.directory-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-radius: 0 0 var(--radius) var(--radius); }
.directory-scroll:focus-visible { outline: 2px solid var(--hot); outline-offset: -2px; }
.contacts-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.contacts-table th, .contacts-table td { padding: 10px 12px; }
.contacts-table th { position: sticky; z-index: 2; top: 0; height: 42px; padding-block: 0; background: var(--panel); box-shadow: inset 0 1px var(--line); }
.contacts-table th:first-child, .contacts-table td:first-child { padding-left: var(--directory-pad); }
.contacts-table th:last-child, .contacts-table td:last-child { padding-right: var(--directory-pad); }
.contacts-table th button { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.contacts-table th button:hover, .contacts-table th[aria-sort] button { color: var(--hot); }
.contacts-table .person-col { width: 40%; }
.contacts-table .action-col { width: calc(48px + var(--directory-pad)); padding-left: 0; text-align: right; }
.contacts-table tr:hover td, .contacts-table tr:focus-within td { background: var(--instrument-bg); }
.contact-person { display: flex; align-items: center; gap: 12px; }
.contact-person > div { min-width: 0; }
.contact-avatar {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--instrument-bg); color: var(--instrument); font-weight: 700; font-size: 12px;
}
.contact-name { display: block; max-width: 100%; padding: 0; text-align: left; color: var(--ink); font-weight: 700; }
.contact-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.contact-name, .contact-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-person small { margin-top: 2px; }
.contact-person .contact-mobile-meta { display: none; }
.contact-verification { font-size: 11px; }
.directory-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px; background: var(--tag); color: var(--ink); font-size: 12px; white-space: nowrap; }
.directory-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--instrument); }
.directory-status[data-status="Contacted"]::before { background: #41be9c; }
.directory-status[data-status="In progress"]::before { background: var(--hot); }
.added-col { white-space: nowrap; }
.directory-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .contacts-table tr:not(:hover):not(:focus-within) .row-actions[aria-expanded=false] { color: var(--sub); }
}
.contact-predictions, .contact-menu {
  padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink);
  box-shadow: 0 12px 35px #03071455;
}
.contact-predictions {
  position: absolute; inset: calc(100% + 6px) -1px auto; max-height: min(310px, 40dvh); margin: 0;
  overflow-y: auto; list-style: none;
}
.contact-predictions li, .contact-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.contact-predictions li[aria-selected=true], .contact-menu button:hover, .contact-menu button:focus-visible { background: var(--raised); }
.contact-predictions li > span { min-width: 0; overflow-wrap: anywhere; }
.contact-predictions small { display: block; }
.contact-menu { position: fixed; z-index: 20; width: 195px; }
.contact-menu button { justify-content: flex-start; min-height: 39px; width: 100%; text-align: left; }
.contact-menu button > svg { width: 16px; height: 16px; }
.contact-menu button:disabled { cursor: default; }
.contact-menu button small { display: block; font-size: 11px; }
.contact-identity, .contact-detail-name { margin-bottom: 15px; overflow-wrap: anywhere; }
.contact-facts { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px 18px; margin: 12px 0 22px; }
.contact-facts dt { color: var(--sub); }
.contact-facts dd { margin: 0; overflow-wrap: anywhere; }
.contact-note { white-space: pre-wrap; }
.directory-feedback, .directory-more { display: grid; justify-items: center; align-content: center; gap: 10px; padding: 24px; color: var(--sub); text-align: center; }
.directory-feedback { min-height: 160px; }
.directory-feedback > svg { color: var(--hot); }
.directory-more { min-height: 50px; padding: 8px; }
.contact-skeleton .contact-person { min-height: 39px; }
.contact-skeleton .contact-avatar { height: 36px; background-color: var(--line); }
.sk-identity { display: grid; flex: 1; align-content: center; gap: 6px; }
.sk-identity .staff-skeleton:first-child { width: 56%; }
.sk-identity .staff-skeleton:not(:first-child) { height: .5rem; }
.sk-identity .sk-verification, .sk-identity .contact-mobile-meta { width: 42%; }
.contact-skeleton:nth-child(even) .sk-identity > :first-child { width: 43%; }
@container content (max-width: 900px) {
  .directory-tools { grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; }
  .contact-search { grid-column: 1 / -1; }
  .directory-tools > .directory-control { justify-self: start; min-height: 48px; }
  .directory-sort { min-width: 0; }
}
@container content (max-width: 520px) {
  .directory-tools { grid-template-columns: auto minmax(0,1fr); }
  .directory-tools > .directory-download { grid-column:1 / -1;width:100%; }
}
@container content (max-width: 680px) {
  .contacts-table .secondary-col { display: none; }
  .contacts-table .person-col { width: auto; }
  .contacts-table .status-col { width: 98px; }
  .contacts-table th, .contacts-table td { padding-inline: 4px; }
  .contact-avatar { display: none; }
  .contact-person .contact-mobile-meta { display: block; white-space: normal; }
  .row-actions { width: 44px; height: 44px; }
  .directory-scroll { scrollbar-gutter: auto; }
  .directory-filters { gap: 7px; }
  .directory-filters label { flex-basis: 110px; }
}

.contacts-table .directory-check {
  width: calc(var(--directory-pad) + var(--directory-check-size) + 8px);
  padding: 5px 8px 5px var(--directory-pad);
}
.directory-check input {
  display: block; width: var(--directory-check-size); height: var(--directory-check-size);
  margin: 0; padding: 0; accent-color: var(--hot); cursor: pointer;
}
.contact-name { text-decoration:none; }
.directory-actions { flex-wrap:wrap; }
.contact-edit-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(175px,100%),1fr)); gap:12px; }
.contact-profile-page { display:grid; gap:18px; align-content:start; max-width:760px; }
.contact-profile-page header,.contact-profile-actions,.contact-photo-editor { display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.contact-profile-page header img,.contact-photo-editor img { width:64px; height:64px; border-radius:50%; object-fit:cover; }
.contact-profile-page dd { overflow-wrap:anywhere; white-space:pre-wrap; }
.contact-photo-editor input { max-width:100%; }

.contact-workspace {container-type:inline-size;--cw-accent:#71eee6;color:var(--ink)}
body.light .contact-workspace {--cw-accent:#006963}
.contact-workspace svg {width:1.15rem;height:1.15rem;flex:none}
.cw-back,.cw-view,.cw-actions button,.cw-notes summary,.cw-title,.cw-filter,.cw-tags {display:flex;align-items:center;gap:.5rem}
.cw-back,.cw-view {width:fit-content;text-decoration:none;font-weight:650;color:var(--cw-accent)}
.cw-back:hover,.cw-view:hover {text-decoration:underline}
.cw-head {display:flex;align-items:center;gap:.85rem;flex-wrap:wrap;padding:1rem 0 1.15rem;margin-bottom:1rem;border-bottom:1px solid var(--line)}
.cw-identity {flex:1;min-width:min(12rem,100%);overflow-wrap:anywhere}
.cw-name {display:flex;align-items:center;flex-wrap:wrap;gap:.35rem .7rem;margin-bottom:.35rem}
.cw-identity h2 {font:750 clamp(1.45rem,3cqi,2.15rem)/1.12 Inter,Arial,sans-serif;margin:0;min-width:0}
.cw-exp {padding:.25rem .55rem;border:1px solid color-mix(in srgb,var(--cw-accent) 45%,var(--line));background:var(--field);color:var(--cw-accent);border-radius:999px;font-size:.8rem;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}
.cw-edit-types {display:inline-flex;align-items:center;gap:.3rem;min-height:28px;padding:.15rem .3rem;border:0;background:transparent;color:var(--cw-accent);font:inherit;font-weight:650;cursor:pointer}
.cw-edit-types:hover {text-decoration:underline}
.cw-edit-types svg {width:.8rem;height:.8rem}
.cw-avatar {display:grid;place-items:center;flex:none;width:3.7rem;height:3.7rem;border:1px solid var(--cw-accent);border-radius:15px;background:linear-gradient(135deg,#08576e,#19647a 40%,#13293e);color:white;font-size:1.45rem;font-weight:750;overflow:hidden}
.cw-avatar img {width:100%;height:100%;object-fit:cover}
.cw-tags,.cw-actions {display:flex;flex-wrap:wrap;gap:.4rem}
.cw-tags {font-size:.8rem;color:var(--sub)}
.cw-tags b {padding:.15rem .5rem;background:var(--raised);border:1px solid var(--line);border-radius:6px;color:var(--cw-accent)}
.cw-actions button:disabled {opacity:.5;cursor:not-allowed}
.cw-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(.6rem,1.1cqi,1.25rem);align-items:stretch}
.cw-column {display:flex;flex-direction:column;gap:.8rem;min-width:0}
.cw-card {min-width:0;padding:clamp(.85rem,1.4cqi,1.5rem);border:1px solid var(--line);border-radius:15px;background:linear-gradient(120deg,rgba(115,211,224,.055),transparent 60%),var(--panel);box-shadow:0 6px 20px #03091b17}
.cw-card h3 {font-size:clamp(1.05rem,1.7cqi,1.45rem);line-height:1.25;margin:0 0 .85rem;font-weight:750}
.cw-facts,.cw-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0}
.cw-facts>div {padding:.7rem .4rem .7rem 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.cw-facts .wide {grid-column:1/-1}
.cw-facts dt,.cw-event small,.cw-filter > span,.cw-types small,.cw-stats dt {color:var(--sub)}
.cw-facts dt,.cw-scroll h4 {font-size:.7rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}
.cw-facts dd {margin:.2rem 0 0;font-weight:550}
.cw-sign-in {display:block;margin-top:.15rem;font-size:.72rem;line-height:1.3;font-weight:400;color:var(--sub)}
.cw-actions {align-items:center}
.cw-view {padding:.4rem .45rem;min-height:32px;font-size:.78rem;gap:.2rem}
.cw-view svg {width:.9rem;height:.9rem}
.cw-stats>div {display:grid;grid-template-columns:auto 1fr;align-content:center;gap:.3rem .5rem;min-width:0;padding:.7rem .25rem;border-top:1px solid var(--line)}
.cw-stats svg {color:var(--cw-accent);grid-row:1;align-self:center}
.cw-stats dd {grid-column:2;grid-row:1;margin:0;font-size:clamp(1rem,1.5cqi,1.4rem);font-weight:750}
.cw-stats dt {grid-column:1/-1;font-size:.78rem}
.cw-title,.cw-filter {justify-content:space-between}
.cw-title h3 {margin:0}
.cw-garage .cw-title>span {color:var(--sub);font-size:.8rem;font-variant-numeric:tabular-nums}
.cw-garage ul {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(7rem,100%),1fr));gap:.5rem;list-style:none;padding:0;margin:.85rem 0 0}
.cw-garage li {display:grid;align-content:start;padding:.45rem .6rem .6rem;min-width:0;background:var(--field);border:1px solid var(--line);border-radius:9px}
.cw-garage li img {display:block;width:100%;height:3.25rem;object-fit:contain;margin-bottom:.3rem}
.cw-garage li strong {font-size:.83rem;overflow-wrap:anywhere}
.cw-garage li small {color:var(--sub);font-size:.73rem}
.cw-save-types {margin-top:.75rem}
.cw-types {border:0;padding:0;margin:0;min-width:0}
.cw-types legend {color:var(--sub);margin:.2rem 0 .7rem;font-size:.85rem}
.cw-types label {display:flex;align-items:center;gap:.65rem;margin:0 0 .35rem;padding:.55rem .65rem;background:var(--field);border:1px solid var(--line);border-radius:9px;cursor:pointer}
.cw-types label:hover,.cw-types label:focus-within {border-color:var(--cw-accent)}
.cw-types label:has(input:checked) {border-color:var(--cw-accent);background:color-mix(in srgb,var(--cw-accent) 12%,var(--field))}
.cw-types input[type=checkbox] {appearance:auto;width:1.1rem;height:1.1rem;min-height:0;margin:0 0 0 auto;accent-color:var(--cw-accent)}
.cw-types small,.cw-event small {display:block;font-size:.76rem;font-weight:450}
.cw-notes summary {cursor:pointer;font-weight:700;list-style:none}.cw-notes summary::-webkit-details-marker {display:none}
.cw-notes summary span {color:var(--sub);font-weight:500}.cw-notes summary svg:last-child {margin-left:auto}.cw-notes[open] summary svg:last-child {transform:rotate(180deg)}
.cw-notes p {white-space:pre-wrap;overflow-wrap:anywhere}
.cw-history {display:flex;flex-direction:column}.cw-filter {gap:.5rem;padding-bottom:.8rem;border-bottom:1px solid var(--line)}
.cw-filter .cn-select-trigger {flex:1;min-width:0;padding-inline:.85rem 1rem;border-radius:12px}
.cw-filter > span {font-size:.78rem}.cw-filter > span {white-space:nowrap}
#contact-email select {border:1px solid var(--line);border-radius:8px;background:var(--field);color:var(--ink);padding:.55rem;min-width:0;max-width:100%}
.cw-scroll {flex:1 1 0;min-height:21rem;overflow:auto;scrollbar-width:thin;padding-right:.2rem}
.cw-scroll h4 {margin:.95rem 0 .4rem;color:var(--sub)}
.cw-event {position:relative;display:grid;grid-template-columns:1.75rem 1fr auto;gap:.45rem;align-items:start;padding:.42rem 0;font-size:.85rem;overflow-wrap:anywhere}
.cw-event:before {content:'';position:absolute;inset:0 auto 0 .85rem;width:1px;background:var(--line)}
.cw-event>span {position:relative;display:grid;place-items:center;width:1.75rem;height:1.75rem;background:var(--field);border:1px solid var(--line);border-radius:8px;color:var(--cw-accent)}
.cw-event.tickets>span {color:var(--hot)}.cw-event.game>span {color:var(--instrument)}.cw-event time {font-size:.66rem;color:var(--sub);margin-top:.25rem;white-space:nowrap}
.cw-recipient,.cw-signature {margin:.2rem 0;color:var(--sub);overflow-wrap:anywhere}.cw-signature {padding-top:.55rem;border-top:1px solid var(--line)}
@container (max-width:700px) {.cw-grid {grid-template-columns:1fr}.cw-scroll {flex:auto;min-height:0;max-height:60vh}.cw-card{padding:1rem}.cw-actions{width:100%}.cw-actions button{font-size:.82rem}}
