/* Contacts: the list, a page per person with the delivery menu, and the
   New Contact card. */

/* Index */

.contacts-heading { position: relative; }

.contacts-heading__title {
  position: relative;
  margin: 0 0 6.6px;
  font-size: 44px;
  line-height: 44px;
  font-weight: 700;
  text-align: center;
}

.contacts-heading__title::before { content: ""; position: absolute; inset: 22px 0 auto; height: 1px; background: var(--color-rule); }
.contacts-heading__title span { position: relative; padding: 0 11px; background: var(--color-sheet); }

.contacts-heading__new,
.contact__write {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 37.19px;
  padding: 5.28px 14.08px 5.28px 38.72px;
  border: 1px solid var(--popup-line);
  border-radius: 33px;
  color: var(--color-ink);
  font-size: 17.6px;
  line-height: 24.64px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.contacts-heading__actions { position: absolute; top: -33px; right: -33px; display: flex; gap: 6px; }

/* "Import" (108×37) sits beside "+ New" in HEY's lighter blue */
.contacts-heading__import {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 37.19px;
  padding: 5.28px 14.08px 5.28px 38.72px;
  border: 1px solid #3072dd;
  border-radius: 33px;
  color: #3072dd;
  font-size: 17.6px;
  line-height: 24.64px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.contacts-heading__import:hover { background: #3072dd; color: #fff; }
.contacts-heading__new:hover, .contact__write:hover { background: var(--color-soft); color: var(--color-ink); }
.contacts-heading__import:focus-visible, .contacts-heading__new:focus-visible, .contact__write:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contacts-heading__new-icon, .contact__write-icon { position: absolute; left: 13px; width: 18px; height: 18px; }

.contact-rows { display: flex; flex-direction: column; padding-bottom: 55px; }

.contact-row {
  display: flex;
  align-items: center;
  gap: 13.2px;
  min-height: 70.7px;
  padding: 9.9px 0;
  border-bottom: 1px solid rgb(var(--ink-rgb) / 0.15);
  color: var(--color-ink);
  text-decoration: none;
}

.contact-row:focus { outline: none; }
.contact-row:focus-visible { border-radius: 8.8px; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-row .avatar { --avatar-size: 44.5px; font-size: 16px; }
.contact-row__who { min-width: 0; }
.contact-row__name { margin: 0; font-size: 19.8px; line-height: 19.8px; font-weight: 700; }
/* Hover, as the reference's contact list: the same faint blue wash */
.contact-row:hover { background: rgb(48 114 221 / 0.05); }
.contact-row__email { display: block; overflow: hidden; color: var(--color-muted); margin-top: 2.2px; font-size: 17.6px; line-height: 19.36px; text-overflow: ellipsis; white-space: nowrap; }

.contacts-empty { margin: 44px 0; color: var(--color-muted); text-align: center; }

/* Contact page */

.contact__header { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar--contact { --avatar-size: 79px; font-size: 28px; }
.contact__name { margin: 0; font-size: 44px; line-height: 44px; font-weight: 700; overflow-wrap: anywhere; }
.contact__email { margin: 4.8px 0 0; color: var(--color-muted); font-size: 15.4px; line-height: 21.56px; }

.contact__options {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46.2px;
  margin: 9.6px 0 0;
  padding: 7.7px;
  border-radius: 33px;
  background: rgb(var(--warm-rgb) / 0.4);
}

.contact-delivery { position: relative; }
.contact-delivery summary { list-style: none; }
.contact-delivery summary::-webkit-details-marker { display: none; }

.contact-delivery__pill {
  --jump-tile-bg: #fff;

  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30.8px;
  padding: 4.6px 12.3px 4.6px 33.9px;
  border-radius: 33px;
  background: var(--color-sheet);
  color: var(--color-accent);
  font-size: 15.4px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.contact-delivery__pill:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
/* The reference's pill icons are drawn 15px across, centred 19.25px in.
   Ours have margins inside their 24-unit boxes, so each box is sized until
   its drawing is 15px. */
.contact-delivery__pill-icon { position: absolute; left: 8.75px; width: 21px; height: 21px; }
.contact-delivery__pill-icon--feed, .contact-delivery__pill-icon--paper_trail { left: 9.25px; width: 20px; height: 20px; }

/* The gradient popup, centred under the pill */
.contact-delivery__menu {
  --jump-tile-bg: var(--popup-surface);

  left: 50%;
  right: auto;
  translate: -50% 0;
}

.contact-delivery__section {
  margin: 8.4px 0 6.7px 8.9px;
  color: var(--popup-muted);
  font-size: 13.475px;
  line-height: 18px;
  font-weight: 600;
  text-transform: uppercase;
}

.contact-delivery__form { display: contents; }

.contact-delivery__tile {
  position: relative;
  width: 100%;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.contact-delivery__tile:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-delivery__tile--current, .contact-delivery__tile--current:hover { background: rgb(var(--shade-rgb) / 0.12); }
.contact-delivery__check { position: absolute; top: 9px; left: 9px; width: 16px; height: 16px; }

/* The other pills: Autofile in…, Set up recycling, Add a note. Unset ones
   read as plain text in the bar; a set one is a white outlined pill. */
.contact__options { gap: 4.4px; }
.contact-option { position: relative; }
.contact-option summary, .contact-view summary { list-style: none; }
.contact-option summary::-webkit-details-marker, .contact-view summary::-webkit-details-marker { display: none; }

.contact-option__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30.8px;
  padding: 4.6px 12.3px 4.6px 33.9px;
  border-radius: 33px;
  color: var(--color-ink);
  font-size: 15.4px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.contact-option__pill:hover { background: rgb(var(--sheet-rgb) / 0.7); }
.contact-option__pill--set, .contact-option__pill--set:hover { background: var(--color-sheet); color: var(--color-accent); }
.contact-option__pill:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-option__pill-icon { position: absolute; left: 8.75px; width: 21px; height: 21px; }
.contact-option__pill-icon--recycle { left: 10.75px; width: 17px; height: 17px; }

.contact-option__menu {
  --jump-tile-bg: var(--popup-surface);

  left: 50%;
  right: auto;
  translate: -50% 0;
}

.contact-recycling__menu { --jump-tile-bg: var(--popup-surface); }

.contact-option__rows { display: flex; flex-direction: column; gap: 2px; margin: 5.3px 0 4.4px; }

.contact-option__row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 9.24px 9.24px 9.24px 42.35px;
  border: 0;
  border-radius: 8.8px;
  background: none;
  color: var(--popup-ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.contact-option__row:hover, .contact-option__row:focus-visible { outline: none; background: rgb(var(--shade-rgb) / 0.06); }
.contact-option__row--current, .contact-option__row--current:hover { background: rgb(var(--shade-rgb) / 0.12); }
.contact-option__row--link { margin-top: 4.4px; border-top: 1px solid rgb(var(--sheet-rgb) / 0.2); border-radius: 0 0 8.8px 8.8px; }
.contact-option__row-icon { position: absolute; left: 13px; width: 19px; height: 19px; }
.contact-option__row-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contact-option__tile {
  position: relative;
  width: 100%;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.contact-option__tile:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-option__tile--current, .contact-option__tile--current:hover { border-color: transparent; background: var(--popup-current); color: var(--popup-current-ink); }

.contact-option__explainer { margin: 0 8.9px; color: var(--popup-muted); font-size: 13.2px; line-height: 18.5px; font-weight: 400; }

/* The private note under the bar */
.contact-note {
  position: relative;
  margin: 13.2px 0 0;
  padding: 13.2px 17.6px 13.2px 48.4px;
  border-radius: 17.6px;
  background: rgb(255 248 207);
}

.contact-note__icon { position: absolute; top: 15.4px; left: 17.6px; width: 19px; height: 19px; color: rgb(201 160 0); }
.contact-note__body p { margin: 0 0 6.6px; font-size: 17.6px; line-height: 24.64px; overflow-wrap: anywhere; }
.contact-note__body p:last-child { margin-bottom: 0; }
.contact-note__edit { position: absolute; top: 13.2px; right: 17.6px; color: var(--color-accent); font-size: 15.4px; font-weight: 500; }
.contact-note:has(.contact-note__edit) .contact-note__body { padding-right: 44px; }
.contact-note__label { display: block; margin-bottom: 6.6px; font-size: 15.4px; line-height: 21.56px; font-weight: 700; }

.contact-note__input {
  display: block;
  width: 100%;
  min-height: 99px;
  padding: 9.9px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 6.6px;
  background: var(--color-sheet);
  color: inherit;
  font: inherit;
  font-size: 17.6px;
  line-height: 24.64px;
  resize: vertical;
}

.contact-note__input:focus { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-note__hint { margin: 6.6px 0 0; color: var(--color-muted); font-size: 13.2px; }
.contact-note__actions { display: flex; align-items: center; gap: 13.2px; margin-top: 11px; }

.contact-note__save {
  height: 37px;
  padding: 0 17.6px;
  border: 1px solid var(--color-accent);
  border-radius: 33px;
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  font-size: 15.4px;
  font-weight: 500;
  cursor: pointer;
}

.contact-note__save:focus-visible, .contact-note__cancel:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-note__cancel { color: var(--color-muted); font-size: 15.4px; }

/* All / From / To */
.contact-view { position: relative; min-width: 0; }

.contact-view__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5.28px 33px 5.28px 14.08px;
  border: 1px solid var(--popup-line);
  border-radius: 33px;
  color: var(--color-ink);
  white-space: nowrap;
  cursor: pointer;
}

.contact-view__pill:hover { background: var(--color-soft); }
.contact-view__pill:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.contact-view__pill .contact__view-label { overflow: hidden; text-overflow: ellipsis; }
.contact-view__icon { position: absolute; right: 12px; width: 14px; height: 14px; color: rgb(var(--ink-rgb) / 0.5); }
.contact-view__menu { left: 0; right: auto; }

.contact__view { display: flex; align-items: center; margin: 33.9px 0 12.78px; }
.contact__view-label { margin: 0; font-size: 17.6px; line-height: 22.84px; font-weight: 500; white-space: nowrap; }
.contact__view-rule { flex: 1; height: 1px; margin-right: 9px; background: var(--color-rule); }

.contact__postings { padding-bottom: 55px; }

.contact__blank {
  display: grid;
  place-items: center;
  margin: 22px 0 55px;
  padding: 44px 0;
  border-radius: 29.7px;
  background: rgb(var(--warm-rgb) / 0.25);
}

.contact__blank p {
  max-width: 534px;
  margin: 0;
  padding: 44px;
  border-radius: 46.2px;
  background: var(--color-sheet);
  box-shadow: 0 0 33px rgb(var(--warm-rgb) / 0.3);
  font-size: 24px;
  line-height: 33.6px;
  text-align: center;
}

/* New Contact */

.contact-new { display: flex; flex-direction: column; align-items: center; }
.contact-new__back { margin: 0 0 24.7px; }
.contact-new__title { margin: 0 0 29.5px; font-size: 44px; line-height: 44px; font-weight: 700; text-align: center; }

.contact-new__card {
  width: min(495px, 100%);
  padding: 39.6px;
  border-radius: 29.7px;
  background: var(--color-sheet);
  box-shadow: 0 2.2px 27.5px rgb(var(--warm-rgb) / 0.5);
}

.contact-new__field { margin-bottom: 24.8px; }
.contact-new__label { display: block; margin-bottom: 6.2px; font-size: 19.8px; line-height: 27.72px; font-weight: 700; }

.contact-new__input {
  width: 100%;
  height: 49.5px;
  padding: 9.9px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 6.6px;
  color: inherit;
  font: inherit;
  font-size: 19.8px;
}

/* A quieter border on focus, not a blue ring (Scott's call) */
.contact-new__input:focus { outline: none; border-color: rgb(var(--ink-rgb) / 0.4); }

.contact-new__save {
  width: 100%;
  height: 41.6px;
  border: 1px solid var(--color-accent);
  border-radius: 33px;
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  font-size: 19.8px;
  font-weight: 500;
  cursor: pointer;
}

/* Import, measured from HEY's at 1512px: a "Back to Contacts" pill over a
   704px sheet, the upload in a tinted panel. */

.contact-import { display: flex; flex-direction: column; align-items: center; }
.contact-import__back { margin: 0 0 24.7px; }
/* The reference's import card stands free: padded and rounded all round */
.sheet.contact-import__sheet { width: min(704px, 100%); min-height: 0; margin-bottom: 12.375px; padding: 55px; border-radius: 29.7px; text-align: center; }
.contact-import__title { margin: 0; font-size: 44px; line-height: 44px; font-weight: 700; }
.contact-import__intro { margin: 19.8px 0 0; font-size: 19.8px; line-height: 27.72px; }
.contact-import__intro a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.contact-import__panel {
  margin-top: 24.8px;
  padding: 32.2px 29.7px;
  border-radius: 19.8px;
  background: linear-gradient(135deg, rgb(48 114 221 / 0.15) 0%, rgb(48 114 221 / 0.15) 100%);
}

.contact-import__form { display: flex; flex-direction: column; align-items: center; gap: 24.7px; }
.contact-import__error { margin: 0 0 16px; color: #8a1f1f; font-size: 17.6px; }

.file-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 49.7px;
  padding-left: 19.8px;
  overflow: hidden;
  border-radius: 33px;
  background: var(--color-sheet);
  text-align: left;
  cursor: pointer;
}

.file-input__field { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-input__text { flex: 1; min-width: 0; overflow: hidden; font-size: 19.8px; line-height: 27.72px; white-space: nowrap; text-overflow: ellipsis; }
.file-input__button { align-self: stretch; display: flex; align-items: center; padding: 11px 16.5px; background: rgb(var(--warm-rgb) / 0.4); color: rgb(var(--ink-rgb) / 0.66); font-size: 19.8px; font-weight: 500; }
.file-input:hover .file-input__button { color: var(--color-ink); }
.file-input:focus-within { box-shadow: 0 0 0 2px rgb(var(--ink-rgb) / 0.15); }

.contact-import__submit {
  height: 41.6px;
  padding: 5.94px 15.84px;
  border: 1px solid var(--color-accent);
  border-radius: 33px;
  background: var(--color-accent);
  color: #fff;
  font-size: 19.8px;
  line-height: 27.72px;
  font-weight: 500;
  cursor: pointer;
}

.contact-import__submit:hover { filter: brightness(0.97); }

/* HEY's "← Back to …" pill, above edit and import pages */
.back-pill {
  display: inline-flex;
  align-items: center;
  height: 37.2px;
  padding: 5.28px 14.08px;
  border: 1px solid var(--popup-line);
  border-radius: 33px;
  background: var(--color-soft);
  color: var(--color-accent);
  font-size: 17.6px;
  line-height: 24.64px;
  font-weight: 500;
  text-decoration: none;
}

.back-pill:hover { background: var(--popup-line); }

.contact-new__errors { margin: 0 0 22px; padding: 0.6rem 1rem 0.6rem 2rem; border-radius: 8px; background: #fde8e8; color: #8a1f1f; }

@media (max-width: 640px) {
  .contacts-heading__actions { top: -54px; right: 0; }
  .contact__options { flex-wrap: wrap; gap: 6px; border-radius: 23px; }
  .contact-option__menu, .contact-delivery__menu { position: fixed; top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; translate: none; }
  .contact-view__pill { white-space: normal; }
  .contacts-heading__title, .contact__name, .contact-new__title { font-size: 34px; line-height: 40px; }
  .contacts-heading__title::before { top: 20px; }
  .contact__view-label { white-space: normal; }
  .contact__blank p { padding: 28px; font-size: 19.8px; line-height: 27.72px; }
  .contact-new__card { padding: 24px 16px; }
}

/* Edit Contact, measured from HEY's at 1512px: the back pill, a two-line
   title, then the 495px card (photo, name, email, the shared note) and
   "Hide this contact" under it. */

.contact__edit { position: absolute; top: 22px; right: 22px; }
.contact__hidden { display: flex; align-items: center; gap: 8.8px; margin: 8.8px 0 0; color: var(--color-muted); font-size: 15.4px; }
.contact__unhide-form { margin: 0; }
.contact__unhide { padding: 0; border: none; background: none; color: var(--color-accent); font: inherit; text-decoration: underline; cursor: pointer; }

.contact-edit .contact-new__back { margin-bottom: 31.4px; }
.contact-edit__title { max-width: 594px; }

.contact-edit__photo { display: flex; flex-direction: column; align-items: center; margin-bottom: 15.5px; text-align: center; }
.contact-edit__photo-form { margin: 12.4px 0 0; }

.contact-edit__upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 37.2px;
  padding: 5.28px 14.08px;
  overflow: hidden;
  border: 1px solid var(--popup-line);
  border-radius: 33px;
  color: var(--color-ink);
  font-size: 17.6px;
  line-height: 24.64px;
  font-weight: 500;
  cursor: pointer;
}

.contact-edit__upload:hover { background: var(--color-soft); color: var(--color-ink); }
.contact-edit__upload:focus-within { box-shadow: 0 0 0 2px rgb(48 114 221 / 0.25); }
.contact-edit__upload-field { position: absolute; width: 1px; height: 1px; opacity: 0; }
.contact-edit__photo-note { margin: 12.3px 0 0; color: var(--color-muted); font-size: 15.4px; line-height: 21.56px; }

.contact-new__input[readonly] { background: rgb(var(--ink-rgb) / 0.03); color: var(--color-muted); }

.contact-edit__shared {
  display: flex;
  gap: 15.4px;
  margin-top: 28.8px;
  padding: 15.4px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgb(255 245 202) 0%, rgb(255 229 214) 100%);
  font-size: 15.4px;
  line-height: 21.56px;
}

.contact-edit__shared-icon { flex: none; width: 24px; height: 24px; margin-top: 2px; color: var(--color-ink); }
.contact-edit__shared-text { margin: 0; }

.contact-edit__hide-form { margin: 29.2px 0 0; }
.contact-edit__hide { padding: 0; border: none; background: none; color: var(--color-muted); font-size: 15.4px; line-height: 21.56px; text-decoration: underline; cursor: pointer; }
.contact-edit__hide:hover { color: var(--color-ink); }

/* Extra email addresses, as HEY's: a field per address 6px under the
   primary, the last one empty to add another. */
.contact-alias { position: relative; margin-top: 6px; }
.contact-alias__input { padding-right: 40px; }
.contact-alias__remove {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 26px;
  height: 26px;
  translate: 0 -50%;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--color-muted);
  font-size: 19.8px;
  line-height: 1;
  cursor: pointer;
}

.contact-alias__input:placeholder-shown + .contact-alias__remove { display: none; }
.contact-alias__remove:hover { background: rgb(var(--ink-rgb) / 0.06); color: var(--color-ink); }

/* The contact's domain, as HEY's: a quiet pill in the sheet's top left */
.contact__domain {
  position: absolute;
  top: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  height: 37.2px;
  padding: 5.28px 14.08px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 33px;
  color: rgb(var(--ink-rgb) / 0.66);
  font-size: 17.6px;
  line-height: 24.64px;
  text-decoration: none;
}

.contact__domain:hover { color: var(--color-ink); border-color: rgb(var(--ink-rgb) / 0.3); }

/* A domain's page, measured from HEY's at 1512px */
.domain__avatar { background: rgb(var(--warm-rgb) / 0.6); color: rgb(var(--ink-rgb) / 0.66); font-size: 36px; }
.contact__name.domain__name { line-height: 57.2px; }
.domain__description { margin: 0; font-size: 17.6px; line-height: 24.64px; }

.domain__contacts { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 6.6px; min-height: 52.2px; margin-top: 17.1px; padding: 1.4px 0 19.8px; }

.domain__contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 1.32px 6.6px 1.32px 29.04px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 33px;
  color: rgb(var(--ink-rgb) / 0.66);
  font-size: 13.2px;
  line-height: 18.48px;
  text-decoration: none;
}

.domain__contact:hover { color: var(--color-ink); }
.domain__contact-icon { position: absolute; left: 9px; width: 14px; height: 14px; }

.domain__heading {
  display: flex;
  align-items: center;
  gap: 7.7px;
  margin: 14.1px 0 0;
  font-size: 15.4px;
  line-height: 15.4px;
  font-weight: 700;
  text-transform: uppercase;
}

.domain__heading::after { content: ""; flex: 1; height: 1px; background: var(--color-rule); }
.domain .box-postings { margin-top: 24.75px; }
.domain__blank { margin: 4px -55px 24.75px; border-radius: 0; }
.domain-screening .contact-option__menu { width: 400px; }
