/* Screen 4: Crossed Paths */

.cp-scroll {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.cp-scroll::-webkit-scrollbar { display: none; }

/* ---------- Header (sticks to the top while the list scrolls) ---------- */
.cp-header {
  position: sticky; top: 0;
  z-index: 3;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--status-h) + 10px);
  padding-bottom: 14px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  background: rgba(5, 4, 7, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.cp-heading { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cp-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  letter-spacing: -0.01em;
}
.cp-sub { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.cp-header-actions { display: flex; gap: 6px; flex: none; }
.cp-icon-btn, .filter-btn.cp-filter {
  width: 42px; height: 42px; border-radius: 14px;
  margin-top: 0;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
}
.cp-icon-btn { color: var(--accent-light); }
.cp-icon-btn svg { width: 21px; height: 21px; }

.cp-content {
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 6px;
  padding-bottom: 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Summary ---------- */
.cp-summary {
  padding: 16px 18px;
  border-radius: 24px;
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(157, 92, 255, 0.24), transparent 60%),
    var(--surface);
  border: 1px solid rgba(185, 139, 255, 0.32);
  display: flex; flex-direction: column; gap: 14px;
}
.cp-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp-summary-big { margin: 6px 0 0; font-size: 16px; font-weight: 700; line-height: 1.3; color: #d9d5e3; }
.cp-summary-big b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--fg); line-height: 1.1; }
.cp-summary-faces { display: flex; flex: none; }
.cp-summary-faces img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a1525;
  margin-left: -12px;
  box-shadow: 0 0 10px rgba(157, 92, 255, 0.3);
}
.cp-summary-faces img:first-child { margin-left: 0; }
.cp-summary-stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 12px; }
.cp-summary-stats div { display: flex; align-items: baseline; gap: 8px; }
.cp-summary-stats div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.cp-summary-stats b { font-size: 20px; font-weight: 800; color: var(--accent-light); font-variant-numeric: tabular-nums; }
.cp-summary-stats span { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.3; }

.cp-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.cp-list-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.cp-list-head span {
  min-width: 26px; padding: 3px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; font-weight: 800; text-align: center; color: var(--muted);
}
.cp-clear { font-size: 13px; font-weight: 800; color: var(--accent-light); }
.cp-list { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Person card ---------- */
.cp-card {
  border-radius: 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.cp-card.strong {
  border-color: rgba(185, 139, 255, 0.45);
  box-shadow: 0 0 28px rgba(157, 92, 255, 0.2);
}
.cp-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 6 / 5;
  max-width: 100%;
  overflow: hidden;
  background: #0d0a14;
  text-align: left;
}
.cp-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; transition: transform 0.4s; }
.cp-photo:hover img { transform: scale(1.03); }
.cp-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 30%, transparent 55%, rgba(18, 16, 25, 0.95));
  pointer-events: none;
}
.cp-badge, .cp-match, .cp-name { position: absolute; z-index: 1; }
.cp-badge {
  top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 6, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px; font-weight: 800;
}
.cp-badge svg { width: 13px; height: 13px; color: var(--accent-light); }
.cp-badge.new {
  background: var(--fg); color: #0b0911;
  border-color: transparent;
  letter-spacing: 0.12em;
}
.cp-match {
  top: 14px; right: 14px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(8, 6, 14, 0.6);
  border: 1px solid rgba(185, 139, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 700; color: #d9d5e3;
}
.cp-match b { color: var(--fg); font-weight: 800; }
.cp-card.strong .cp-match {
  background: rgba(157, 92, 255, 0.55);
  border-color: rgba(210, 182, 255, 0.6);
  box-shadow: 0 0 18px rgba(157, 92, 255, 0.55);
  color: #fff;
}
.cp-name {
  left: 16px; right: 16px; bottom: 12px;
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
.cp-name span { font-family: var(--font-body); font-weight: 500; font-size: 22px; color: #d9d5e3; }

.cp-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.cp-where { display: flex; align-items: center; gap: 12px; }
.cp-pin {
  flex: none;
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-light);
}
.cp-pin svg { width: 19px; height: 19px; }
.cp-where-title { margin: 0; font-size: 14px; font-weight: 600; color: #d9d5e3; }
.cp-where-time { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.cp-venue { font-weight: 800; color: var(--fg); border-bottom: 1px solid rgba(185, 139, 255, 0.5); }
.cp-venue:hover { color: var(--accent-light); }

.cp-repeat {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(157, 92, 255, 0.08);
  border: 1px solid rgba(185, 139, 255, 0.18);
}
.cp-repeat p { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #d9d5e3; line-height: 1.4; }
.cp-repeat svg { flex: none; width: 15px; height: 15px; color: var(--accent-light); }
.cp-note { margin: 6px 0 0 !important; font-size: 13px !important; font-weight: 700 !important; color: var(--accent-light) !important; font-style: italic; }

.cp-shared { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cp-shared-label { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: #17131f;
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: #d9d5e3;
}
.cp-tag.link { border-color: rgba(185, 139, 255, 0.4); color: var(--fg); }

.cp-actions { display: grid; }
.cp-hi { min-height: 46px; border-radius: 15px; font-size: 15px; }

.cp-footer { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------- Empty state ---------- */
.cp-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 36px 24px;
  border-radius: 24px;
  border: 1px dashed #3a3350;
  text-align: center;
}
.cp-empty-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-light);
  box-shadow: 0 0 20px rgba(157, 92, 255, 0.3);
  margin-bottom: 6px;
}
.cp-empty-icon svg { width: 26px; height: 26px; }
.cp-empty-title { margin: 0; font-size: 17px; font-weight: 800; }
.cp-empty-text { margin: 0 0 8px; font-size: 14px; color: var(--muted); max-width: 30ch; }

/* ---------- Sheets ---------- */
.cp-sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }

.cp-hi-sheet { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; text-align: center; }
.cp-hi-sheet .cp-sheet-actions { width: 100%; margin-top: 12px; }
.cp-hi-photo {
  width: 84px; height: 84px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-light);
  box-shadow: 0 0 0 5px rgba(157, 92, 255, 0.18), 0 0 28px rgba(157, 92, 255, 0.45);
  margin-bottom: 6px;
}
.cp-hi-title { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 800; }
.cp-hi-context { margin: 0; font-size: 15px; color: #d9d5e3; }
.cp-hi-context b { color: var(--fg); }
.cp-hi-note { margin: 0; font-size: 12px; color: var(--muted); max-width: 34ch; }

.cp-privacy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 8px; }
.cp-privacy-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-light);
}
.cp-privacy-icon svg { width: 26px; height: 26px; }
.cp-privacy p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; color: #d9d5e3; }
.cp-privacy .btn { align-self: stretch; }

