.photo-person-details {
    display: flex;
    width: 400px;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.985);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28);
}

.photo-person-details-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid #dedede;
    background: white;
}

.photo-person-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.photo-person-portrait {
    width: 70px;
    height: 92px;
    flex: 0 0 70px;
    overflow: hidden;
    border: 1px solid #d2d2d2;
    border-radius: 8px;
    background: #eeeeee;
}

.photo-person-title {
    min-width: 0;
}

.photo-person-title > span {
    display: block;
    margin-bottom: 4px;
    color: #777;
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.photo-person-title h3 {
    margin: 0 0 5px;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.16;
    text-overflow: ellipsis;
}

.photo-person-title p {
    margin: 0;
    color: #6e6e6e;
    font-size: 11px;
}

.photo-person-close {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    padding: 0;
    place-items: center;
    border: 1px solid #d6d6d6;
    border-radius: 50%;
    background: white;
    color: #555;
    font-size: 19px;
    cursor: pointer;
}

.photo-person-actions {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid #e1e1e1;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.photo-person-action-group {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid #e4e4e4;
    border-radius: 13px;
    background: #f3f3f3;
}

.photo-person-action {
    position: relative;
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #555;
    cursor: pointer;
    transition: transform 130ms ease,
                border-color 130ms ease,
                background 130ms ease,
                color 130ms ease,
                box-shadow 130ms ease;
}

.photo-person-action:hover {
    transform: translateY(-1px);
    border-color: #d1d1d1;
    background: #fff;
    color: #222;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
}

.photo-person-action:focus-visible {
    outline: 3px solid rgba(67, 105, 146, 0.24);
    outline-offset: 2px;
}

.photo-person-action.primary {
    border-color: #303030;
    background: #303030;
    color: white;
}

.photo-person-action.primary:hover {
    border-color: #111;
    background: #111;
    color: #fff;
}

.photo-person-action.kinship {
    background: #fff5e5;
    color: #72501c;
}

.photo-person-action.kinship:hover {
    border-color: #dfbd81;
    background: #ffedcf;
    color: #56390e;
}

.photo-person-action.compare {
    background: #eef5ec;
    color: #45613f;
}

.photo-person-action.compare:hover {
    border-color: #aec4a8;
    background: #e1edde;
    color: #314b2c;
}

.photo-person-action::after {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 50%;
    width: max-content;
    max-width: 210px;
    padding: 7px 9px;
    transform: translate(-50%, -4px);
    border-radius: 8px;
    background: rgba(31, 31, 31, 0.96);
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    content: attr(data-tooltip);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transition: opacity 120ms ease, transform 120ms ease;
}

.photo-person-action:hover::after,
.photo-person-action:focus-visible::after {
    transform: translate(-50%, 0);
    opacity: 1;
}

.photo-person-action-group:first-child .photo-person-action::after {
    left: 0;
    transform: translate(0, -4px);
}

.photo-person-action-group:first-child .photo-person-action:hover::after,
.photo-person-action-group:first-child .photo-person-action:focus-visible::after {
    transform: translate(0, 0);
}

.photo-person-scroll {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    padding: 14px;
}

.photo-person-scroll ::deep .mini-tree-card {
    gap: 12px;
    padding: 13px;
    border-radius: 17px;
}

.photo-person-scroll ::deep .mini-tree-header h3 {
    font-size: 15px;
}

.photo-person-scroll ::deep .tree-node {
    min-width: 145px;
    max-width: 100%;
    padding: 10px 11px;
    border-radius: 14px;
}

.photo-person-scroll ::deep .selected-node {
    min-width: 220px;
}

.photo-person-section {
    padding: 14px;
    border: 1px solid #dfdfdf;
    border-radius: 17px;
    background: #fbfbfb;
}

.photo-person-section h4 {
    margin: 0 0 11px;
    font-size: 15px;
}

.photo-person-muted {
    margin: 0;
    color: #777;
    font-size: 12px;
    line-height: 1.4;
}

.photo-union-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-union-card {
    padding: 11px;
    border: 1px solid #dedede;
    border-radius: 14px;
    background: white;
}

.photo-union-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.photo-union-header strong {
    font-size: 12px;
}

.photo-union-header span {
    padding: 3px 6px;
    border-radius: 999px;
    background: #f3dfdf;
    color: #7b3434;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.photo-union-people {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.photo-union-people button,
.photo-union-children button {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid #dedede;
    border-radius: 11px;
    background: #fafafa;
    color: #222;
    text-align: left;
    cursor: pointer;
}

.photo-union-people button:hover,
.photo-union-children button:hover {
    border-color: #999;
    background: #f0f0f0;
}

.photo-union-people button strong,
.photo-union-children button {
    font-size: 11px;
}

.photo-union-people button span {
    color: #777;
    font-size: 10px;
}

.photo-union-event {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    color: #666;
    font-size: 10px;
}

.photo-union-event strong {
    color: #333;
}

.photo-union-children {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #eeeeee;
}

.photo-union-label {
    display: block;
    margin-bottom: 6px;
    color: #777;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.photo-union-children > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.photo-person-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.photo-person-info-grid > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 9px;
    border-radius: 11px;
    background: white;
}

.photo-person-info-grid span {
    color: #777;
    font-size: 9px;
    text-transform: uppercase;
}

.photo-person-info-grid strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .photo-person-details {
        width: min(400px, calc(100vw - 32px));
    }
}

.photo-person-comparison-note {
    display: block;
    padding: 4px 8px;
    color: #6b6b6b;
    font-size: 11px;
    font-style: italic;
    text-align: center;
}

.photo-person-comparison-note.toolbar-note {
    flex: 0 0 auto;
    margin: 8px 14px 0;
    padding: 7px 10px;
    border: 1px solid #ccd7c8;
    border-radius: 999px;
    background: #f4f8f2;
    color: #54634f;
    font-style: normal;
    font-weight: 700;
}
