/**********************
** Login page styles **
***********************/
.login-page {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
}

.login-page form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 300px;
}
.login-page input[type="text"],
.login-page input[type="password"],
.login-page button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
.login-page button {
    background-color: #007BFF;
    color: #fff;
    border: none;
    cursor: pointer;
}

.login-page button:hover {
    background-color: #0056b3;
}

.login-page .shake {
    animation: shake 0.3s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}
.login-page #errorMessage {
    color: red;
    display: none;
    font-size: 14px;
}

.logout-button-div {
    position: absolute;
    top: 12px;
    right: 15px;
    z-index: 1;
}

.admin-key-button-div {
    position: absolute;
    top: 12px;
    right: 48px; /* sits just to the left of logout icon */
    z-index: 1;
}

.admin-key-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    text-decoration: none;
}

.admin-key-icon {
    width: 22px;
    height: 22px;
    transition: filter 0.2s ease;
    filter: invert(0);
}

.admin-key-button:hover .admin-key-icon {
    filter: brightness(0.6);
    cursor: pointer;
}

/*
.logout-button {
    text-decoration: none;
    padding: 6px 14px;
    background: white;
    color: #414141;
    border-radius: 5px;
    font-size: 12px;
    border: solid #b7b7b7 1px;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: #e8e6e6; 
    color: #000000; 
    border-color: #9c9c9c; 
    cursor:pointer;
}
*/
.logout-button-div {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1;
}

/* No button look */
.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    text-decoration: none;
}

/* Icon base style */
.logout-icon {
    width: 26px;    /* adjust as needed */
    height: 26px;
    transition: filter 0.2s ease;
    filter: invert(0);           /* normal state */
}

/* Strong hover effect to confirm it's working */
.logout-button:hover .logout-icon {
    filter: brightness(0.6);
    cursor: pointer;
}



/**********************
** Main page styles **
***********************/
html, body {
    margin: 0px;
    padding: 0px;
    width: 100%;
    height: 100%;
    font-family: Helvetica;
    overflow: hidden;
}

.website-text {
    /*left: 46px;*/
    left: 8px;
    top: 16px;
    position:absolute;
    cursor: default;
}

body.showing-charts .website-text {
    cursor: pointer;
}

.nav-bar {
    position: fixed; /*absolute;*/
    top: 0;
    left: 0;
    width: 100%;
    height: 45px; 
    background-color: #f8fafd; 
    border-bottom: #dfdfdf solid 1px;
    z-index: 10000; /* High z-index to stay above chart content */
}
.nav-bar-2 {
    display: flex;
    align-items: center; /* vertically centers dropdowns */
    justify-content: space-between;
    flex-wrap: nowrap;
    position: fixed;
    top: 46px;
    left: 0;
    width: 100%;
    height: 32px;
    background-color: #eef3ff; /*#f7f7f7;*/
    border-bottom: #dfdfdf solid 1px;
    z-index: 10000; /* High z-index to stay above chart content */
}

.tree-stats {
    position: absolute;
    top: 5px;
    right: 20px;
}

/*.photo-modal-content table tbody td {
    margin: 4px;
}
.photo-modal-content table thead th {
    font-weight: normal !important;
}*/

#document-count-stat, #people-count-stat {
    margin-right: -5px;
}

#document-count-img, #photo-count-img {
    margin-top: -1px;
}
#document-count-img{
    margin-left:-3px !important;
}

.filter-icon {
    height: 15px;
    margin-top: -6px;
    /*filter: brightness(1.5);*/
    filter: grayscale(1) brightness(1.4);
    transform: translateY(3.5px);
    /*cursor: pointer;*/
}

.settings-icon {
    height: 20px;
    margin-top: -7px;
    /*filter: brightness(1.5);*/
    filter: grayscale(1) brightness(1.4);
    transform: translateY(3.5px);
    /*cursor: pointer;*/
}
/*.settings-icon:hover, .filter-icon:hover {
    filter: brightness(0.6);
}*/

#photo-count-stat {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      cursor: pointer;
      color: #5e5e5e;
      font-size: 11px;
      transition: filter 0.2s;
      filter: brightness(1.2);
}

#people-count-stat, #document-count-stat {
    filter: invert(0.6);
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #5e5e5e;
    font-size: 11px;
    transition: filter 0.2s;
}

#photo-count-stat:hover {
    filter: brightness(0.6);
}
#photo-count-stat.c-disabled {
    filter: invert(0.6);
    cursor: default;
}

#photo-count-stat.c-disabled:hover {
    filter: invert(0.6);
}
.stat-img {
    margin-left: -2px;
}

.navbar-icon {
    font-size: 12px;
    margin-left: 10px;
    margin-top: 16px;
    color: #777777;
}
.navbar-icon .icon-img {
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}

.navbar-icon .icon-img:hover {
  transform: scale(1.1);
  /*filter: brightness(1.2);*/
  opacity: 0.85;
}
.navbar-icon-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
    width: 170px;
}
.icon-img{
    /*left: 12px;*/
    position: absolute;
    /*top: 8px;*/
    top: 12px;
}
/*.logo-text-img {
    margin-left: 10px;
}*/
.root-selector {
    position: relative;
    padding-left: 4px; 
    z-index: 1;
}
.filter-selector {
    position: relative;
    padding-left: 10px;
    z-index: 1;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex-shrink: 1;
}
.chart-tab-inline-host {
    display: none;
}

/* Decorative only (matches filter icon styling); sits before chart picker in charts mode */
.chart-navbar-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}

.chart-navbar-icon {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

body.showing-charts .nav-bar-2 {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
}

body.showing-charts .filter-selector {
    padding-left: 10px;
}

body.showing-charts .root-selector {
    padding-left: 2px;
}

body.showing-charts .chart-tab-inline-host {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin-left: 10px;
}

@media (max-width: 590px) {
    body.showing-charts .filter-selector .nav-select,
    .filter-selector .nav-select {
        width: 110px;
        max-width: 110px;
    }

    body.showing-charts .root-selector .nav-select {
        width: 125px;
    }
}

/* Native selects kept for JS; custom pill UI is .nav-select-trigger */
.nav-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    pointer-events: none !important;
}

.nav-select {
    position: relative;
    flex-shrink: 0;
    width: 120px;
}

/* Slightly wider than 108px so “Direct Ancestors” fits; still narrow enough for icon + one row */
.filter-selector .nav-select,
.nav-select--filter {
    width: 120px;
    max-width: 120px;
}

.root-selector .nav-select {
    width: 145px;
}

.nav-select--display {
    width: auto;
    flex-shrink: 0;
}

