/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 5.1.0
*/

/*************** FAMILY TREE V5 ***************/
.family-tree-shell {
  --ft-line: #b7a58a;
  --ft-marriage: #c88f91;
  --ft-border: #ded6ca;
  --ft-soft: #f8f5f0;
  --ft-soft-2: #fcfaf7;
  --ft-text: #2e2923;
  --ft-muted: #786e62;
  --ft-accent: #806242;
  --ft-card-width: 172px;
  position: relative;
  margin: 26px 0;
  border: 1px solid #e6ddd1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(50, 39, 24, .07);
  overflow: hidden;
}

.family-tree-shell:fullscreen,
.family-tree-shell.is-fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.family-tree-shell:fullscreen .ft-viewport,
.family-tree-shell.is-fullscreen .ft-viewport {
  height: calc(100vh - 190px);
  max-height: none;
}

.ft-toolbar {
  position: relative;
  z-index: 20;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #eee7dd;
  background: linear-gradient(180deg, #fff, #fbf9f6);
}

.ft-toolbar-main,
.ft-toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ft-toolbar-controls {
  margin-top: 11px;
}

.ft-toolbar-title {
  min-width: 180px;
}

.ft-toolbar-title h3 {
  margin: 0 0 3px;
  color: var(--ft-text);
  font-size: 19px;
  line-height: 1.25;
}

.ft-summary {
  display: block;
  color: var(--ft-muted);
  font-size: 12px;
}

.ft-summary strong {
  color: #574837;
}

.ft-view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #dfd6ca;
  border-radius: 10px;
  background: #f5f1eb;
}

.ft-view-button {
  min-height: 32px;
  margin: 0;
  padding: 5px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: #675b4e;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-transform: none;
}

.ft-view-button:hover,
.ft-view-button:focus {
  background: rgba(255, 255, 255, .7);
  color: #3f352b;
}

.ft-view-button.is-active {
  background: #fff;
  box-shadow: 0 1px 5px rgba(61, 45, 25, .1);
  color: #3b3127;
}

.ft-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 270px;
  max-width: 360px;
  margin: 0;
}

.ft-search::before {
  content: '⌕';
  position: absolute;
  left: 11px;
  top: 50%;
  z-index: 1;
  transform: translateY(-52%);
  color: #8e8274;
  font-size: 18px;
  pointer-events: none;
}

.ft-search input[type='search'] {
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0 34px 0 34px;
  border: 1px solid #d9d0c4;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
  color: #3c342c;
  font-size: 13px;
}

.ft-search input[type='search']:focus {
  border-color: #9f896c;
  box-shadow: 0 0 0 3px rgba(159, 137, 108, .12);
}

.ft-search button {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 27px;
  height: 27px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #8a7e70;
  font-size: 19px;
  line-height: 27px;
  text-transform: none;
}

.ft-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.ft-action {
  min-width: 35px;
  height: 34px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid #d9d0c4;
  border-radius: 8px;
  background: #fff;
  color: #4a4035;
  font-size: 14px;
  font-weight: 700;
  line-height: 32px;
  text-transform: none;
  box-shadow: none;
}

.ft-action:hover,
.ft-action:focus {
  border-color: #9d886c;
  background: #f8f4ee;
  color: #2d261f;
}

.ft-action--scale {
  min-width: 52px;
  font-size: 11px;
}

.ft-action--fit,
.ft-action--text {
  min-width: auto;
  font-size: 11px;
}

.ft-helpbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  padding: 8px 14px;
  border-bottom: 1px solid #eee7dd;
  background: #fffdfb;
  color: #887c6e;
  font-size: 10px;
}

.ft-helpbar span::before {
  content: '•';
  margin-right: 6px;
  color: #b39d81;
}

.ft-view-panel[hidden] {
  display: none !important;
}

