.contacts-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
  container-type: inline-size;
}

.contacts-panel {
  --contact-accent: #dcbd80;
  min-width: 0;
  padding: clamp(15px, 2.1vw, 26px);
  border: 1px solid #65563b;
  border-top: 2px solid var(--contact-accent);
  border-radius: 7px;
  background: linear-gradient(150deg, #25271fe8, #131812f2 70%);
  color: var(--text-1);
}
.contacts-blocked { --contact-accent: #c78f79; border-color: #5d4a40; border-top-color: var(--contact-accent); }
.contacts-panel header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.contacts-panel h3 { margin: 0; color: var(--contact-accent); font-size: 19px; font-weight: 650; line-height: 1.35; }
.contacts-panel [data-contact-count] { color: #c9c0a8; white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.contacts-hint, .contacts-empty, .contacts-load, .contacts-feedback { font-size: 13px; line-height: 1.5; }
.contacts-hint { margin: 5px 0 17px; color: #bab5a4; }
.contacts-form { display: flex; gap: 7px; }
.contacts-form input {
  flex: 1; width: 0; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #5b5545;
  border-radius: 4px; background: #101410; color: #eee9da; font: inherit; font-size: 14px;
}
.contacts-form input::placeholder { color: #a29d90; }
.contacts-add, .contacts-load button {
  min-height: 40px; padding: 5px 13px; border: 1px solid #84704d; border-radius: 4px;
  background: #3b3525; color: #f5e4be; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
}
.contacts-add:hover:not(:disabled), .contacts-load button:hover { background: #484030; border-color: var(--contact-accent); }
.contacts-workspace button:disabled { opacity: .55; cursor: default; }
.contacts-workspace :is(input,button):focus-visible { outline: 2px solid var(--contact-accent, #dcbd80); outline-offset: 2px; }
.contacts-results { margin-top: 5px; max-height: 215px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #605b4a; background: #1a201a; border-radius: 4px; }
.contacts-results[hidden], .contacts-empty[hidden] { display: none; }
.contacts-match { display: flex; gap: 8px; justify-content: space-between; align-items: center; width: 100%; min-height: 42px; padding: 5px 10px; background: transparent; color: var(--contact-accent); border: 0; text-align: start; font: inherit; cursor: pointer; }
.contacts-match:hover:not(:disabled) { background: #35372b; }
.contacts-feedback { color: #e0bd9b; margin-top: 6px; }
.contacts-feedback:empty { display: none; }
.contacts-list { list-style: none; margin: 14px 0 0; padding: 0; }
.contacts-entry { display: flex; align-items: center; min-width: 0; min-height: 53px; gap: 8px; border-top: 1px solid #79715c4d; }
.contacts-identity { display: flex; align-items: center; flex: 1; min-width: 0; gap: 9px; }
.contacts-identity > span:last-child { display: grid; min-width: 0; gap: 1px; }
.contacts-identity strong, .contacts-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts-identity strong { color: #ece6d3; font-size: 14px; line-height: 1.35; font-weight: 650; }
.contacts-identity small { font-size: 11px; line-height: 1.35; color: #b5b3a1; }
.contacts-emblem { width: 29px; height: 29px; flex: none; display: grid; place-items: center; }
.contacts-emblem img { width: 100%; height: 100%; object-fit: contain; }
.contacts-presence { display: inline-flex; gap: 5px; align-items: center; flex: none; color: #b4b0a3; font-size: 11px; }
.contacts-presence::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; background: #88897f; }
.contacts-presence.is-online { color: #b4d6a0; }
.contacts-presence.is-online::before { background: #91bc78; }
.contacts-remove { display: grid; place-content: center; flex: none; width: 34px; min-height: 38px; padding: 0; border: 0; background: transparent; color: #a69c86; font-size: 20px; cursor: pointer; }
.contacts-remove:hover { color: #efbb9d; }
.contacts-empty { margin: 0; padding: 14px 0 1px; border-top: 1px solid #79715c4d; color: #b5b3a1; }
.contacts-load { grid-column: 1 / -1; margin: 0; color: #d3c5a9; }
@container (max-width: 640px) { .contacts-panel { grid-column: 1 / -1; } }
@media (pointer: coarse) { .contacts-form input { min-height: 44px; font-size: 16px; } .contacts-add, .contacts-match, .contacts-remove { min-height: 44px; } }