/* Settings: standalone icon (same spirit as #fullscreen-button in this bar) */
.tree-view-controls .nav-select-icon-hit.tree-view-settings-img {
    cursor: pointer;
    flex-shrink: 0;
    display: block;
    filter: invert(0.5);
}

.tree-view-controls .nav-select-icon-hit.tree-view-settings-img:hover {
    filter: invert(0.2);
}

.nav-select-icon-hit:focus-visible {
    outline: 2px solid #c9d7ea;
    outline-offset: 2px;
}

.nav-select-trigger {
    box-sizing: border-box;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 10px 5px 10px;
    border-radius: 999px;
    border: 1px solid #d9e2ee;
    background: #f8fafd;
    color: #5f6670;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease,
        box-shadow 0.14s ease;
}

/* Hover/open: white “chip” on nav-bar-2 (#eef3ff) — avoid #eef4fc, which matched the bar */
.nav-select-trigger:hover:not(:disabled),
.nav-select-trigger:focus-visible:not(:disabled),
.nav-select.is-open .nav-select-trigger:not(:disabled) {
    background: #ffffff;
    border-color: #afbdd6;
    color: #4e5968;
    box-shadow: 0 1px 4px rgba(22, 38, 62, 0.1);
    outline: none;
}

.nav-select-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.nav-select-trigger-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #5f6670;
    text-align: left;
}

.nav-select-trigger-chevron {
    flex-shrink: 0;
    font-size: 9px;
    opacity: 0.75;
    margin-left: 1px;
    transition: transform 0.18s ease;
}

.nav-select.is-open .nav-select-trigger-chevron {
    transform: rotate(180deg);
}

.nav-select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    z-index: 10050;
    margin: 0;
    padding: 6px 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #e0e4ef;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(30, 40, 55, 0.12), 0 2px 8px rgba(30, 40, 55, 0.06);
    max-height: min(50vh, 280px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b8c4d6 #eef1f6;
    width: auto;
    box-sizing: border-box;
}

/* Wider panels than the trigger so labels stay on one line */
.nav-select--filter .nav-select-list {
    min-width: 118px;
}

.nav-select--root .nav-select-list {
    min-width: 320px;
}

.nav-select--display .nav-select-list {
    min-width: 152px;
    left: auto;
    right: 0;
}

.nav-select-list::-webkit-scrollbar {
    width: 6px;
}

.nav-select-list::-webkit-scrollbar-track {
    background: #eef1f6;
    border-radius: 999px;
}

.nav-select-list::-webkit-scrollbar-thumb {
    background: #c5cdd9;
    border-radius: 999px;
}

.nav-select-list-item {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    color: #4e5968;
    cursor: pointer;
    transition: background 0.12s ease;
    white-space: nowrap;
}

.nav-select-list-item:hover,
.nav-select-list-item:focus-visible {
    background: #f4f7fc;
    outline: none;
}

.nav-select-list-item.is-selected {
    background: #eef0f8;
    color: #5f73be;
}

#root-selector:disabled {
    cursor: not-allowed;
}

.navbar2-text {
    font-size: 11px;
    color: #888888;
}

.main-page input {
    font-size:14px !important;
}


.sidelines-group {
    display: flex;
    flex-direction: column;
    align-items: center;   /* centers label + icons horizontally */
    justify-content: center;
    margin-left: 6px;     /* keeps a bit of space before stats */
    margin-top: -2px;
}
/* Container for the label + both buttons */
.sidelines-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px; /* space between collapse & expand icons */
    margin-top: 2px;
    margin-right: 8px;
}

/* Small grey label for the control pair */
.sidelines-label {
    text-align: center;
    font-size: 9.5px;
    color: #777;
    margin-bottom: -2px; /* tight spacing */
    letter-spacing: 0.3px;
    padding-right: 7px;
}

.collapse-label, .expand-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.collapse-toggle:hover, .expand-toggle:hover {
    cursor: pointer;
    filter: brightness(0.6);
}

.collapse-toggle, .expand-toggle {
    cursor: pointer;
}

.expand-toggle{
    padding-top: 1px; /*clearly a tiny diff between expand and collapse icon that needed to be accounted for*/
}
.disabled-sideline-btn {
    opacity: 0.35;
    pointer-events: none;      /* disables clicks */
    cursor: default !important;
    filter: none !important;   /* disables your hover dimming */
}

.disabled-sideline-btn img {
    filter: grayscale(100%);
}

/* Binary ancestor tree checkbox toggle */
.binary-tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.binary-tree-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.binary-tree-label input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: #5f73be;
}

.binary-tree-label-text {
    font-size: 9.5px;
    color: #777;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Collapsed sidelines: checkbox is disabled but label still inherited pointer — match root pill */
#collapse-sidelines-toggle .binary-tree-label:has(#collapse-sidelines-checkbox:disabled) {
    cursor: not-allowed;
}

#collapse-sidelines-toggle #collapse-sidelines-checkbox:disabled {
    cursor: not-allowed;
}

/* ──── Binary ancestor tree ──── */

#binary-ancestor-tree {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    overflow: hidden;
    z-index: 2;
}

#binary-ancestor-tree .bat-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    cursor: grab;
}

#binary-ancestor-tree .bat-canvas:active {
    cursor: grabbing;
}

/* Same stack as default .bft-edit-form: above .tree-view-controls, below navbars (10000) */
body.binary-tree-active .bft-edit-form {
    z-index: 9999 !important;
}
body.binary-tree-active .bft-edit-form-close {
    z-index: 101 !important;
}

/* --- Node card (matches Balkan 250×110 template) --- */
.bat-node {
    position: absolute;
    width: 250px;
    height: 110px;
    background: #fff;
    border-radius: 5px;        /* rx="5" ry="5" in Balkan SVG rect */
    border: 2px solid #ccc;
    overflow: visible;         /* cert circles peek below */
    cursor: pointer;
    font-family: Helvetica, 'Segoe UI', Arial, sans-serif;
}