.ft-viewport {
  width: 100%;
  min-height: 520px;
  max-height: 76vh;
  overflow: auto;
  padding: 42px 34px 58px;
  cursor: grab;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c7b9a7 #f4efe9;
  background:
    radial-gradient(circle at 1px 1px, rgba(135, 113, 85, .105) 1px, transparent 1.3px),
    #fcfbf9;
  background-size: 24px 24px;
}

.ft-viewport::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.ft-viewport::-webkit-scrollbar-track {
  background: #f4efe9;
}

.ft-viewport::-webkit-scrollbar-thumb {
  border: 2px solid #f4efe9;
  border-radius: 10px;
  background: #c7b9a7;
}

.ft-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.ft-canvas {
  display: inline-block;
  min-width: 100%;
  width: max-content;
  transform-origin: top center;
}

.ft-forest {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 86px;
  width: max-content;
  min-width: 100%;
}

.ft-root,
.ft-children {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-root + .ft-root {
  margin-left: 30px;
}

.ft-children {
  padding-top: 48px;
}

.ft-children::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 48px;
  border-left: 2px solid var(--ft-line);
}

.ft-branch {
  position: relative;
  padding: 48px 11px 0;
  text-align: center;
  list-style: none;
}

.ft-root > .ft-branch {
  padding-top: 0;
}

.ft-children > .ft-branch::before,
.ft-children > .ft-branch::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 48px;
  border-top: 2px solid var(--ft-line);
}

.ft-children > .ft-branch::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--ft-line);
}

.ft-children > .ft-branch:only-child::before,
.ft-children > .ft-branch:only-child::after {
  display: none;
}

.ft-children > .ft-branch:only-child {
  padding-top: 0;
}

.ft-children > .ft-branch:first-child::before,
.ft-children > .ft-branch:last-child::after {
  border: 0 none;
}

.ft-children > .ft-branch:last-child::before {
  border-right: 2px solid var(--ft-line);
  border-radius: 0 10px 0 0;
}

.ft-children > .ft-branch:first-child::after {
  border-radius: 10px 0 0 0;
}

.ft-couple {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  vertical-align: top;
}

.ft-spouse-link {
  position: relative;
  display: flex;
  align-items: center;
  width: 40px;
  min-width: 40px;
}

.ft-spouse-link::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--ft-marriage);
}

.ft-spouse-heart {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border: 1px solid #e3c6c6;
  border-radius: 50%;
  background: #fff;
  color: #b85d63;
  font-size: 11px;
  line-height: 1;
}

.ft-person-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: var(--ft-card-width);
  min-height: 182px;
  padding: 13px 11px 12px;
  border: 1px solid var(--ft-border);
  border-top: 4px solid #a49178;
  border-radius: 14px;
  background: #fff;
  color: var(--ft-text);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 7px 20px rgba(58, 45, 28, .085);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease;
}

.ft-person-card.is-male {
  border-top-color: #7898af;
}

.ft-person-card.is-female {
  border-top-color: #bd8f9c;
}

.ft-person-card.is-spouse {
  background: #fffdfb;
}

.ft-person-card.is-auxiliary::after {
  content: 'Phối ngẫu';
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #f5eee8;
  color: #8a7564;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.ft-person-card:hover,
.ft-person-card:focus {
  z-index: 8;
  color: var(--ft-text);
  text-decoration: none;
  transform: translateY(-3px);
  border-right-color: #b7a48c;
  border-bottom-color: #b7a48c;
  border-left-color: #b7a48c;
  box-shadow: 0 11px 28px rgba(58, 45, 28, .14);
}

.ft-person-photo-wrap {
  position: relative;
  display: block;
  width: 70px;
  height: 70px;
  margin-bottom: 8px;
}

.ft-person-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  margin: 0;
  border: 3px solid #f0ebe4;
  border-radius: 50%;
  object-fit: cover;
  background: #eee8df;
}

.ft-person-photo--placeholder {
  color: #8f7c63;
  font-size: 28px;
  font-weight: 700;
}

.ft-gender-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f3f0eb;
  color: #776a5c;
  font-size: 12px;
  font-weight: 700;
}

