/* My Contacts — parent inquiries mirrored from contact-advocate flow */

.app-contacts-page {
  padding-bottom: calc(var(--fpa-app-space-8) + 8px);
}

.app-contacts-title {
  margin: var(--fpa-app-space-5) 0 0.35rem;
  font-family: var(--fpa-app-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fpa-app-text);
}

.app-contacts-sub {
  margin: 0 0 var(--fpa-app-space-4);
  font-size: 0.95rem;
  color: var(--fpa-app-text-muted);
  line-height: 1.45;
}

.app-contacts-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: var(--fpa-app-space-3);
  margin-bottom: var(--fpa-app-space-3);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.app-contacts-filters::-webkit-scrollbar {
  display: none;
}

.app-contacts-filter {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--fpa-app-radius-pill);
  border: 1px solid var(--fpa-app-nav-border);
  background: var(--fpa-app-hero-bg);
  color: var(--fpa-app-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.app-contacts-filter:hover {
  color: var(--fpa-app-text);
}

.app-contacts-filter--active {
  background: #fff;
  color: var(--fpa-app-text);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.app-contacts-loading {
  margin-top: var(--fpa-app-space-4);
}

/* Same pulse treatment as favorites (app-favorites.css); page does not load that file. */
.app-contacts-skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: var(--fpa-app-space-3);
}

.app-contacts-skeleton-stack .app-loading-line {
  height: 96px;
  border-radius: var(--fpa-app-radius-md);
  background: var(--fpa-app-hero-bg);
  animation: app-contacts-skel-pulse 1.1s ease-in-out infinite;
}

.app-contacts-skeleton-stack .app-loading-line:nth-child(2) {
  animation-delay: 0.12s;
}

.app-contacts-skeleton-stack .app-loading-line:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes app-contacts-skel-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-contacts-skeleton-stack .app-loading-line {
    animation: none;
    opacity: 0.72;
  }
}

.app-contacts-content[hidden] {
  display: none !important;
}

.app-contacts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--fpa-app-space-3) 0 var(--fpa-app-space-6);
}

.app-contacts-empty[hidden] {
  display: none !important;
}

/* Same crop treatment as favorites empty state (app-favorites.css). */
.app-contacts-empty__img-wrap {
  width: min(200px, 72vw);
  height: clamp(104px, 28vw, 128px);
  margin: 0 auto var(--fpa-app-space-4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-contacts-empty__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.app-contacts-empty__title {
  margin: 0 0 var(--fpa-app-space-3);
  font-family: var(--fpa-app-font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fpa-app-text);
  max-width: 20rem;
}

.app-contacts-empty__text {
  margin: 0 0 var(--fpa-app-space-5);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fpa-app-text-muted);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.app-contacts-empty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--fpa-app-radius-pill);
  background: var(--fpa-app-brand);
  color: var(--fpa-app-on-brand);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
}

.app-contacts-empty__btn:hover {
  background: var(--fpa-app-brand-hover);
}

.app-contacts-list {
  display: flex;
  flex-direction: column;
  gap: var(--fpa-app-space-5);
}

.app-contacts-day-group {
  margin: 0;
}

.app-contacts-day-group__label {
  margin: 0 0 var(--fpa-app-space-2);
  font-family: var(--fpa-app-font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fpa-app-text-muted);
  letter-spacing: 0.02em;
}

.app-contacts-day-group__cards {
  display: flex;
  flex-direction: column;
  gap: var(--fpa-app-space-3);
}

