/* v2.38.0 client and contact pickers */
.cpk-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; clip-path: inset(50%); }
.cpk-trigger { display: flex; align-items: center; gap: var(--space-xs); width: 100%; min-height: 48px; padding: var(--space-3xs) var(--space-xs); background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-m); font: 400 var(--step-0) var(--body); text-align: left; cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease; }
.cpk-trigger:hover { border-color: var(--accent); }
.cpk-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cpk-trigger:disabled { opacity: .6; cursor: not-allowed; }
.cpk-trigger .avatar.sm { width: 30px; height: 30px; font-size: var(--step--2); flex: none; }
.cpk-t-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.cpk-t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cpk-t-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--step--2); color: var(--muted); }
.cpk-t-ph { flex: 1; color: var(--muted); }
.cpk-t-end { display: inline-flex; color: var(--muted); margin-left: auto; flex: none; } .cpk-t-end .icon { width: 18px; height: 18px; }
.cpk-trigger:hover .cpk-t-end { color: var(--accent-text); }
.field .cpk-trigger { margin: 0; }
html.cpk-lock, html.cpk-lock body { overflow: hidden; }
.cpk-bg { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: flex-start; justify-content: center; padding: 8vh var(--space-s) var(--space-s); background: rgba(15, 15, 18, .5); animation: pkfade 140ms ease-out both; }
.cpk-bg.is-out { opacity: 0; transition: opacity 110ms ease-in; }
.cpk { display: flex; flex-direction: column; width: min(780px, 100%); max-height: min(720px, 84vh); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; animation: pkpop 170ms cubic-bezier(.2, .8, .2, 1) both; }
.cpk-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-s) var(--space-2xs) 0 var(--space-m); }
.cpk-head h2 { margin: 0; font-size: var(--step-1); }
.cpk-search { display: flex; align-items: center; gap: var(--space-xs); margin: var(--space-xs) var(--space-s) var(--space-2xs); padding: 0 var(--space-s); background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-m); }
.cpk-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cpk-search .icon { width: 20px; height: 20px; color: var(--muted); flex: none; }
.cpk-search input { flex: 1; min-height: 48px; border: 0; background: transparent; padding: 0; outline: none; box-shadow: none; font: 400 var(--step-0) var(--body); color: var(--text); }
.cpk-scope { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); margin: 0 var(--space-s) var(--space-3xs); padding: var(--space-2xs) var(--space-xs); background: var(--card-2); border-radius: var(--radius-m); }
.cpk-scope[hidden] { display: none; }
.cpk-switch { display: inline-flex; align-items: center; gap: var(--space-2xs); background: none; border: 0; color: var(--text); cursor: pointer; padding: var(--space-3xs); border-radius: var(--radius-s); }
.cpk-switch:focus-visible { outline: 2px solid var(--accent); }
.cpk-knob { position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--border); transition: background-color 150ms ease; flex: none; }
.cpk-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 150ms ease; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.cpk-switch[aria-checked="true"] .cpk-knob { background: var(--accent); } .cpk-switch[aria-checked="true"] .cpk-knob::after { transform: translateX(14px); }
.cpk-list { flex: 1; min-height: 120px; overflow-y: auto; padding: var(--space-3xs) var(--space-s) var(--space-xs); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2xs); align-content: start; overscroll-behavior: contain; }
.cpk-sec { grid-column: 1 / -1; padding: var(--space-2xs) var(--space-3xs) 0; font: 600 var(--step--2) var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cpk-empty { grid-column: 1 / -1; padding: var(--space-l) var(--space-2xs); text-align: center; color: var(--muted); }
.cpk-card { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; min-height: 64px; padding: var(--space-xs) var(--space-xs); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-m); color: var(--text); font: inherit; text-align: left; cursor: pointer; position: relative; transition: border-color 120ms ease, background-color 120ms ease; }
.cpk-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
.cpk-card.is-selected { box-shadow: inset 3px 0 0 var(--accent); }
.cpk-card:focus-visible { outline: 2px solid var(--accent); }
.cpk-card .avatar { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; }
.cpk-card .avatar.favicon { border-radius: var(--radius-m); }
.cpk-all { background: var(--card-2); color: var(--muted); } .cpk-all .icon { width: 22px; height: 22px; }
.cpk-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.cpk-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpk-sub { font-size: var(--step--1); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpk-b { flex: none; } .cpk-tick { color: var(--accent-text); display: inline-flex; flex: none; } .cpk-tick .icon { width: 20px; height: 20px; }
.cpk-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); padding: var(--space-xs) var(--space-m) var(--space-s); border-top: 1px solid var(--border); }
@keyframes pkfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pkpop { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
  .cpk-bg { padding: 0; align-items: stretch; }
  .cpk { width: 100%; max-height: none; height: 100dvh; border-radius: 0; border: 0; }
  .cpk-list { grid-template-columns: minmax(0, 1fr); }
  .cpk-keys { display: none; }
  .cpk-foot { padding-bottom: max(var(--space-s), env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .cpk-bg, .cpk, .cpk-bg.is-out, .cpk-knob, .cpk-knob::after { animation: none; transition: none; } }