.is-male .ft-gender-badge {
  background: #e8f1f6;
  color: #55788e;
}

.is-female .ft-gender-badge {
  background: #f7e9ed;
  color: #9c6878;
}

.ft-person-info,
.ft-person-name,
.ft-person-taxonomy,
.ft-person-years {
  display: block;
  width: 100%;
}

.ft-person-name {
  display: -webkit-box;
  overflow: hidden;
  min-height: 38px;
  color: #332b23;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ft-person-taxonomy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.ft-person-taxonomy span {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f3eee7;
  color: #80684d;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
}

.ft-person-years {
  margin-top: 5px;
  color: var(--ft-muted);
  font-size: 10px;
  line-height: 1.35;
}

.ft-person-card.is-deceased .ft-person-photo {
  filter: grayscale(.72);
}

.ft-person-card.is-deceased .ft-person-name::after {
  content: ' †';
  color: #8f8375;
  font-weight: 500;
}

.ft-branch-toggle {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 50px;
  height: 23px;
  margin: 13px auto -1px;
  padding: 0 7px;
  border: 1px solid #cdbda9;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(63, 47, 27, .07);
  color: #725f4b;
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
  text-transform: none;
}

.ft-branch-toggle::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 0;
  height: 14px;
  border-left: 2px solid var(--ft-line);
}

.ft-branch-toggle small {
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.ft-branch.is-collapsed > .ft-children {
  display: none;
}

.ft-branch.is-collapsed > .ft-branch-toggle {
  margin-bottom: 0;
  background: #f4efe8;
}

.ft-person-card.is-search-dimmed {
  opacity: .24;
  filter: grayscale(.35);
}

.ft-person-card.is-search-match {
  z-index: 10;
  opacity: 1;
  border-color: #b8832f;
  box-shadow: 0 0 0 4px rgba(212, 161, 71, .2), 0 12px 28px rgba(58, 45, 28, .16);
}

.ft-person-card.is-focus-pulse {
  animation: ft-focus-pulse 1.4s ease;
}

@keyframes ft-focus-pulse {
  0%, 100% { box-shadow: 0 7px 20px rgba(58, 45, 28, .085); }
  45% { box-shadow: 0 0 0 8px rgba(184, 131, 47, .18), 0 12px 30px rgba(58, 45, 28, .18); }
}

.ft-search-status {
  position: absolute;
  right: 18px;
  top: 115px;
  z-index: 30;
  max-width: 340px;
  padding: 8px 11px;
  border: 1px solid #dfd4c6;
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 18px rgba(52, 40, 25, .08);
  color: #66594b;
  font-size: 11px;
}

.ft-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 22px;
  padding: 10px 16px;
  border-top: 1px solid #eee7dd;
  background: #fff;
  color: var(--ft-muted);
  font-size: 10px;
  flex-wrap: wrap;
}

.ft-legend-line {
  display: inline-block;
  width: 22px;
  height: 0;
  margin-right: 5px;
  vertical-align: middle;
  border-top: 2px solid var(--ft-line);
}

.ft-legend-heart {
  margin-right: 4px;
  color: #b85d63;
  font-style: normal;
}

.ft-legend-gender,
.ft-legend-deceased {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 3px;
  border-radius: 50%;
  font-style: normal;
  font-weight: 700;
}

.ft-legend-gender.is-male {
  background: #e8f1f6;
  color: #55788e;
}

.ft-legend-gender.is-female {
  background: #f7e9ed;
  color: #9c6878;
}

.ft-legend-deceased {
  background: #f2efea;
  color: #766e65;
}

.ft-empty {
  margin: 20px 0;
  padding: 24px;
  border: 1px dashed #d8cdbf;
  border-radius: 12px;
  background: #fbf9f6;
  color: #756a5d;
  text-align: center;
}

/*************** LIST VIEW ***************/
.ft-list-view {
  max-height: 76vh;
  overflow: auto;
  padding: 22px;
  background: #fcfbf9;
}