.app-contact-card {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--fpa-app-nav-border);
  border-radius: var(--fpa-app-radius-md);
  padding: var(--fpa-app-space-4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.app-contact-card:hover {
  border-color: rgba(91, 124, 153, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.app-contact-card:focus-visible {
  outline: none;
  box-shadow: var(--fpa-app-focus-ring);
}

.app-contact-card__top {
  display: flex;
  gap: var(--fpa-app-space-3);
  align-items: flex-start;
}

.app-contact-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--fpa-app-hero-bg);
}

.app-contact-card__main {
  flex: 1;
  min-width: 0;
}

.app-contact-card__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-contact-card__name-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.app-contact-card__seen {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  border-radius: var(--fpa-app-radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--fpa-app-text-muted);
  background: var(--fpa-app-hero-bg);
  border: 1px solid var(--fpa-app-nav-border);
}

.app-contact-card__seen .material-symbols-outlined {
  font-size: 0.95rem;
  opacity: 0.85;
}

.app-contact-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fpa-app-text);
  letter-spacing: -0.01em;
}

.app-contact-card__chev {
  color: var(--fpa-app-text-muted);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.app-contact-card__loc {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--fpa-app-text-muted);
}

.app-contact-card__loc .material-symbols-outlined {
  font-size: 1rem;
  opacity: 0.85;
}

.app-contact-card__preview {
  margin-top: var(--fpa-app-space-3);
  padding-top: var(--fpa-app-space-3);
  border-top: 1px solid var(--fpa-app-nav-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--fpa-app-space-3);
}

.app-contact-card__preview-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--fpa-app-text-muted);
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-contact-card__preview-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--fpa-app-text-muted);
  font-weight: 500;
}

.app-contacts-gate {
  text-align: center;
  padding: var(--fpa-app-space-6) var(--fpa-app-space-3);
}

.app-contacts-gate[hidden] {
  display: none !important;
}

.app-contacts-gate__title {
  margin: 0 0 var(--fpa-app-space-2);
  font-family: var(--fpa-app-font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.app-contacts-gate__text {
  margin: 0 0 var(--fpa-app-space-5);
  color: var(--fpa-app-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.app-contacts-gate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--fpa-app-radius-pill);
  background: var(--fpa-app-brand);
  color: var(--fpa-app-on-brand);
  font-weight: 600;
  text-decoration: none;
}

/* —— Contact summary bottom sheet (Uber-style) —— */
.app-contacts-sheet {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  font-family: var(--fpa-app-font-sans);
}

.app-contacts-sheet[hidden] {
  display: none !important;
}

.app-contacts-sheet__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.app-contacts-sheet--open .app-contacts-sheet__backdrop {
  opacity: 1;
}

.app-contacts-sheet__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 720px);
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  transform: translate3d(0, 105%, 0);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.app-contacts-sheet--open .app-contacts-sheet__panel {
  transform: translate3d(0, 0, 0);
}

.app-contacts-sheet__handle {
  flex-shrink: 0;
  width: 40px;
  height: 5px;
  margin: 10px auto 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.12);
}

.app-contacts-sheet__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 16px;
  flex-shrink: 0;
}

.app-contacts-sheet__title {
  margin: 0;
  font-family: var(--fpa-app-font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111;
}

.app-contacts-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #444;
  cursor: pointer;
}

.app-contacts-sheet__close:hover {
  background: #f3f3f3;
}

.app-contacts-sheet__close:focus-visible {
  outline: none;
  box-shadow: var(--fpa-app-focus-ring);
}

.app-contacts-sheet__close .material-symbols-outlined {
  font-size: 1.5rem;
}

.app-contacts-sheet__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 24px 8px;
  -webkit-overflow-scrolling: touch;
}

.app-contacts-sheet__profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.app-contacts-sheet__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f3f3;
}

.app-contacts-sheet__profile-main {
  min-width: 0;
  flex: 1;
}

.app-contacts-sheet__profile-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
  line-height: 1.25;
}

.app-contacts-sheet__profile-sub {
  margin-top: 4px;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.35;
}

.app-contacts-sheet__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.app-contacts-sheet__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111;
}

.app-contacts-sheet__chip .material-symbols-outlined {
  font-size: 1.125rem;
  opacity: 0.85;
}

.app-contacts-sheet__divider {
  height: 1px;
  margin: 0 0 20px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
}

.app-contacts-sheet__timeline {
  padding-bottom: 8px;
}

