/* ==========================================================================
   Matches screen: status row + grid of mutual matches.
   ========================================================================== */

.matches-workspace {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: var(--s-6);
}

.section-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-2);
}
.sec-title {
  display: inline-flex; align-items: center; gap: var(--s-2);
  margin: 0;
  font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.01em;
  color: var(--text);
}
.count-badge-quiet { background: var(--surface-raised); color: var(--text-2); border: 1px solid var(--border); line-height: 16px; }

/* ---------- Status row ---------- */
.status-section { border-bottom: 1px solid var(--border); padding-bottom: var(--s-3); }
.status-section > .sec-title { padding: var(--s-4) var(--s-4) var(--s-2); }
.tile-row {
  display: flex; gap: var(--s-4);
  padding: var(--s-1) var(--s-4);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.tile-row::-webkit-scrollbar { display: none; }
.tile {
  flex: none; width: 68px;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding: 0; border: 0; background: none; color: var(--text);
  scroll-snap-align: start;
}
.tile-avatar {
  position: relative;
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  display: grid; grid-template-columns: 100%; grid-template-rows: 100%; place-items: center;
  padding: 3px; box-sizing: border-box;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
}
.tile-avatar img { width: 100%; height: 100%; min-height: 0; border-radius: 50%; object-fit: cover; display: block; }
.tile-avatar > .i { width: 28px; height: 28px; }
.tile-avatar.is-unseen { border-color: var(--primary); }
.tile-avatar.is-seen { border-color: var(--border-strong); }
.tile-avatar.is-empty { border-style: dashed; }
.tile-avatar.is-busy { border-color: var(--info); }
.tile-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  border: 2px solid var(--bg);
  box-sizing: border-box;
}
.tile-badge .i { width: 14px; height: 14px; }
.tile-badge-media { background: var(--surface-raised); color: var(--text); }
.tile-name {
  max-width: 100%;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile:focus-visible { outline-offset: 4px; border-radius: var(--r-sm); }
.i.spin { animation: hm-spin 0.8s linear infinite; }

/* ---------- Match grid ---------- */
.match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4) 0;
}
.match-grid > .empty { grid-column: 1 / -1; }
.match-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--dur-1), background var(--dur-1);
}
.match-card:hover { border-color: var(--border-strong); }
.match-card-open {
  display: flex; flex-direction: column; width: 100%;
  padding: 0; border: 0; background: none; color: inherit; text-align: left;
}
.match-card-photo {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 4 / 5;
  background: var(--surface-raised); color: var(--text-3);
}
.match-card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.match-card-photo > .i { width: 40px; height: 40px; }
.match-card-online {
  position: absolute; left: var(--s-2); bottom: var(--s-2);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--photo-chip); color: var(--on-photo);
  font-size: var(--fs-xs); font-weight: 700;
}
.match-card-online .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.match-card-body { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3); min-width: 0; }
.match-card-name {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-base); font-weight: 700; color: var(--text);
  overflow: hidden; white-space: nowrap;
}
.match-card-name .verified-icon { width: 16px; height: 16px; color: var(--info); flex: none; }
.match-card-sub { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-card-common { color: var(--primary-text); font-weight: 600; }
.match-card-open:focus-visible { outline-offset: -3px; }

@media (min-width: 560px) {
  .match-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Match popup ---------- */
.match-sheet { max-width: 440px; }
.match-body { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; padding-top: var(--s-6); }
.match-avatars { display: flex; align-items: center; justify-content: center; gap: var(--s-3); }
.match-avatars .avatar { border: 2px solid var(--border-strong); color: var(--text-3); display: inline-grid; place-items: center; }
.match-heart { width: 28px; height: 28px; color: var(--primary-text); }
.match-title { margin: 0; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; }
.match-sub { margin: 0; color: var(--text-2); font-size: var(--fs-base); }
.match-reason { margin: 0; padding: var(--s-1) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-sm); }
.match-start { width: 100%; text-align: left; }
.match-start .section-label { padding-left: 0; padding-right: 0; }
.match-chips { flex-direction: column; align-items: stretch; }
.match-chips .chip { height: auto; min-height: 40px; padding: var(--s-2) var(--s-3); white-space: normal; text-align: left; border-radius: var(--r-sm); }
.match-compose { display: flex; gap: var(--s-2); width: 100%; }
.match-compose .input { flex: 1; min-width: 0; }