.ft-list-generation + .ft-list-generation {
  margin-top: 26px;
}

.ft-list-generation-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ded5ca;
}

.ft-list-generation-head h4 {
  margin: 0;
  color: #43382e;
  font-size: 17px;
}

.ft-list-generation-head span {
  color: #8a7e71;
  font-size: 11px;
}

.ft-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 9px;
}

.ft-list-member {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e4ddd3;
  border-radius: 10px;
  background: #fff;
  color: #3c342d;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(57, 43, 26, .035);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.ft-list-member.is-list-search-hidden,
.ft-list-generation.is-list-search-hidden {
  display: none !important;
}

.ft-list-member:hover,
.ft-list-member:focus {
  color: #3c342d;
  text-decoration: none;
  transform: translateY(-1px);
  border-color: #bfae99;
  box-shadow: 0 6px 16px rgba(57, 43, 26, .08);
}

.ft-list-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 50%;
  background: #eee8df;
  color: #88765f;
  font-weight: 800;
}

.ft-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ft-list-body {
  display: block;
  min-width: 0;
}

.ft-list-body strong,
.ft-list-body small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-list-body strong {
  color: #3b322a;
  font-size: 12px;
}

.ft-list-body small {
  margin-top: 2px;
  color: #887d70;
  font-size: 9px;
}

/*************** COMPACT TREE ***************/
.family-tree-shell.is-compact {
  --ft-card-width: 154px;
  margin-top: 18px;
}

.family-tree-shell.is-compact .ft-viewport {
  min-height: 390px;
  max-height: 620px;
}

.family-tree-shell.is-compact .ft-person-card {
  min-height: 164px;
}

.family-tree-shell.is-compact .ft-person-photo-wrap,
.family-tree-shell.is-compact .ft-person-photo {
  width: 60px;
  height: 60px;
}

/*************** MEMBER DETAIL ***************/
.gp-member-page {
  padding: 34px 0 56px;
}

.gp-profile {
  overflow: hidden;
  border: 1px solid #e8e0d6;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 9px 28px rgba(52, 42, 29, .06);
}

.gp-profile-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 28px;
  background: #faf7f2;
}

.gp-profile-photo img {
  width: 100%;
  max-width: 390px;
  max-height: 480px;
  border-radius: 14px;
  object-fit: cover;
}

.gp-profile-photo > .ft-person-photo--placeholder {
  width: 180px;
  height: 180px;
  font-size: 64px;
}

.gp-profile-body {
  padding: 28px 30px;
}

.gp-profile-body h1 {
  margin: 0 0 18px;
  color: #322a22;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
}

.gp-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
}

.gp-meta-row {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0ebe5;
  font-size: 13px;
}

.gp-meta-row dt {
  color: #8a7c6c;
  font-weight: 500;
}

.gp-meta-row dd {
  margin: 0;
  color: #352e27;
  font-weight: 600;
}

.gp-meta-row a {
  color: #6f5538;
  text-decoration: none;
}

.gp-meta-row a:hover {
  text-decoration: underline;
}

.gp-biography {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #eee7de;
  color: #5d5348;
  line-height: 1.75;
}

.gp-relations {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e8e0d6;
  border-radius: 13px;
  background: #fcfaf7;
}

.gp-relations h3 {
  margin: 0 0 12px;
  color: #493c31;
  font-size: 16px;
}

.gp-relation-group + .gp-relation-group {
  margin-top: 10px;
}

.gp-relation-label {
  display: block;
  margin-bottom: 5px;
  color: #8a7c6c;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.gp-relation-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gp-relation-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #ddd2c4;
  border-radius: 999px;
  background: #fff;
  color: #604d3a;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.gp-relation-links a:hover {
  border-color: #ac967a;
  background: #f7f2eb;
}

.gp-section-title {
  margin: 36px 0 12px;
  color: #40352c;
  text-align: center;
}

