/* ──────────────────────────────────────────────────────────────────────
   Apollo Search Upgrades — P1-6 (saved searches, anomalies,
   neighbourhood card, +Similar redesign, district two-line label).

   All rules are scoped under classes introduced in this batch so
   nothing here interferes with the existing search / dashboard
   stylesheets.
   ──────────────────────────────────────────────────────────────── */

/* ─── Saved searches menu ─────────────────────────────────────────── */
.saved-searches-menu {
  position: relative;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.saved-searches-trigger {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
}
.saved-searches-trigger:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.saved-searches-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 320px;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 0.6rem;
}
.ssm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.ssm-action {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
}
.ssm-action:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
}
.ssm-action:disabled { opacity: 0.45; cursor: not-allowed; }
.ssm-action-share { margin-left: auto; }

.ssm-msg {
  font-size: 0.75rem;
  color: #2563eb;
  background: #eef4ff;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.4rem;
}

.ssm-body { padding-top: 0.2rem; }
.ssm-body-save { display: flex; gap: 0.4rem; align-items: center; }
.ssm-body-save .ss-input { flex: 1; }

.ssm-empty {
  color: #888;
  font-size: 0.82rem;
  padding: 0.6rem 0.2rem;
}
.ssm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
.ssm-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.2rem;
  border-bottom: 1px solid #f0f1f3;
  font-size: 0.85rem;
}
.ssm-list-item:last-child { border-bottom: 0; }
.ssm-pick {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
  color: var(--navy);
  font-size: 0.85rem;
  text-align: left;
}
.ssm-pick:hover .ssm-pick-name { color: #2563eb; text-decoration: underline; }
.ssm-pick-name { font-weight: 500; }
.ssm-pick-date { color: #888; font-size: 0.75rem; }
.ssm-del {
  background: transparent;
  border: 0;
  color: #aaa;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.35rem;
}
.ssm-del:hover { color: #c33; }

/* ─── Anomaly dot in leftmost column ──────────────────────────────── */
.cell-anomaly {
  position: relative;
}
.anomaly-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e6a23c;            /* amber — subtle */
  box-shadow: 0 0 0 2px rgba(230, 162, 60, 0.18);
  vertical-align: middle;
}
/* Hover ring to communicate interactivity (tooltip is the title attr) */
.anomaly-dot:hover {
  background: #d48806;
  box-shadow: 0 0 0 3px rgba(230, 162, 60, 0.28);
}

/* ─── District / muni two-line label ─────────────────────────────── */
.cell-place-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.cell-place-latin { font-weight: 500; }
.cell-place-greek {
  font-size: 0.7rem;
  color: #999;
  letter-spacing: 0.02em;
}

/* ─── +Similar action button — visually obvious as "go to Compare" ── */
.btn-similar {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  background: #eef4ff;             /* subtle blue background */
  border: 1px solid #c7d8f7;
  color: #1d4ed8;                  /* tailwind blue-700 */
  border-radius: 3px;
  cursor: pointer;
  font-weight: 500;
  transition: background 100ms ease, border-color 100ms ease;
}
.btn-similar:hover {
  background: #dbeafe;
  border-color: #93b9f4;
}
.btn-similar:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.btn-similar-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  /* Two-arrow Lucide-style "search-with-arrow" — kept inline to avoid
     pulling in lucide for one icon. 2px stroke, currentColor. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ─── Neighbourhood card ──────────────────────────────────────────── */
.neighbourhood-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}
.nc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.7rem;
}
.nc-title-primary {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}
.nc-title-sub {
  font-size: 0.78rem;
  color: #666;
}
.nc-greek {
  letter-spacing: 0.04em;
  color: #999;
  margin-left: 0.25rem;
}
.nc-headline { text-align: right; }
.nc-headline-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.nc-headline-label {
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.15rem;
}
.nc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.nc-panel {
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
}
.nc-panel-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.nc-no-data {
  font-size: 0.78rem;
  color: #999;
  font-style: italic;
}
.nc-mix-fallback {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}
.nc-mix-name { color: var(--navy); }
.nc-mix-pct { color: #666; }
.nc-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
}
.nc-recent-item {
  display: grid;
  grid-template-columns: 6.5em 1fr 5em 5em;
  gap: 0.4rem;
  padding: 0.18rem 0;
  border-bottom: 1px dashed #eef0f3;
}
.nc-recent-item:last-child { border-bottom: 0; }
.nc-recent-date { color: #555; font-variant-numeric: tabular-nums; }
.nc-recent-type { color: var(--navy); }
.nc-recent-area, .nc-recent-ppm {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.nc-caption {
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #eef0f3;
}

/* Compact-down at narrower widths — keep desktop-only contract intact */
@media (max-width: 1440px) {
  .nc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nc-panel:nth-child(3) { grid-column: span 2; }
}