/* Gender-specific border (matching .node.male/female>rect) */
.bat-node.bat-male    { border-color: #4495f7; }
.bat-node.bat-female  { border-color: #fd4a69; }

/* Hover: darken stroke like standard tree (no box-shadow) */
.bat-node.bat-male:hover    { border-color: #0068e5; }
.bat-node.bat-female:hover  { border-color: #d60025; }

/* Colored header strip – inner radius = outer 5px − 2px border = 3px */
.bat-header {
    height: 35px;
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b1b9be;
}

.bat-node.bat-male .bat-header    { background: #6aa3fc; }
.bat-node.bat-female .bat-header  { background: #f56f6f; }

/* Hover header colours (matching .node.male/female:hover .first_rect) */
.bat-node.bat-male:hover .bat-header    { background: #5093fd; }
.bat-node.bat-female:hover .bat-header  { background: #f35858; }

/* Separator line below header, coloured per gender (like Balkan <line y1="32">) */
.bat-node::after {
    content: '';
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    height: 2px;
    background: #b1b9be;
}
.bat-node.bat-male::after    { background: #4495f7; }
.bat-node.bat-female::after  { background: #fd4a69; }

/* Name – matches Balkan node_name: 18px, normal weight, white, centred */
.bat-name {
    color: #fff;
    font-size: 18px;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
    line-height: 35px;
    padding: 0 10px;
}

/* Body: photo + details side by side (mimics Balkan cx=45/cy=71 photo + x=100 text) */
.bat-body {
    display: flex;
    padding: 5px 8px 2px 8px;
    gap: 12px;
    height: 73px;
    box-sizing: border-box;
    align-items: flex-start;
}

/* Circular photo (Balkan clip-path circle r=30 → 60px diameter, centered at cy=71 → ~5px from body top) */
.bat-photo-wrap {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    margin-top: 1px;
}

.bat-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid;
    box-sizing: border-box;
    background: #b1b9be;
    display: block;
}

.bat-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bat-photo-empty::after {
    content: '?';
    font-size: 20px;
    color: #e0e0e0;
}

/* Text fields (match Balkan box1 at y=64 → ~10px into body, box2 at y=84 → ~30px) */
.bat-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    padding-left: 3px;
    align-self: stretch;
}

.bat-dob {
    font-size: 15px;
    color: #5e5e5e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bat-birthplace {
    font-size: 15px;
    color: grey;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
    display: flex;
    align-items: center;
}
.bat-bp-unknown {
    margin-left: 2px;
}

/* Binary “Show all”: stacks mirror Balkan `chart.onField` / templates.main (box1/box2/box3) */
.bat-details > .bat-stack {
    display: none;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.bat-details.bat-display--default .bat-stack-default,
.bat-details.bat-display--cause_of_death .bat-stack-death,
.bat-details.bat-display--birth_to_death .bat-stack-birth-death,
.bat-details.bat-display--age .bat-stack-age,
.bat-details.bat-display--occupation .bat-stack-occupation {
    display: flex;
}

.bat-death-date {
    font-size: 15px;
    color: #5e5e5e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bat-death-cause {
    font-size: 15px;
    color: grey;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Birth–death second line: tighter gap below dob than birthplace row (binary tree only; Balkan uses SVG box2) */
#binary-ancestor-tree .bat-bd-death {
    font-size: 15px;
    color: grey;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bat-details.bat-display--age {
    padding-top: 0;
    justify-content: center;
}

.bat-stack-age {
    align-items: center;
    justify-content: center;
}

/* Age: nudge left/up so the number reads centered in the full card, not only the text column (binary tree only) */
#binary-ancestor-tree .bat-age {
    font-size: 24px;
    color: #898888;
    text-align: center;
    width: 100%;
    line-height: 1.2;
    margin-left: -49px;
    margin-top: -6px;
}

.bat-occupation {
    font-size: 15px;
    color: #5e5e5e;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
}

/* Flag icon inline with birthplace text (exact Balkan size: 28×21) */
.bat-flag {
    width: 28px;
    height: 21px;
    margin-right: 4px;
    flex-shrink: 0;
}

/* ── Additional node icons (camera, military-hat, boat, book) ── */
/* Right-aligned next to the cert circles so there's no gap with fewer icons */
.bat-icons {
    position: absolute;
    bottom: -14px;
    right: 90px;           /* just left of cert area (3×24 + 2×3 + 10 + 2 extra gap) */
    display: flex;
    gap: 2px;
    align-items: center;
}

.bat-icons img {
    width: 28px;
    height: 28px;
}

/* Newspaper icon – vertically centred on the right border */
.bat-newspaper {
    position: absolute;
    top: calc(50% + 6px);
    transform: translateY(-50%);
    right: -17px;
    width: 44px;
    height: 44px;
    opacity: 0.9;
}

/* Cert circles (b / m / d) – vertically centred on the node bottom edge */
.bat-certs {
    position: absolute;
    bottom: -12px;
    right: 10px;
    display: flex;
    gap: 3px;
}

.bat-certs svg {
    display: block;
}

/* SVG connector lines */
.bat-lines {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.bat-lines line {
    stroke: #aeaeae;
    stroke-width: 2;
    stroke-linejoin: round;
}

/* Hollow circle joint at spouse-bar midpoint (matches Balkan toggle--hollow) */
.bat-joint {
    fill: #fafafa;
    stroke: #b1b9be;
    stroke-width: 1.5;
}

#tree {
    position: relative !important;
    width: 100% !important;
    /*height: calc(100vh - 79px) !important;*/ /* fill remaining space under navbars */
    top: 79px !important; /* start below navbars - 79 total inc 1px border-bottoms*/
    left: 0 !important;
}

/*
 * Fullscreen: only #tree is promoted. Reset the normal `top: 79px` / panel height so #tree fills
 * the viewport (navbars are children of #tree but `position: fixed` to the window — see
 * `.bft-edit-form` rule below for z-index / offset).
 */
#tree:fullscreen {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: none !important;
}

/*in fullscreen mode the svg automatically takes 100% of viewport (going under the navbars) unless you overwrite here*/
#tree:fullscreen svg {
    margin-top: 79px;
    /*height: calc(100vh - 79px) !important;*/
    box-sizing: border-box;
}

#tree:fullscreen .tree-stats {
    margin-top: 79px;
    box-sizing: border-box;
}

/*
 * Navbars are inside #tree but `position: fixed; z-index: 10000`. `.bft-edit-form` uses
 * `z-index: 9999` (above `.tree-view-controls` at 9990, below navbars). In fullscreen, start the
 * form below the 79px stack so the name does not sit under the nav.
 */
#tree:fullscreen .bft-edit-form {
    top: 79px !important;
    height: calc(100vh - 79px) !important;
    max-height: calc(100vh - 79px) !important;
    justify-content: flex-start !important;
}

/*
 * Fullscreen: the close SVG is `position: absolute` with `top` in normal mode; inside the tall
 * header (180px) that sits the icon oddly vs the padded title. Use a grid so row 1 is [spacer |
 * title | close] with align-items: center so the X lines up with the name.
 */
#tree:fullscreen .bft-edit-form-header {
    display: grid !important;
    grid-template-columns: 40px 1fr 40px;
    grid-template-rows: auto;
    /* Without this, a single `auto` row stretches to fill the fixed 180px height, vertically
       centering the title + close and leaving a huge gap above — while the avatar stays at top:70px,
       so it lands on top of the name. */
    align-content: start !important;
    align-items: center;
    column-gap: 4px;
    padding: 0 !important;
    box-sizing: border-box;
    height: 180px !important;
    position: relative !important;
}

#tree:fullscreen .bft-edit-form-close {
    position: static !important;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    z-index: 2;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
}

#tree:fullscreen .bft-edit-form-title {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 !important;
    padding: 12px 17px 12px 17px !important;
    width: 100%;
    display: block;
    box-sizing: border-box;
    justify-self: stretch;
    text-align: center !important;
    align-self: start;
}

/*
 * Avatar stays out of the grid (same as Balkan: absolute + centered). Do not use grid row 2 /
 * relative positioning here — that broke horizontal centering and vertical overlap vs normal mode.
 */
#tree:fullscreen .bft-edit-form-avatar {
    position: absolute !important;
    top: 70px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
}


/* Normal mode: tree takes the full panel height */
body:not(.showing-charts) #tree {
  height: calc(100vh - 79px) !important;
}
/* Same specificity + :fullscreen so height wins over the rule above when in fullscreen */
body:not(.showing-charts) #tree:fullscreen {
  height: 100vh !important;
  min-height: 100vh !important;
}
/* Charts mode: let #tree shrink to navbars only */
body.showing-charts #tree {
  height: 79px !important;
}
body.showing-charts #tree:fullscreen {
  height: 100vh !important;
  min-height: 100vh !important;
}
/* In charts mode, hide the Balkan SVG completely */
body.showing-charts #tree svg {
  display: none !important;
}
body.showing-charts .sidelines-group,
body.showing-charts #collapse-sidelines-toggle {
  display: none !important;
}
/* Charts mode: tree-only controls are hidden (not greyed) — they are inert here */
body.showing-charts .tree-view-controls,
body.showing-charts #open-charts-img,
body.showing-charts #apy_toggle_btn {
    display: none !important;
}