@media only screen and (max-width: 980px) {
  .ft-toolbar-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .ft-search {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  .ft-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .ft-helpbar {
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
  }

  .gp-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 720px) {
  .family-tree-shell {
    --ft-card-width: 146px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 13px;
  }

  .ft-toolbar {
    padding: 11px 11px 10px;
  }

  .ft-toolbar-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .ft-toolbar-title h3 {
    font-size: 17px;
  }

  .ft-view-switch {
    width: 100%;
  }

  .ft-view-button {
    flex: 1 1 50%;
    padding-left: 7px;
    padding-right: 7px;
  }

  .ft-toolbar-controls {
    margin-top: 9px;
    gap: 9px;
  }

  .ft-action {
    min-width: 32px;
    height: 31px;
    padding-left: 7px;
    padding-right: 7px;
    line-height: 29px;
  }

  .ft-action--fit,
  .ft-action--text {
    font-size: 9px;
  }

  .ft-action--scale {
    min-width: 45px;
  }

  .ft-helpbar {
    padding: 7px 10px;
  }

  .ft-helpbar span:nth-child(n+3) {
    display: none;
  }

  .ft-viewport {
    min-height: 470px;
    max-height: 74vh;
    padding: 32px 14px 44px;
  }

  .ft-forest {
    gap: 50px;
  }

  .ft-branch {
    padding-left: 7px;
    padding-right: 7px;
  }

  .ft-person-card {
    min-height: 160px;
    padding: 11px 8px 10px;
  }

  .ft-person-photo-wrap,
  .ft-person-photo {
    width: 58px;
    height: 58px;
  }

  .ft-person-name {
    min-height: 34px;
    font-size: 11px;
  }

  .ft-spouse-link {
    width: 30px;
    min-width: 30px;
  }

  .ft-spouse-heart {
    width: 19px;
    height: 19px;
    font-size: 9px;
  }

  .ft-person-card.is-auxiliary::after {
    display: none;
  }

  .ft-legend {
    gap: 8px 12px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 9px;
  }

  .ft-list-view {
    padding: 14px 11px;
  }

  .ft-list-grid {
    grid-template-columns: 1fr;
  }

  .ft-search-status {
    left: 12px;
    right: 12px;
    top: 194px;
    max-width: none;
  }

  .gp-member-page {
    padding-top: 18px;
  }

  .gp-profile-photo,
  .gp-profile-body {
    padding: 20px;
  }

  .gp-meta-row {
    grid-template-columns: 86px minmax(0, 1fr);
  }
}


/*************** FAMILY TREE V5.1 - COMPACT DENSITY ***************/
/* Smaller genealogy nodes and spacing for wide descendant trees. */
.family-tree-shell {
  --ft-card-width: 144px;
  margin: 20px 0;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(50, 39, 24, .06);
}

.ft-toolbar { padding: 11px 13px 9px; }
.ft-toolbar-main,
.ft-toolbar-controls { gap: 11px; }
.ft-toolbar-controls { margin-top: 8px; }
.ft-toolbar-title h3 { font-size: 17px; }
.ft-view-button { min-height: 30px; padding: 4px 10px; }
.ft-search { max-width: 330px; }
.ft-search input[type='search'] { height: 34px; font-size: 12px; }
.ft-actions { gap: 4px; }
.ft-action { min-width: 32px; height: 31px; padding: 0 8px; line-height: 29px; }
.ft-action--scale { min-width: 48px; }
.ft-helpbar { gap: 8px 18px; padding: 6px 12px; }

.ft-viewport {
  min-height: 460px;
  max-height: 72vh;
  padding: 28px 24px 40px;
}
.ft-forest { gap: 60px; }
.ft-children { padding-top: 34px; }
.ft-children::before,
.ft-children > .ft-branch::before,
.ft-children > .ft-branch::after { height: 34px; }
.ft-branch { padding: 34px 6px 0; }
.ft-root > .ft-branch { padding-top: 0; }

.ft-spouse-link { width: 28px; min-width: 28px; }
.ft-spouse-heart { width: 18px; height: 18px; font-size: 9px; }

.ft-person-card {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: var(--ft-card-width);
  min-height: 76px;
  padding: 8px;
  border-top-width: 3px;
  border-radius: 10px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(58, 45, 28, .07);
}
.ft-person-card:hover,
.ft-person-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(58, 45, 28, .12);
}
.ft-person-photo-wrap {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0 8px 0 0;
}
.ft-person-photo { width: 44px; height: 44px; border-width: 2px; }
.ft-person-photo--placeholder { font-size: 18px; }
.ft-gender-badge { width: 17px; height: 17px; border-width: 1.5px; font-size: 9px; }
.ft-person-info { flex: 1 1 auto; min-width: 0; }
.ft-person-name { min-height: 0; font-size: 11px; line-height: 1.28; }
.ft-person-taxonomy { justify-content: flex-start; gap: 3px; margin-top: 4px; }
.ft-person-taxonomy span { padding: 1px 4px; font-size: 8px; }
.ft-person-years { margin-top: 3px; font-size: 8.5px; }
.ft-person-card.is-auxiliary::after { top: 4px; right: 4px; padding: 1px 4px; font-size: 7px; }

