.ft-family-tree-wrapper {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
    overflow-x: auto;
    max-width: 100%;
    font-family: Arial, sans-serif;
}

.ft-family-tree-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.ft-family-tree-controls select,
.ft-family-tree-controls input[type="text"] {
    padding: 4px 6px;
    min-width: 180px;
}

.ft-family-tree-controls button {
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
}

.ft-orientation-btn.ft-orientation-active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

#ft-tree-container {
    min-height: 40px;
}

.ft-placeholder,
.ft-no-members {
    color: #666;
    font-style: italic;
}

.ft-tree-root {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Orientation */
.ft-orientation-vertical .ft-tree-root {
    align-items: center;
}

.ft-orientation-horizontal .ft-tree-root {
    align-items: flex-start;
}

.ft-node-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

/* Vertical connectors (parent -> child arrow) */
.ft-orientation-vertical .ft-node-wrapper.ft-has-parent::before {
    content: "";
    position: absolute;
    top: -25px;
    left: 50%;
    width: 2px;
    height: 25px;
    background: #999;
}

.ft-orientation-vertical .ft-node-wrapper.ft-has-parent::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(50% - 4px);
    border-width: 6px 4px 0 4px;
    border-style: solid;
    border-color: #999 transparent transparent transparent;
}

/* Horizontal connectors: left-to-right arrow */
.ft-orientation-horizontal .ft-node-wrapper.ft-has-parent::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -30px;
    width: 30px;
    height: 2px;
    background: #999;
}

.ft-orientation-horizontal .ft-node-wrapper.ft-has-parent::after {
    content: "";
    position: absolute;
    top: calc(50% - 4px);
    left: 0;
    border-width: 4px 0 4px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #999;
}

/* Base node box */
.ft-node-box {
    display: inline-block;
    position: relative;
}

/* SINGLE person style (for roots without spouse or single people) */
.ft-node-single .ft-person-box {
    border-radius: 999px;
    border: 3px solid #ccc;
    padding: 10px 18px;
    background: #fff;
    min-width: 140px;
    text-align: center;
}

/* COUPLE style */
.ft-node-couple {
    padding: 8px 10px;
    border-radius: 40px;
    background: transparent;
}

.ft-couple-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ft-person-box {
    border-radius: 999px;
    border: 3px solid #ccc;
    padding: 10px 16px;
    background: #fff;
    min-width: 130px;
    text-align: center;
    box-sizing: border-box;
}

.ft-person-left { }
.ft-person-right { }

.ft-couple-heart {
    font-size: 18px;
    color: #e91e63;
}

/* Text inside circles */
.ft-node-title {
    font-weight: bold;
    margin-bottom: 3px;
}

.ft-node-meta {
    font-size: 11px;
    color: #555;
}

.ft-dob {
    display: inline-block;
    margin-right: 4px;
}

.ft-gender-icon {
    margin-right: 4px;
}

.ft-relation {
    font-size: 11px;
    color: #444;
    margin-left: 4px;
}

/* Gender border colors */
.ft-gender-male {
    border-color: #2196f3;
}

.ft-gender-female {
    border-color: #e91e63;
}

.ft-gender-other {
    border-color: #9c27b0;
}

/* Relation background tints */
.ft-rel-father    { background: #e3f2fd; }
.ft-rel-mother    { background: #fce4ec; }
.ft-rel-son       { background: #e8f5e9; }
.ft-rel-daughter  { background: #fff8e1; }
.ft-rel-brother   { background: #e1f5fe; }
.ft-rel-sister    { background: #f3e5f5; }
.ft-rel-uncle     { background: #f1f8e9; }
.ft-rel-aunt      { background: #fff3e0; }
.ft-rel-cousin    { background: #f9fbe7; }
.ft-rel-spouse    { background: #ede7f6; }
.ft-rel-other     { background: #eceff1; }

/* Highlight search results */
.ft-node-box.ft-highlight,
.ft-node-box.ft-highlight .ft-person-box {
    box-shadow: 0 0 0 3px #ff9800;
}

/* Children container */
.ft-children {
    margin-top: 30px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}