body.showing-charts .stat-controls {
    border-right: none;
}

/* In fullscreen mode, chart icon should also be disabled */
#tree:fullscreen #open-charts-img {
    pointer-events: none;
    opacity: 0.4;
    cursor: default;
}


.hover-heart {
  pointer-events: all;
  cursor: pointer;
}

/*.hover-heart.is-collapsed {
  filter: brightness(0) saturate(100%) invert(47%) sepia(100%) saturate(747%) hue-rotate(1deg) brightness(104%) contrast(108%);
}

.hover-heart:hover {
  filter: brightness(0) saturate(100%) invert(22%) sepia(90%) saturate(3381%) hue-rotate(347deg) brightness(99%) contrast(89%);
  cursor: pointer;
}*/
/* Collapsed (+) icon – soft grey instead of orange */

.hover-heart.is-collapsed {
  filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(100%);
}

/* Hover – darker grey highlight, not orange */
.hover-heart:hover {
  filter: brightness(0) saturate(100%) invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(85%) contrast(100%);
  cursor: pointer;
}



.heart-plus {
  font-family: sans-serif;
  font-size: 18px;
  paint-order: stroke;
  stroke: black;
  stroke-width: 0.3;
}
.heart-minus {
  font-weight: bold;
  font-size: 18px;
}

.bft-edit-form {
    /* Below navbars (10000), above .tree-view-controls (9990) and the tree canvas */
    z-index: 9999;
    border-radius: 0em !important;
}

/* Fix edit form positioning in charts mode */
body.showing-charts .bft-edit-form {
    position: fixed !important;
    z-index: 10000 !important;
}


.bft-edit-form-title {
    font-size: 20px !important;
    padding: 12px 17px 12px 17px !important;
}

.bft-edit-form-instruments{
    min-height:10px !important; /*overwrite the default 70px because we've turned off the Edit, Share, To PDF buttons*/
    display: none;
}

.bft-edit-form-fields{
    padding-top: 20px;
    position: relative;
}

/* Top strip: not a Balkan labelled field — label + switch on one row, right-aligned, scrolls with form */
.edit-form-related-facts-strip {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
    margin: 0;
    margin-top: -10px;
}

.edit-form-related-facts-label {
    font-size: 12px;
    color: #6a6a6a;
    white-space: nowrap;
    font-weight: 400;
}

.timeline-related-facts-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.timeline-secondary-toggle-row {
    display: block;
}

.timeline-secondary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: #6a6a6a;
    user-select: none;
}

.timeline-secondary-toggle-label {
    font-weight: 400;
}

.timeline-secondary-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.timeline-secondary-switch-slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    background: #c4c4c4;
    border-radius: 999px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.timeline-secondary-switch-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.timeline-secondary-toggle input:checked + .timeline-secondary-switch-slider {
    background: #5a98f4;
}

.timeline-secondary-toggle input:checked + .timeline-secondary-switch-slider::before {
    transform: translateX(16px);
}

.timeline-related-fact-tag {
    display: inline-block;
    background: #fff1c5;
    border-radius: 2em;
    padding: 1px 7px 2px;
    font-size: 11px;
    line-height: 1.35;
    color: #9a9a9a;
    white-space: nowrap;
}

.male .bft-edit-form-header, .male {
    background-color: #6aa3fc;
    border-radius: 0px;
}

.female .bft-edit-form-header, .female {
    background-color: #f56f6f;
    border-radius: 0px;
}

/* Sex-specific title strip colors (keep scoped to edit form title only) */
.male .bft-edit-form-title {
    background-color: #4c8ff8;
}

.female .bft-edit-form-title {
    background-color: #ed5959;
}

.node {
    cursor: pointer;
    pointer-events: auto;
}

