
.srch { position: relative; display: flex; align-items: center; flex: none; width: 216px; height: 32px; border-radius: var(--radius-small); background: var(--raised); }
.srch:focus-within { box-shadow: inset 0 0 0 1px var(--control); }
.srch-ico { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--faint); pointer-events: none; }
.srch-inp {
  display: block; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0 var(--s2) 0 30px; border: 0; border-radius: inherit; background: none;
  color: var(--text); font: 400 var(--fs-small)/var(--lh-small) var(--font); outline: none;
}
.srch-inp::placeholder { color: var(--faint); }
.srch-inp::-webkit-search-decoration { -webkit-appearance: none; }
.srch-btn { display: none; }
.srch-phone { display: none; }
.srch-pop {
  position: absolute; z-index: 30; top: calc(100% + var(--s2)); right: 0; width: 340px; max-height: 360px; overflow-y: auto; padding: var(--s2);
  border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-float); scrollbar-width: thin;
}
:root[data-theme="light"] .srch-pop { box-shadow: var(--shadow-float), 0 0 0 1px var(--rule); }
.srch-pop[hidden] { display: none; }
.srch-opt { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); min-height: 36px; padding: var(--s2); border-radius: var(--radius-small); cursor: pointer; }
.srch-opt .t { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.srch-opt .s { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.srch-opt[aria-selected="true"] { background: var(--active); }
@media (hover: hover) { .srch-opt:hover { background: var(--active); } }
.srch-opt.pk-row { align-items: center; justify-content: flex-start; gap: var(--s2); font-weight: 500; }
.srch-opt.head { min-height: 0; padding: var(--s1) var(--s2) var(--s2); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); cursor: default; }
.srch-opt.head .t { font-weight: 500; }
@media (hover: hover) { .srch-opt.head:hover { background: none; } }

.app[data-people="search"] { grid-template-columns: 72px 240px minmax(0, 1fr) 360px; }
.srch-pane { display: flex; flex-direction: column; min-height: 100%; }
.srch-head h2 { font-variant-numeric: tabular-nums; }
.srch-back { display: none; }
.srch-chips { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 0; padding: 0 var(--s2) var(--s3) var(--s4); list-style: none; }
.srch-chip { display: inline-flex; align-items: center; gap: var(--s1); max-width: 100%; height: 24px; padding: 0 2px 0 var(--s2); border-radius: var(--round); background: var(--active); font-size: var(--fs-small); line-height: var(--lh-small); }
.srch-chip .k { color: var(--muted); }
.srch-chip bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.srch-chip-x { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.srch-chip-x:hover { color: var(--text); background: var(--control); }
.srch-chip-x svg { width: 12px; height: 12px; }
.srch-note { display: flex; align-items: flex-start; gap: var(--s2); margin: 0 var(--s4) var(--s2); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.srch-note svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.srch-msg { padding: var(--s2) var(--s3) var(--s3) var(--s4); color: var(--muted); }
.srch-msg.warn { color: var(--pill-warning-ink); }
.srch-list { margin: 0; padding: 0 0 var(--s2); list-style: none; }
.srch-ch h3 { display: flex; align-items: center; gap: 6px; margin: var(--s3) 0 var(--s1); padding-left: var(--s4); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 500; }
.srch-ch:first-child h3 { margin-top: 0; }
.srch-ch h3 svg { width: 14px; height: 14px; color: var(--faint); }
.srch-hit {
  display: block; width: 100%; padding: var(--s2) var(--s3) var(--s2) var(--s4); border: 0; border-radius: var(--radius-small); background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--t-fast) var(--ease-out);
}
.srch-hit:hover { background: var(--panel); }
.srch-hit:focus-visible { outline-offset: -2px; }
.srch-who { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.srch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.srch-name.ok { color: var(--accent); }
:root[data-theme="light"] .srch-name.ok { color: var(--text); text-decoration: underline 2px var(--accent); text-decoration-skip-ink: none; text-underline-offset: 4px; }
.srch-name { padding-bottom: 2px; }
.srch-who .twin { margin-left: calc(-1 * var(--s1)); }
.srch-bad { flex: none; color: var(--pill-warning-ink); font-size: var(--fs-small); line-height: var(--lh-small); }
.srch-who time { flex: none; margin-left: auto; color: var(--faint); font-size: var(--fs-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.srch-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; overflow-wrap: anywhere; }
.srch-text mark { padding: 0 1px; border-radius: 3px; background: var(--control); color: var(--text); font-weight: 600; }
.srch-skel { display: flex; flex-direction: column; gap: var(--s2); height: 64px; padding: var(--s2) var(--s3) var(--s2) var(--s4); }
.srch-skel .skel-line:last-child { width: 88%; }
.srch-pages { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: auto; padding: var(--s3) var(--s2) var(--s4) var(--s4); }
.srch-of { color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-variant-numeric: tabular-nums; }
.srch-older { font-size: var(--fs-small); line-height: var(--lh-small); }

@media (max-width: 1100px) {
  .app[data-people="search"] { grid-template-columns: 72px 240px minmax(0, 1fr); }
  .app[data-people="search"] .people { display: block; width: min(400px, 100vw); }
  .srch { width: 168px; }
}
@media (max-width: 960px) { .app[data-people="search"] { grid-template-columns: 72px 220px minmax(0, 1fr); } }
@media (max-width: 760px) {
  .app[data-people="search"], .app[data-pane="lead"][data-people="search"] { grid-template-columns: minmax(0, 1fr); }
  .app[data-people="search"] .people { width: 100vw; padding: 0 0 var(--s4); box-shadow: none; }
  .ch-head .srch { display: none; }
  .srch-btn { display: inline-grid; }
  .srch-back { display: inline-grid; }
  .srch-x { display: none; }
  .srch-phone { display: flex; width: auto; height: 44px; margin: 0 var(--s4) var(--s3); }
  .srch-phone .srch-inp { font-size: 16px; }
  .srch-phone .srch-pop { left: 0; right: 0; width: auto; }
  .srch-head { padding-left: var(--s2); }
  .srch-hit { padding-right: var(--s4); }
  .srch-pages { padding-right: var(--s4); }
  .srch-head h2 { padding-left: 0; }
}

.qs {
  width: min(560px, calc(100vw - 32px)); max-height: min(520px, calc(100dvh - 96px)); margin: 12dvh auto auto; padding: var(--s4); border: 0;
  border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float);
}
.qs[open] { display: flex; flex-direction: column; animation: qs-in var(--t-slow) var(--ease-out); }
.qs::backdrop { background: var(--sheet-backdrop); }
@keyframes qs-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.qs-field { position: relative; display: flex; align-items: center; flex: none; height: 48px; border-radius: var(--radius-nested); background: var(--raised); }
.qs-field:focus-within { box-shadow: inset 0 0 0 1px var(--control); }
.qs-field > svg { position: absolute; left: 16px; top: 16px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.qs-inp { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 var(--s4) 0 44px; border: 0; background: none; color: var(--text); font: 400 var(--fs-section)/var(--lh-section) var(--font); outline: none; }
.qs-inp::placeholder { color: var(--faint); }
.qs-list { flex: 1; min-height: 0; margin-top: var(--s3); overflow-y: auto; scrollbar-width: thin; }
.qs-h { padding: var(--s1) var(--s2) var(--s2); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 500; }
.qs-opt { display: flex; align-items: center; gap: var(--s3); height: 40px; padding: 0 var(--s2); border-radius: var(--radius-small); color: var(--muted); font-weight: 500; cursor: pointer; }
.qs-opt[aria-selected="true"] { background: var(--active); color: var(--text); }
.qs-opt.unread { color: var(--text); font-weight: 600; }
.qs-opt .pic.s24 { flex: none; }
.qs-ico { display: grid; place-items: center; flex: none; width: 24px; height: 24px; color: var(--faint); }
.qs-ico svg { width: 16px; height: 16px; }
.qs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-twin { color: var(--faint); font-size: var(--fs-small); font-weight: 400; font-variant-numeric: tabular-nums; }
.qs-sub { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 400; }
.qs-none { padding: var(--s4) var(--s2); color: var(--muted); }
.qs-hint { flex: none; margin-top: var(--s3); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.qs kbd, .ks kbd {
  display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 4px; background: var(--active); color: var(--text);
  font: 600 var(--fs-small)/22px var(--font); text-align: center; white-space: nowrap;
}
.qs-hint kbd { min-width: 18px; padding: 0 4px; line-height: 18px; }
@media (max-width: 760px) {
  .qs { width: 100%; max-width: 100%; max-height: 80dvh; margin: 0 0 auto; border-radius: 0 0 var(--radius-card) var(--radius-card); }
  .qs-inp { font-size: 16px; }
}

.ks {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); padding: var(--s5); overflow-y: auto; border: 0;
  border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float);
}
.ks[open] { animation: qs-in var(--t-slow) var(--ease-out); }
.ks::backdrop { background: var(--sheet-backdrop); }
.ks-head { display: flex; align-items: center; gap: var(--s2); }
.ks-head h2 { flex: 1; font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; letter-spacing: -0.015em; }
.ks-p { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.ks-sec { margin-top: var(--s5); }
.ks-sec h3 { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 600; }
.ks-list { margin: var(--s2) 0 0; }
.ks-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 40px; padding: var(--s1) 0; border-bottom: 1px solid var(--rule); }
.ks-row dt { min-width: 0; }
.ks-row dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); margin: 0; }
.ks-keys { display: inline-flex; align-items: center; gap: var(--s1); }
.ks-plus { color: var(--faint); font-size: var(--fs-small); }
@media (max-width: 760px) {
  .ks { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: var(--s4) var(--s4) var(--s6); border-radius: var(--radius-card) var(--radius-card) 0 0; }
  .ks-row { flex-wrap: wrap; row-gap: var(--s1); }
}

.pwa-keys { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.pwa-keys .pwa-k { margin-bottom: var(--s1); }
.pwa-keys-btn { color: var(--text); font-weight: 500; }

.act-ico { display: inline-grid; place-items: center; color: var(--muted); }
.act-ico svg { width: 12px; height: 12px; }

@media (prefers-reduced-motion: reduce) { .qs[open], .ks[open] { animation: none; } .srch-hit { transition: none; } }