.app-contacts-sheet__stop {
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 14px;
  position: relative;
  padding-bottom: 22px;
}

.app-contacts-sheet__stop:last-child {
  padding-bottom: 0;
}

.app-contacts-sheet__stop:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 2px;
  width: 0;
  border-left: 2px dashed rgba(0, 0, 0, 0.14);
}

.app-contacts-sheet__dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--fpa-app-brand, #276ef1);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  justify-self: center;
}

.app-contacts-sheet__stop--end .app-contacts-sheet__dot {
  background: #111;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.app-contacts-sheet__kicker {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
}

.app-contacts-sheet__detail {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #111;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-contacts-sheet__expand {
  margin-top: 14px;
}

.app-contacts-sheet__expand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #111;
  cursor: pointer;
  text-decoration: none;
}

.app-contacts-sheet__expand-label {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(17, 17, 17, 0.45);
}

.app-contacts-sheet__expand-toggle:hover {
  color: #333;
}

.app-contacts-sheet__expand-toggle:hover .app-contacts-sheet__expand-label {
  text-decoration-color: rgba(51, 51, 51, 0.55);
}

.app-contacts-sheet__expand-toggle:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--fpa-app-focus-ring);
}

.app-contacts-sheet__expand-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.22s ease;
}

.app-contacts-sheet__expand-toggle[aria-expanded="true"] .app-contacts-sheet__expand-icon {
  transform: rotate(180deg);
}

.app-contacts-sheet__expand-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.app-contacts-sheet__expand-panel--open {
  grid-template-rows: 1fr;
}

.app-contacts-sheet__expand-inner {
  min-height: 0;
  overflow: hidden;
}

.app-contacts-sheet__meta-list {
  margin: 0 0 4px;
  padding: 0;
}

.app-contacts-sheet__meta-row {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.app-contacts-sheet__meta-row:last-of-type {
  border-bottom: none;
  padding-bottom: 4px;
}

.app-contacts-sheet__meta-dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #888;
  line-height: 1.35;
}

.app-contacts-sheet__meta-dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111;
  line-height: 1.4;
}

.app-contacts-sheet__expand-inner:has(.app-contacts-sheet__meta-list) .app-contacts-sheet__expand-text {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.app-contacts-sheet__expand-text {
  margin: 0;
  padding-top: 10px;
  padding-bottom: 2px;
  font-size: 0.9375rem;
  line-height: 1.45;
  font-weight: 500;
  color: #111;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
  .app-contacts-sheet__expand-icon,
  .app-contacts-sheet__expand-panel {
    transition: none !important;
  }
}

.app-contacts-sheet__footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px max(20px, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.app-contacts-sheet__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 32px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-contacts-sheet__btn--secondary {
  background: #fff;
  color: #111;
  border: 1.5px solid #111;
}

.app-contacts-sheet__btn--secondary:hover {
  background: #f9f9f9;
}

.app-contacts-sheet__btn--primary {
  background: #111;
  color: #fff;
  border: 1.5px solid #111;
}

.app-contacts-sheet__btn--primary:hover {
  background: #333;
  border-color: #333;
  color: #fff;
}

.app-contacts-sheet__btn:focus-visible {
  outline: none;
  box-shadow: var(--fpa-app-focus-ring);
}

@media (min-width: 768px) {
  .app-contacts-sheet {
    justify-content: center;
    align-items: center;
    padding: 24px;
  }

  .app-contacts-sheet__panel {
    width: 100%;
    max-width: 440px;
    max-height: min(640px, 88vh);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    transform: translate3d(0, 16px, 0) scale(0.97);
    opacity: 0;
    transition:
      transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
      opacity 0.22s ease;
  }

  .app-contacts-sheet--open .app-contacts-sheet__panel {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  .app-contacts-sheet__handle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-contacts-sheet__backdrop,
  .app-contacts-sheet__panel {
    transition: none !important;
  }
}