.node * {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.node.male:hover .first_rect {
    fill: #5093fd !important; /*darker blue*/
}
.node.female:hover .first_rect {
    fill: #f35858 !important; /*darker red*/
}
.node.male:hover>rect {
    stroke: #0068e5 !important;
}
.node.female:hover>rect {
    stroke: #d60025 !important;
}

[data-ctrl-up-id] {
    --circle-color: #fff;  /* Default white background */
    --icon-color: #b1b9be; /* Default tree color */
    --border-color: #b1b9be; /* Default border */
}

[data-ctrl-up-id]:hover {
    --icon-color: #818282; /* Change tree to yellow on hover */
}

.node.male>rect {
    fill:#6aa3fc; 
    stroke: #4495f7;
}

.node.male>line {
    stroke: #4495f7;
}

.second_rect {
    fill: white !important;
}

.node.female>rect {
    fill:#f56f6f; 
    stroke: #fd4a69;
}

.node.female>line {
    stroke: #fd4a69;
}

.occupation-li {
    margin-bottom: 5px;
    margin-right: 4px;
    background: #fff1a3;
    border-radius: 2em;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 2px;
    padding-bottom: 2px;
    list-style-type: none;
    display: inline-block;
    color: #757575;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
}

.cause-of-death-li {
    margin-bottom: 5px;
    margin-right: 4px;
    background: #fcdddd;
    border-radius: 2em;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 2px;
    padding-bottom: 2px;
    list-style-type: none;
    display: inline-block;
    color: #757575;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
}

.timeline-li {
    margin-bottom: 14px;
    margin-right: 4px;
    padding-top: 2px;
    padding-bottom: 2px;
    list-style-type: none;
    color: #757575;
}

.timeline-date-age-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
}

.timeline-span {
    background: #ebebea;
    border-radius: 2em;
    padding-left: 4px;
    padding-right: 5px;
    padding-top: 2px;
    padding-bottom: 2px;
    color: #757575;
    display: inline-block;
}

.timeline-age-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: default;
    vertical-align: middle;
}

.timeline-age-hint:focus {
    outline: none;
}

.timeline-age-hint:focus-visible .timeline-age-tag {
    box-shadow: 0 0 0 2px rgba(117, 117, 117, 0.35);
}

.timeline-age-tag {
    background: #f3f3f2;
    border-radius: 2em;
    padding: 1px 7px 2px;
    font-size: 11px;
    line-height: 1.35;
    color: #9a9a9a;
    white-space: nowrap;
}

.timeline-age-tooltip {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(-4px);
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.3;
    color: #fafafa;
    background: rgba(58, 58, 58, 0.9);
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease-out, visibility 0.12s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 100;
}

.timeline-age-hint:hover .timeline-age-tooltip,
.timeline-age-hint:focus .timeline-age-tooltip {
    opacity: 1;
    visibility: visible;
}

.sub_fact_ul {
    margin-top: 5px; 
    padding-left: 20px;
    font-size: 12px;
}

/*reposition the icons that allow you to switch between the ancestors of 2 siblings*/
g[data-ctrl-up-id] > use:first-of-type {
    transform: scale(0.8) translate(69px, 0px);
}

.notes-text-area{
    width: 100%;          
    height: 150px;        
    resize: none;         
    font-family: Arial, sans-serif; 
    font-size: 14px;      
    padding: 10px;        
    border: 1px solid #ccc; 
    box-sizing: border-box; 
    margin-top: 30px;
}

.lineage-confidence-content {
    padding: 5px 10px 10px 10px;
    font: 12px Helvetica, "Segoe UI", Arial, sans-serif;
    color: #5f6368;
}

.lineage-confidence-field .bft-input {
    position: relative;
}

.lineage-confidence-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #7a7a7a;
    font: inherit;
}

.lineage-confidence-pill-anchor {
    position: relative;
    line-height: 1.1;
    display: inline-flex;
    flex-direction: row;
    align-items: flex-start;
    margin-top: 22px; /* place value cleanly below floating label */
}

.lineage-confidence-tooltip-hint {
    display: inline-flex;
    align-items: center;
}

.lineage-confidence-pill {
    font-size: 12px;
    color: #fff;
    font-weight: 400;
    padding: 2px 7px;
    border-radius: 999px;
}

.lineage-confidence-pill-button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.14s ease;
}

.lineage-confidence-pill-caret {
    width: 5px;
    height: 5px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.95);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.95);
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.14s ease, margin-top 0.14s ease;
}

.lineage-confidence-pill-button[aria-expanded="true"] .lineage-confidence-pill-caret {
    transform: rotate(225deg);
    margin-top: 2px;
}

.lineage-confidence-pill-high {
    background: #64c469;
}

.lineage-confidence-pill-button.lineage-confidence-pill-high:hover,
.lineage-confidence-pill-button.lineage-confidence-pill-high:focus-visible {
    background: #56b25b;
}

.lineage-confidence-pill-mid {
    background: #feac33;
}

.lineage-confidence-pill-button.lineage-confidence-pill-mid:hover,
.lineage-confidence-pill-button.lineage-confidence-pill-mid:focus-visible {
    background: #ec9a23;
}

.lineage-confidence-pill-low {
    background: #f25252;
}

.lineage-confidence-pill-button.lineage-confidence-pill-low:hover,
.lineage-confidence-pill-button.lineage-confidence-pill-low:focus-visible {
    background: #df4343;
}

.lineage-confidence-reasoning-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.45;
}

.lineage-confidence-reasoning-panel {
    display: none;
}

.lineage-confidence-reasoning-panel.lineage-confidence-open {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f6f8fb;
    border: 1px solid #e5e9f0;
}

.lineage-confidence-reasoning-heading {
    margin-bottom: 10px;
}

.lineage-confidence-reasoning-text {
    margin-top: 6px;
    line-height: 1.45;
}

#loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid rgba(0, 0, 0, 0.1);
    border-top: 6px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.spinner.small-spinner {
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

body.modal-open {
    overflow: hidden;
}

.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    /*padding: 20px; */
    padding-top: 15px;
    overflow: hidden; 
}

/* Room for fixed All/Known/Mysteries pills — when that row is hidden, center the sheet vertically */
.photo-modal.photo-modal--no-photo-filters {
    padding-top: 0;
}

.photo-modal-content {
    position: relative;
    /* Grid shrink-wraps column width to the photo (tall/narrow images no longer sit in a wide min-width sheet) */
    display: grid;
    grid-auto-rows: auto;
    justify-items: center;
    align-content: start;
    background: #fff;
    padding: 16px 18px 14px;
    box-sizing: border-box;
    width: -moz-fit-content;
    width: fit-content;
    max-width: min(80vw, calc(100vw - 32px));
    min-width: 200px;
    /* Enough height for loading spinner before image/details paint */
    min-height: 100px;
    max-height: 86vh; /* Ensures modal does not exceed viewport height */
    border-radius: 8px;
    text-align: center;
    z-index: 100000;
    /* No outer scroll (avoids default browser bar); image max-height + inner panel scroll only */
    overflow: hidden;
}

.photo-browser-header {
    position: fixed;
    top: clamp(8px, calc(5vh - 30px), 24px);
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100vw - 140px);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0;
    z-index: 100001;
    pointer-events: none;
    flex-wrap: nowrap;
}

.photo-browser-filters {
    width: auto;
    display: flex;
    justify-content: center;
    margin: 0;
    pointer-events: auto;
    flex-wrap: nowrap;
}