.ft-branch-toggle {
  min-width: 46px;
  height: 20px;
  margin: 9px auto -1px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 18px;
}
.ft-branch-toggle::before { height: 10px; }
.ft-branch-toggle small { font-size: 7px; }
.ft-legend { padding: 8px 12px; }

.family-tree-shell.is-compact { --ft-card-width: 132px; }
.family-tree-shell.is-compact .ft-person-card { min-height: 70px; }
.family-tree-shell.is-compact .ft-person-photo-wrap,
.family-tree-shell.is-compact .ft-person-photo { width: 38px; height: 38px; }
.family-tree-shell.is-compact .ft-person-photo-wrap { flex-basis: 38px; }

@media only screen and (max-width: 720px) {
  .family-tree-shell { --ft-card-width: 124px; margin-left: -8px; margin-right: -8px; }
  .ft-toolbar { padding: 10px; }
  .ft-toolbar-title h3 { font-size: 16px; }
  .ft-toolbar-controls { gap: 8px; }
  .ft-action { min-width: 30px; height: 29px; padding: 0 6px; line-height: 27px; }
  .ft-action--scale { min-width: 44px; }
  .ft-viewport { min-height: 420px; max-height: 72vh; padding: 24px 10px 34px; }
  .ft-forest { gap: 38px; }
  .ft-branch { padding-left: 5px; padding-right: 5px; }
  .ft-person-card { min-height: 68px; padding: 7px; }
  .ft-person-photo-wrap,
  .ft-person-photo { width: 38px; height: 38px; }
  .ft-person-photo-wrap { flex: 0 0 38px; margin-right: 6px; }
  .ft-person-name { min-height: 0; font-size: 10px; line-height: 1.25; }
  .ft-person-taxonomy span { font-size: 7px; }
  .ft-person-years { font-size: 7.5px; }
  .ft-spouse-link { width: 22px; min-width: 22px; }
  .ft-spouse-heart { width: 17px; height: 17px; font-size: 8px; }
  .ft-branch-toggle { margin-top: 7px; }
}

@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }

  body * {
    visibility: hidden !important;
  }

  .family-tree-shell,
  .family-tree-shell * {
    visibility: visible !important;
  }

  .family-tree-shell {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .ft-toolbar,
  .ft-helpbar,
  .ft-legend,
  .ft-search-status,
  .ft-branch-toggle {
    display: none !important;
  }

  .ft-view-panel[data-ft-panel='tree'] {
    display: block !important;
  }

  .ft-view-panel[data-ft-panel='list'] {
    display: none !important;
  }

  .ft-viewport {
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: #fff;
  }

  .ft-canvas {
    zoom: .62 !important;
  }

  .ft-branch.is-collapsed > .ft-children {
    display: flex !important;
  }

  .ft-person-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
