/* Main-map colors, typography and controls with a simple header/story editor. */
.ancestor-editor { width: 250px; max-width: calc(100vw - 85px); color: #333; font: inherit; }
.ancestor-editor label { display: block; margin: 6px 0; font-weight: bold; }
.ancestor-editor input, .ancestor-editor textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 3px; padding: 6px; border: 1px solid #d6d6d6; border-radius: 5px; background: #fff; color: #333; font: inherit; font-weight: normal; line-height: 1.4; }
.ancestor-editor input { font-weight: bold; }
.ancestor-editor input::placeholder, .ancestor-editor textarea::placeholder { color: #757575; font: inherit; font-weight: normal; opacity: 1; }
.ancestor-editor textarea { min-height: 90px; resize: vertical; }
.ancestor-editor-actions { display: flex; align-items: center; flex-wrap: wrap; }
.ancestor-editor :focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }
.ancestor-editor input:focus, .ancestor-editor textarea:focus { outline: none; box-shadow: none; }
.ancestor-popup .leaflet-popup-content { margin: 10px 12px; max-height: min(540px, 65dvh); overflow-y: auto; }
/* Each theme pairs its frame and colors with locally available print fonts. */
.leaflet-tooltip.header-label.ancestor-header-label {
    --card-paper: #fffcf4;
    --card-border: #b7a585;
    --card-ink: #373329;
    --card-body: #5d5547;
    --card-font: Georgia, 'Times New Roman', serif;
    --card-name-font: Georgia, 'Times New Roman', serif;
    background: var(--card-paper) !important;
    border: 3px double var(--card-border) !important;
    border-radius: 2px;
    padding: 12px 14px;
    color: var(--card-ink);
    box-shadow: 0 2px 7px rgba(58, 47, 30, .15);
}
.leaflet-tooltip.header-label.ancestor-header-label::after {
    bottom: -18px;
    border: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 18px solid var(--card-border);
    filter: none;
}
/* The paper-colored inset overlaps the frame to make a continuous pointer. */
.leaflet-tooltip.header-label.ancestor-header-label::before {
    content: '';
    display: block !important;
    position: absolute;
    z-index: 1;
    top: auto;
    left: 50%;
    bottom: -14px;
    width: 0;
    height: 0;
    margin: 0;
    transform: translateX(-50%);
    border: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 16px solid var(--card-paper);
    pointer-events: none;
}
.ancestor-label { width: 150px; max-width: 60vw; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; }
.ancestor-label strong { display: block; font: 600 18px/1.3 var(--card-name-font); letter-spacing: .2px; color: var(--card-ink); }
.ancestor-label span { display: block; font: 400 13px/1.55 var(--card-font); color: var(--card-body); }
.ancestor-label span::before { content: ''; display: block; width: 42px; height: 1px; margin: 9px auto 8px; background: var(--card-border); }
.ancestor-label span:empty { display: none; }
.leaflet-tooltip.header-label.ancestor-style-sand {
    --card-border: #666660;
}
.leaflet-tooltip.header-label.ancestor-style-modern {
    --card-paper: #fff;
    --card-border: #9aa8b5;
    --card-ink: #243344;
    --card-body: #435366;
    --card-font: 'Segoe UI', Arial, sans-serif;
    --card-name-font: 'Segoe UI', Arial, sans-serif;
    border: 1px solid var(--card-border) !important;
    border-radius: 7px;
}
.ancestor-style-modern .ancestor-label strong { font-size: 17px; letter-spacing: -.2px; }

/* Scale the name, story and frame together without changing the map anchor. */
.leaflet-tooltip.header-label.ancestor-size-small { padding: 9px 11px; }
.ancestor-size-small .ancestor-label { width: 125px; }
.ancestor-size-small .ancestor-label strong { font-size: 15px; }
.ancestor-size-small .ancestor-label span { font-size: 11px; }
.ancestor-size-small .ancestor-label span::before { width: 34px; margin: 7px auto 6px; }
.leaflet-tooltip.header-label.ancestor-size-large { padding: 16px 18px; }
.ancestor-size-large .ancestor-label { width: 190px; }
.ancestor-size-large .ancestor-label strong { font-size: 23px; }
.ancestor-size-large .ancestor-label span { font-size: 16px; }
.ancestor-size-large .ancestor-label span::before { width: 54px; margin: 12px auto 10px; }

/* Compact nameplates leave more space between family locations on all screens. */
    .leaflet-tooltip.header-label.ancestor-header-label { padding: 8px 10px; }
    .ancestor-label strong { font-size: 15px; }
    .ancestor-style-modern .ancestor-label strong { font-size: 14px; }
    .ancestor-label span { font-size: 11px; line-height: 1.4; }
    .ancestor-label span::before { width: 32px; margin: 6px auto 5px; }
    .leaflet-tooltip.header-label.ancestor-size-small { padding: 6px 8px; }
    .ancestor-size-small .ancestor-label strong { font-size: 12px; }
    .ancestor-size-small .ancestor-label span { font-size: 10px; }
    .ancestor-size-small .ancestor-label span::before { width: 26px; margin: 5px auto 4px; }
    .leaflet-tooltip.header-label.ancestor-size-large { padding: 10px 12px; }
    .ancestor-size-large .ancestor-label strong { font-size: 19px; }
    .ancestor-size-large .ancestor-label span { font-size: 13px; }
    .ancestor-size-large .ancestor-label span::before { width: 40px; margin: 8px auto 6px; }