.photo-browser-filter-row {
    display: inline-flex;
    gap: 7px;
}

.photo-browser-filter-btn {
    border: 1px solid #d9e2ee;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    color: #5f6670;
    background: #f8fafd;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease, opacity 0.14s ease, border-color 0.14s ease;
}

.photo-browser-filter-btn .photo-browser-filter-count {
    opacity: 0.86;
}

.photo-browser-filter-btn.active {
    background: #5a98f4;
    border-color: #5a98f4;
    color: #fff;
}

.photo-browser-filter-btn:not(.active):hover,
.photo-browser-filter-btn:not(.active):focus-visible {
    background: #eef4fc;
    border-color: #c9d7ea;
}

.photo-browser-filter-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#map-iframe {
    width: 55vw;
    height: 35vw;
    border: 0;
    pointer-events: auto;
}

.map-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 20px;
    max-width: 80%;
    max-height: 90vh; 
    border-radius: 8px;
    text-align: center;
    z-index: 100000;
    overflow: auto; 
}

.admin-activity-modal-content {
    background: #fff;
    border-radius: 10px;
    width: min(1200px, 92vw);
    max-height: 82vh;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    padding: 12px 12px 14px 12px;
}

.admin-activity-title {
    margin: 2px 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #444;
}

.admin-activity-note {
    font-size: 11.5px;
    color: #666;
    margin: -2px 0 10px 0;
}

.admin-activity-note code {
    font-family: Menlo, Consolas, monospace;
    font-size: 11px;
    color: #555;
    background: #f2f2f2;
    padding: 1px 4px;
    border-radius: 4px;
}

.admin-activity-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 8px;
}

#admin-activity-user-filter {
    min-width: 140px;
    max-width: 220px;
    font-size: 12px;
    color: #555;
    border: 1px solid #d3d3d3;
    border-radius: 5px;
    background: #fff;
    padding: 3px 6px;
}

