/* Smart Matching Groups – Find / Listing Cards */

.find-dropdown {
  position: fixed;
  z-index: 50;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 6px;
  min-width: 160px;
}
.find-dropdown.hidden { display: none !important; }
.find-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #111b21;
  cursor: pointer;
}
.find-dropdown button:active { background: #e6f2fb; }
:root[data-theme="dark"] .find-dropdown { background: #202c33; }
:root[data-theme="dark"] .find-dropdown button { color: #e9edef; }

.find-box h3 { margin: 0 0 10px; color: #0056a3; }
.find-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.find-tab {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 10px;
  background: #e6f2fb;
  color: #0056a3;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.find-tab.active {
  background: #0078D4;
  color: #fff;
}
.find-pane { overflow-y: auto; max-height: 60vh; }
.find-query, .find-filter, .find-body {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.find-body { resize: vertical; min-height: 100px; }
.find-filters { display: flex; gap: 8px; }
.find-filters .find-filter { flex: 1; min-width: 0; }
.post-image-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.post-image-row .sheet-btn { flex: 0 0 auto; width: auto; padding: 8px 12px; }

.find-results-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.find-results-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.listing-card {
  background: #f7fafc;
  border: 1px solid #dbe7f0;
  border-left: 4px solid #0078D4;
  border-radius: 12px;
  padding: 10px 12px;
}
.listing-card[data-type="request"] { border-left-color: #0078D4; }
.listing-card[data-type="product"] { border-left-color: #00a884; }
.listing-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.listing-title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  color: #0f3d6e;
  line-height: 1.3;
}
.listing-badges { display: flex; gap: 4px; flex-shrink: 0; }
.listing-score {
  background: #0078D4;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  padding: 2px 6px;
}
.listing-vip {
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  padding: 2px 6px;
}
.listing-img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin: 4px 0 6px;
  display: block;
}
.listing-body {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.listing-expand {
  border: 0;
  background: transparent;
  color: #0078D4;
  font-size: 12px;
  padding: 0 4px;
  cursor: pointer;
}
.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}
.listing-contact {
  flex: 0 0 auto;
  min-width: 88px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 18px;
  background: #00a884;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.listing-contact:disabled { opacity: 0.5; }
.listing-own {
  font-size: 12px;
  font-style: italic;
}

:root[data-theme="dark"] .listing-card {
  background: #1f2c33;
  border-color: #2a3942;
}
:root[data-theme="dark"] .listing-title { color: #b8dcf5; }
:root[data-theme="dark"] .find-query,
:root[data-theme="dark"] .find-filter,
:root[data-theme="dark"] .find-body {
  background: #2a3942;
  border-color: #3b4a52;
  color: #e9edef;
}
:root[data-theme="dark"] .find-tab { background: #0a2e4d; color: #b8dcf5; }
:root[data-theme="dark"] .find-tab.active { background: #0078D4; color: #fff; }

.find-browse-list {
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-right: 2px;
}
.find-pane {
  overflow-y: auto;
  max-height: 70vh;
  -webkit-overflow-scrolling: touch;
}

.listing-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 2px;
}
.listing-fact {
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  color: inherit;
  opacity: 0.9;
}
.theme-dark .listing-fact,
html.dark .listing-fact,
body.dark .listing-fact {
  background: rgba(255,255,255,0.08);
}
.listing-meta-left {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
