/* ── Search ───────────────────────────────────── */
.search-wrap {
  position: relative;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.search-input-wrap:focus-within { border-color: var(--accent); }

.search-icon {
  font-size: 18px;
  color: var(--text-secondary);
}

.search-input-wrap input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  width: 180px;
}

.search-input-wrap input::placeholder { color: var(--text-tertiary); }

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 4px 4px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 20;
}

.search-results.visible { display: block; }

.search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.search-result:hover { background: var(--accent-bg); }

.search-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
}

.search-avatar.male { background: var(--male); color: #000; }
.search-avatar.female { background: var(--female); color: #000; }
.search-avatar.unknown { background: var(--unknown); color: #fff; }

.search-result-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-result-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-dates {
  font-size: 11px;
  color: var(--text-secondary);
}

.search-empty {
  padding: 10px;
  color: var(--text-tertiary);
  text-align: center;
}

/* ── Detail panel content ─────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 12px 12px;
}

.detail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.detail-avatar.male { background: var(--male); color: #000; }
.detail-avatar.female { background: var(--female); color: #000; }
.detail-avatar.unknown { background: var(--unknown); color: #fff; }

.detail-header-info {
  flex: 1;
  min-width: 0;
}

.detail-name {
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
}

.detail-dates {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.detail-close {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-close:hover { color: var(--text); background: var(--accent-bg); }

/* Provenance card */
.prov-card {
  margin: 0 12px 12px;
  padding: 8px 10px;
  background: var(--bg-recessed);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.prov-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prov-dot.verified { background: var(--verified); }
.prov-dot.sourced { background: var(--sourced); }
.prov-dot.entered { background: var(--entered); }
.prov-dot.inferred { background: var(--inferred); }

.prov-label { font-weight: 500; }
.prov-detail { color: var(--text-secondary); margin-left: auto; font-family: 'Roboto Mono', monospace; font-size: 10px; }

/* Section tabs */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
}

.detail-tab {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Tab content */
.detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.detail-section { display: none; }
.detail-section.active { display: block; }

/* Family list */
.family-group { margin-bottom: 12px; }

.family-group-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}

.family-member {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
}

.family-member:hover { color: var(--accent); }

.family-member .gender-dot {
  width: 5px;
  height: 5px;
}

.family-member-name { font-weight: 500; }

.family-member-meta {
  color: var(--text-secondary);
  font-size: 11px;
  margin-left: auto;
}

/* Source cards */
.source-card {
  padding: 8px 10px;
  background: var(--bg-recessed);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
}

.source-title {
  font-weight: 500;
  font-size: 12px;
}

.source-title a {
  color: var(--accent);
  text-decoration: none;
}

.source-title a:hover { text-decoration: underline; }

.source-publisher {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.source-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.source-rank-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 500;
}

.source-rank-badge.authoritative { background: var(--verified); color: #000; }
.source-rank-badge.reliable { background: var(--sourced); color: #000; }
.source-rank-badge.unverified { background: var(--entered); color: #000; }

.source-score {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary);
}

/* Picker (for path finder) */
.picker-wrap {
  position: relative;
}

.picker-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  outline: none;
}

.picker-input:focus { border-color: var(--accent); }

.picker-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 25;
}

/* ── Timeline ─────────────────────────────────── */
.timeline-filters {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.filter-chip {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-chip.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.timeline-band:hover {
  filter: brightness(1.2);
}

/* ── Stats ────────────────────────────────────── */
.stat-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