.admin-activity-date-filters {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

.admin-activity-copy-btn {
    margin-left: auto;
    border: 1px solid #d3d3d3;
    background: #fff;
    color: #555;
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 9px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-activity-copy-btn:hover {
    background: #f5f7fc;
}

.admin-date-btn {
    border: 1px solid #d2d5e2;
    background: #fff;
    color: #666;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
}

.admin-date-btn:hover {
    background: #f5f7fc;
}

.admin-date-btn.active {
    border-color: #5f73be;
    background: #5f73be;
    color: #fff;
}

.admin-activity-table-wrap {
    max-height: calc(82vh - 90px);
    overflow: auto;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.admin-activity-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
    color: #444;
}

.admin-activity-table thead th {
    position: sticky;
    top: 0;
    background: #f5f7fb;
    z-index: 1;
    font-weight: 500;
}

.admin-activity-table th,
.admin-activity-table td {
    text-align: left;
    border-bottom: 1px solid #ececec;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-activity-table th:nth-child(1), .admin-activity-table td:nth-child(1) { width: 10%; }
.admin-activity-table th:nth-child(2), .admin-activity-table td:nth-child(2) { width: 13%; }
.admin-activity-table th:nth-child(3), .admin-activity-table td:nth-child(3) { width: 13%; }
.admin-activity-table th:nth-child(4), .admin-activity-table td:nth-child(4) { width: 13%; }
.admin-activity-table th:nth-child(5), .admin-activity-table td:nth-child(5) { width: 8%; }
.admin-activity-table th:nth-child(6), .admin-activity-table td:nth-child(6) { width: 12%; } /* Host */
.admin-activity-table th:nth-child(7), .admin-activity-table td:nth-child(7) { width: 10%; } /* IP */
.admin-activity-table th:nth-child(8), .admin-activity-table td:nth-child(8) { width: 21%; } /* User Agent */

.admin-activity-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.admin-activity-pagination button {
    border: 1px solid #d3d3d3;
    background: #fff;
    color: #555;
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 8px;
    cursor: pointer;
}

.admin-activity-pagination button:disabled {
    opacity: 0.5;
    cursor: default;
}

#admin-activity-page-info {
    font-size: 11.5px;
    color: #666;
    min-width: 86px;
    text-align: center;
}

.map-modal-description {
    margin-top: 12px;
    text-align: left;
    max-height: none;
    overflow-y: visible;
    width: auto;
    min-width: 0;
}

.photo-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
    color: #5f6670;
    background: #f8fafd;
    border: 1px solid #d9e2ee;
    cursor: pointer;
    z-index: 100000; /* Ensures it appears above everything */
    border-radius: 50%;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.photo-nav-btn:hover,
.photo-nav-btn:focus-visible {
    background: #eef4fc;
    border-color: #c9d7ea;
    color: #4e5968;
}

.prev-btn {
    left: 5%;
    display:none;
}

.next-btn {
    right: 5%;
    display:none;
}

.photo-modal-img {
    max-width: 100%;
    /* Leave ~280px for padding, counter, margin, metadata strip; floor so tiny viewports stay valid */
    max-height: min(52vh, max(80px, calc(86vh - 280px)), calc(100dvh - 280px));
    display: block;
    border-radius: 5px;
    object-fit: contain; /* Maintains aspect ratio without cropping */
    min-height: 0;
}

.logout-button:disabled {
    background-color: #ccc !important;  
    color: #666 !important;             
    cursor: not-allowed !important;     
    border: 1px solid #999 !important;  
    opacity: 0.6; 
}

.photo-counter {
    font-size: 13px;
    color: #b5b4b4;
    padding-bottom: 0;
    transform: none;
    max-width: none;
    word-wrap: break-word;
    margin: -8px 0 8px 0;
    padding: 0;
    line-height: 1;
    pointer-events: auto;
    display: block;
    text-align: center;
    white-space: nowrap;
}
/* --- Photo / source modal: metadata under the image --- */
.photo-details-txt {
    font-family: Helvetica, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
    color: #3a4250;
    box-sizing: border-box;
}

/* Metadata strip under image: flat fill; border-top separates from image */
.photo-details-txt.photo-details-txt--visible,
.photo-modal-meta-surface {
    margin-top: 15px;
    padding: 5px 9px 0px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #fafbfe;
    border: none;
    border-radius: 0;
    box-shadow: none;
    /* Readable minimum when DATE and/or PICTURED rows exist (solo NOTES overrides below) */
    min-height: min(100px, 28vh);
    max-height: min(42vh, 300px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: #b8c4d6 #eef1f6;
}

/* One bottom spacer in the scroll box: extends scrollHeight in WebKit without duplicating padding on short (non-scrolling) content */
.photo-details-txt.photo-details-txt--visible::after,
.photo-modal-meta-surface::after {
    content: "";
    display: block;
    height: 8px;
    flex-shrink: 0;
}

/* Solo NOTES only (non-photo sources): hug content — no blank min-height band */
.photo-details-txt.photo-details-txt--notes-only.photo-details-txt--visible {
    min-height: 0;
    max-height: min(46vh, 320px);
}

.photo-modal-meta-surface:has(> .photo-meta-row:only-child) {
    min-height: 0;
}

/* Solo NOTES row (source docs): narrow label column; gap between label and value */
.photo-details-txt.photo-details-txt--notes-only .photo-meta-row {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 11px;
}

.photo-details-txt.photo-details-txt--notes-only .photo-meta-row--prose .photo-meta-label {
    padding-top: 4px;
}

.photo-modal-meta-surface:has(> .photo-meta-row:only-child) .photo-meta-row {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 11px;
}

.photo-modal-meta-surface:has(> .photo-meta-row:only-child) .photo-meta-row--prose .photo-meta-label {
    padding-top: 4px;
}

.photo-modal-meta-surface {
    max-height: min(46vh, 320px);
}

/* Full bleed on white sheet (parent padding 16px 18px 14px) */
.photo-modal-content > .photo-details-txt.photo-details-txt--visible {
    justify-self: stretch;
    margin-left: -18px;
    margin-right: -18px;
    margin-bottom: -14px;
    width: calc(100% + 36px);
    max-width: none;
    border-top: 1px solid #e4e4e4;
}

.map-modal-content > #map-description {
    align-self: stretch;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
    width: calc(100% + 40px);
    max-width: none;
    box-sizing: border-box;
}

/* Fixed label column so DATE / PICTURED / NOTES values line up vertically */
.photo-meta-row {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 0;
    align-items: start;
    padding: 3px 0;
}

/* Separator when a section follows another visible one (handles hidden middle rows) */
.photo-meta-section--after-prior {
    border-top: 1px solid rgba(216, 224, 235, 0.65);
    margin-top: 4px;
    padding-top: 5px;
}

.photo-meta-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7b8798;
    line-height: 1.35;
    padding-top: 1px;
    text-align: left;
    justify-self: stretch;
    min-width: 0;
    word-break: break-word;
}

.photo-meta-value {
    font-size: 13px;
    font-weight: 500;
    color: #2c3340;
    line-height: 1.45;
    text-align: left;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.photo-meta-row--prose .photo-meta-label {
    padding-top: 2px;
}

/* Prose cells: no inner scroll — outer panel scrolls; bottom air via container ::after */
.photo-meta-value--prose {
    font-weight: 400;
    line-height: 1.55;
}

.photo-meta-value--prose a {
    color: #1a5fb4;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.photo-meta-value--prose a:hover {
    color: #0d4a9c;
}

@media (max-width: 480px) {
    .photo-meta-row {
        grid-template-columns: 1fr;
        row-gap: 3px;
    }

    .photo-meta-label {
        white-space: normal;
    }
}

.photo-people,
.photo-date,
.photo-description {
    display: block;
    width: 0;
    min-width: 100%;
    margin: 0;
    padding: 0;
    color: inherit;
}

/* Same thin pill scrollbar as .nav-select-list (navbar2 dropdowns) */
.photo-details-txt::-webkit-scrollbar,
.photo-modal-meta-surface::-webkit-scrollbar,
.photo-description::-webkit-scrollbar,
.photo-modal-content::-webkit-scrollbar {
    width: 6px;
}

.photo-details-txt::-webkit-scrollbar-track,
.photo-modal-meta-surface::-webkit-scrollbar-track,
.photo-description::-webkit-scrollbar-track,
.photo-modal-content::-webkit-scrollbar-track {
    background: #eef1f6;
    border-radius: 999px;
}

.photo-details-txt::-webkit-scrollbar-thumb,
.photo-modal-meta-surface::-webkit-scrollbar-thumb,
.photo-description::-webkit-scrollbar-thumb,
.photo-modal-content::-webkit-scrollbar-thumb {
    background: #c5cdd9;
    border-radius: 999px;
}

.photo-details-txt::-webkit-scrollbar-thumb:hover,
.photo-modal-meta-surface::-webkit-scrollbar-thumb:hover,
.photo-description::-webkit-scrollbar-thumb:hover,
.photo-modal-content::-webkit-scrollbar-thumb:hover {
    background: #aab6c8;
}

.external-link-icon {
    width: 25px;
    height: 25px;
    filter: invert(1); /*white*/
}
.download-doc-icon {
    width: 25px;
    height: 25px;
    filter: invert(1); /*white*/   
}
.download-doc-btn {
    position: fixed;
    top: 12px;
    right: 55px;
    padding: 10px;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.download-doc-btn:hover {
    filter: invert(0.3);
}
.external-link-btn {
    position: fixed;
    top: 15px;
    right: 95px;
    padding: 10px;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.external-link-btn:hover {
    filter: invert(0.3);
}

.close-modal-btn {
    position: fixed;
    top: 10px;
    right: 15px;
    padding: 10px;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.close-modal-icon {
    width: 34px;
    height: 34px;
    filter: invert(1);
}

.close-modal-btn:hover {
    filter: invert(0.3);
}     

.newspaper-edit-form {
    margin-top: -9px;
    margin-bottom: -9px;
} 
.war-edit-form {
    margin-top: -5px;
    margin-bottom: -5px;
} 
.letter-edit-form {
    margin-bottom: -7px;
    margin-top: -10px;
}
.camera-edit-form {
    margin-bottom: -4px;
    margin-top: -4px;
    margin-left: 4px;
}
.crew-list-edit-form {
    margin-bottom: -2px;
}
.family-story-edit-form {
    margin-bottom: -8px;
    margin-top: -8px;
}
.prison-edit-form {
    margin-top: -5px;
    margin-bottom: -5px;
}
.edit-page-tags {
    margin-left: 9px;
    margin-bottom: 10px;
}
.edit-page-tags:empty {
    display: none;
}
.speculative, .inquest {
    font-size: 11px;
    font-weight: normal;
    margin-left: 6px;
    color: white;
    padding: 2px 4px 2px 4px;
    border-radius: 2em;
    position: absolute;
}
.speculative{
    background: #f4ae57;
}
.inquest{
    background: #fb7676;
}

/*hide default library zoom/full-screen controls*/
.bft-toolbar-container {
    position: absolute;
    right: 20px;
    bottom: 20px;
    background: none;
    border: none;
}

.bft-toolbar-container svg {
    display: none !important;
}

.library-controls {
    /*position: absolute;
    right: 15px;*/
    display: flex;
    align-items: center;
    margin-left: auto;
    /*gap: 15px;*/
}
.stat-controls{
    display: flex;
    align-items: center;
    gap: 15px;
    align-self: stretch;
    margin-right: 17px;
}
.fullscreen-control{
    display: flex;
    align-items: center;
    padding-right: 0;
}
.fullscreen-control-exit{
    display: flex;
    align-items: center;
    padding-right: 0;
}
/* Floated top-right on the tree canvas (see `.tree-view-controls`) — not in navbar2 row */
.tree-view-controls {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 9990; /* above tree/SVG, below .bft-edit-form (9999) and navbars (10000) */
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0px 0px 0px 6px;
    background: rgba(247, 249, 252, 0.96);
    border-radius: 10px;
    pointer-events: auto;
}

/*
 * Fullscreen: `#tree` is top:0 so absolute top:10px would sit under the fixed navbars.
 * Align with normal mode (≈79px navbar stack + 10px inset).
 */
#tree:fullscreen .tree-view-controls {
    top: 89px;
}

.zoom-slider-div {
    display: flex;
    align-items: center;
    padding-left: 0;
    padding-right: 2px;
}

.zoom-slider {
    width: 100px;
    cursor: pointer;
    background: #ddd;
    accent-color: #5f73be;
    border-radius: 5px;
    outline: none;
}

#fullscreen-button {
    filter: invert(0.5); 
    width: 28px;
    height: 28px;
    cursor: pointer;
}
#fullscreen-button:hover {
    filter: invert(0.2); 
}

#exit-fullscreen-button {
    filter: invert(0.5);
    width: 18px;
    height: 18px;
    cursor: pointer;
}
#exit-fullscreen-button:hover {
    filter: invert(0.2); 
}
/*overwrite dynamically added font or it will mess positioning up of navbar on fullscreen*/
.bft-light {
    font: inherit !important;
}
/*apply to the input buttons specifically*/
.bft-input {
    font: 13px / 28px Helvetica, "Segoe UI", Arial, sans-serif;
}