/* ---------- Invites button + connected badge (Screen 6 hooks) ---------- */
.cp-icon-btn.cp-invites { position: relative; color: var(--fg); }
.cp-icon-btn.cp-invites.has-invites {
  color: var(--accent-light);
  border-color: rgba(185, 139, 255, 0.55);
  box-shadow: 0 0 16px rgba(157, 92, 255, 0.35);
}
.cp-badge.connected {
  background: rgba(157, 92, 255, 0.55);
  border-color: rgba(210, 182, 255, 0.6);
  box-shadow: 0 0 14px rgba(157, 92, 255, 0.45);
}
.cp-badge.connected svg { color: #fff; }

/* header with three buttons: title + buttons on one row, subtitle full width below */
.cp-header:not(.iv-header) {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
}
.cp-header:not(.iv-header) .cp-heading { display: contents; }
.cp-header:not(.iv-header) .cp-title { grid-column: 1; grid-row: 1; white-space: nowrap; font-size: 21px; }
.cp-header:not(.iv-header) .cp-icon-btn,
.cp-header:not(.iv-header) .filter-btn.cp-filter { width: 40px; height: 40px; }
.cp-header:not(.iv-header) .cp-header-actions { grid-column: 2; grid-row: 1; }
.cp-header:not(.iv-header) .cp-sub { grid-column: 1 / -1; grid-row: 2; }
@media (max-width: 370px) {
  .cp-header:not(.iv-header) .cp-title { font-size: 18px; }
}
/* 320px phones: title and three buttons still share one row */
.cp-header:not(.iv-header) { grid-template-columns: minmax(0, 1fr) auto; }
.cp-header:not(.iv-header) .cp-title { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 340px) {
  .cp-header:not(.iv-header) { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); column-gap: 6px; }
  .cp-header:not(.iv-header) .cp-title { font-size: 16px; }
  .cp-header:not(.iv-header) .cp-header-actions { gap: 4px; }
}

/* entry to Who's Your Vibe (Screen 11) */
.cp-vibe-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(157, 92, 255, 0.12);
  border: 1px solid rgba(185, 139, 255, 0.3);
  font-size: 12.5px; font-weight: 700; color: var(--accent-light);
  text-align: left;
}
.cp-vibe-link span { flex: 1; }
.cp-vibe-link svg { flex: none; width: 15px; height: 15px; }
button.cp-summary-faces { border-radius: 999px; }
button.cp-summary-faces:active { transform: scale(0.96); }
