html:has(.contact-picker[open]) { overflow: hidden; }

[data-contact-channel], .contact-picker :is(a, button) { -webkit-tap-highlight-color: transparent; }

.contact-picker {
  box-sizing: border-box;
  width: min(calc(100% - 2rem), 28rem);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 1.5rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #aa9070;
  border-radius: 1.15rem;
  background: #f7efdc;
  color: #36261b;
  box-shadow: 0 16px 55px #36261b42;
}

.contact-picker::backdrop { background: #291c14a6; }

.contact-picker-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .55rem;
  margin-bottom: .85rem;
}

.contact-picker h2 {
  align-self: center;
  margin: 0;
  font-size: clamp(1.35rem, 4.6vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.contact-picker-heading button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #aa9070;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.contact-picker-choices { display: grid; gap: .45rem; }
.contact-picker-choices a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  align-items: center;
  gap: .8rem;
  padding: .65rem .8rem;
  border: 1px solid #c9b99d;
  border-radius: .65rem;
  background: #fff8e9;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-picker-choices a::after {
  content: '';
  width: .45em;
  height: .45em;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

.contact-picker :is(a, button):hover { background: #eedfc4; }
.contact-picker :is(a, button):focus-visible { outline: 2px solid #804022; outline-offset: 2px; }

@media (max-width: 600px) {
  .contact-picker {
    inset: auto 0 0;
    width: 100%;
    margin: 0;
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom) + .65rem));
    border-radius: 1.15rem 1.15rem 0 0;
  }
}