/*overwrite the original svg shape to close the edit page which was clunky and replace with the other close icon I'm using throughut the site*/
.bft-edit-form-close {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    right: 8px !important;
    top: 7px !important;
    width: 30px !important;
    height: 30px !important;
    filter: invert(1);
}
.bft-edit-form-close:hover {
    filter: invert(0.2);
}

/* hide the default edit page close icon */
.bft-edit-form-close path {
    display: none !important;
}

.bft-edit-form-header {
    height: 180px !important;
    position: relative;
}

.bft-edit-form-avatar {
    width: 135px !important;
    height: 135px !important;
    top: 70px !important;
    z-index: 2;
}

/* nav-bar-2: hide non-essential pieces at narrower widths (tree vs charts differ) */

/* Tree: informational people/doc counts first */
@media (max-width: 600px) {
  body:not(.showing-charts) #people-count-stat,
  body:not(.showing-charts) #document-count-stat {
    display: none !important;
  }
}

/* Tree: optional toggles (widest labels) before core selectors break */
@media (max-width: 550px) {
  body:not(.showing-charts) #collapse-sidelines-toggle,
  body:not(.showing-charts) #binary-tree-toggle {
    display: none !important;
  }
}

/* Charts: hide doc/photo stats + library strip only when navbar gets tight */
@media (max-width: 675px) {
  body.showing-charts #document-count-stat,
  body.showing-charts #photo-count-stat {
    display: none !important;
  }

  body.showing-charts .library-controls {
    display: none !important;
  }
}

/* Tree: pinch-zoom expected on phones; fullscreen rarely useful — hide the floating zoom pill */
@media (max-width: 650px) {
  .tree-view-controls {
    display: none !important;
  }
}

@media (max-width: 570px) {
  .navbar2-text {
    display: none;
  }
}

.cvd-key {
  font-size: 10px;
  color: #7a7a7a;
  margin-left: 118px;
  transform: translateY(-2px); 
}

.cvd-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  margin-right: 5px;
}

.cvd-icon {
  vertical-align: middle;
}

/* --- SOLID toggles (parents/partners with children) --- */
.toggle:not(.toggle--hollow) circle {
  fill: #b1b9be;
  transition: fill 0.15s ease;
}
.toggle.collapsed:not(.toggle--hollow) circle {
  fill: #f8c733;           /* orange base */
}
.toggle:not(.toggle--hollow):hover circle {
  fill: #9ea5aa;           /* darker grey on hover */
}
.toggle.collapsed:not(.toggle--hollow):hover circle {
  fill: #FF9800;           /* brighter orange on hover */
}

/* --- Cursor --- */
.toggle { cursor: pointer; }
.toggle.toggle--disabled { cursor: default; }

/* --- HOLLOW spouse dots (no children) --- */
/* We draw TWO circles in JS for hollow:
   1) .toggle-mask  (fills background to hide the line)
   2) .toggle-ring  (stroke-only ring) */
.toggle.toggle--hollow .toggle-mask {
  fill: #fff !important;   /* match your light bg; change if dark mode */
}
.toggle.toggle--hollow .toggle-ring {
  fill: none !important;
  stroke: #b1b9be;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.toggle.toggle--hollow:hover .toggle-ring {
  stroke: #9ea5aa;
}

/* --- Symbol text --- */
.toggle-symbol {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 600;
}

.chart-to-tree-link-wrap {
  position: absolute;
  right: 14px;
  bottom: 12px;
  transform: none;
  z-index: 3;
}

.chart-to-tree-link {
  display: inline-block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
  text-decoration: none;
  background: rgba(58, 58, 58, 0.34);
  /*border: 1px solid rgba(255, 255, 255, 0.55);*/
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
}

.chart-to-tree-link:hover {
  background: rgba(58, 58, 58, 0.46);
  border-color: rgba(255, 255, 255, 0.85);
}

.male .chart-to-tree-link {
  background: rgba(72, 132, 223, 0.52);
}

.male .chart-to-tree-link:hover {
  background: rgba(59, 117, 204, 0.66);
}

.female .chart-to-tree-link {
  background: rgba(226, 95, 95, 0.52);
}

.female .chart-to-tree-link:hover {
  background: rgba(212, 83, 83, 0.66);
}

.chart-target-pulse .first_rect,
.chart-target-pulse .second_rect {
  animation: chartTargetPulse 0.7s ease-in-out 3;
}

@keyframes chartTargetPulse {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28) saturate(1.15);
  }
  100% {
    filter: brightness(1);
  }
}
