.gramps-tree {
  --card-bg: #f8fafc;
  --card-border: #e2e8f0;
  --accent: #0ea5e9;
  --text: #0f172a;
  --muted: #475569;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

.gramps-tree__card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.gramps-tree__card:hover,
.gramps-tree__card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.12), 0 8px 32px -8px rgba(0, 0, 0, 0.14);
  outline: none;
}

.gramps-tree__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e0f2fe, #bae6fd);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b486b;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08);
}

.gramps-tree__info {
  flex: 1;
}

.gramps-tree__name {
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.gramps-tree__dates {
  color: var(--muted);
  font-size: 0.9rem;
}

.gramps-tree__row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.gramps-tree__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0f172a;
  border: 1px solid #bae6fd;
}

.gramps-tree__badge.is-family {
  background: #fef9c3;
  border-color: #fde68a;
}

.gramps-tree__spouse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.gramps-tree__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.gramps-tree__info-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #fff;
  position: relative;
}

.gramps-tree__info-panel h4 {
  margin: 0 0 6px 0;
  font-size: 1rem;
}

.gramps-tree__info-panel p {
  margin: 4px 0;
}

.gramps-tree__panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.gramps-tree__photos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.gramps-tree__photos img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  cursor: zoom-in;
}

.gramps-tree__lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.gramps-tree__lightbox.is-open {
  display: flex;
}

.gramps-tree__lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.gramps-tree__lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.gramps-tree__lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(80, 80, 80, 0.4);
  border: none;
  color: #f8fafc;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.6rem;
  width: 1.8em;
  height: 1.8em;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.6));
  transition: background-color 0.2s ease;
}

.gramps-tree__lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(80, 80, 80, 0.4);
  border: none;
  color: #f8fafc;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.8rem;
  width: 1.8em;
  height: 1.8em;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.7));
  transition: background-color 0.2s ease;
}

.gramps-tree__lightbox-prev {
  left: -40px;
}

.gramps-tree__lightbox-next {
  right: -40px;
}

.gramps-tree__lightbox-caption {
  margin-top: 10px;
  color: #f8fafc;
  text-align: center;
  font-size: 0.95rem;
}

.gramps-tree__lightbox-close:hover,
.gramps-tree__lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.35);
}

.gramps-tree__children-wrap {
  margin-left: 24px;
}

.gramps-tree__children {
  border-left: 2px solid var(--card-border);
  padding-left: 14px;
  display: grid;
  gap: 12px;
  padding-top: 12px;
}
