:root {
    --tv-ink: #1f2937; --tv-muted: #6b7280; --tv-line: #e5e7eb; --tv-bg: #f6f7f4;
    --tv-green: #2f5d50; --tv-green-2: #3f7a69; --tv-m: #2563eb; --tv-f: #db2777; --tv-u: #6b7280;
}
body { background: var(--tv-bg); color: var(--tv-ink); }
.tv-header { background: linear-gradient(90deg, var(--tv-green), var(--tv-green-2)); color: #fff; position: sticky; top: 0; z-index: 20; }
.tv-brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 1.15rem; }
.tv-brand:hover { color: #e7f3ee; }
.tv-search { min-width: 240px; max-width: 360px; flex: 1; }

.tv-hero { background: #fff; border: 1px solid var(--tv-line); border-inline-start: 6px solid var(--tv-u); border-radius: .75rem; padding: 1.25rem 1.5rem; }
.tv-hero.sex-m { border-inline-start-color: var(--tv-m); } .tv-hero.sex-f { border-inline-start-color: var(--tv-f); }
.tv-name { font-size: 1.9rem; font-weight: 650; margin: 0; }
.tv-candle { font-size: 1.3rem; }
.tv-hebrew { font-family: "SBL Hebrew", "Ezra SIL", "Frank Ruehl CLM", "Times New Roman", serif; font-size: 1.5rem; color: #374151; }
.tv-heb-small { font-family: "SBL Hebrew", "Times New Roman", serif; color: var(--tv-muted); }
.tv-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--tv-muted); margin-top: .35rem; }

.tv-h2 { font-size: 1.05rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--tv-green); margin: 1.25rem 0 .6rem; }
.tv-panel { background: #fff; border: 1px solid var(--tv-line); border-radius: .75rem; padding: 1rem 1.1rem; }
.tv-yahrzeit + .tv-yahrzeit { border-top: 1px dashed var(--tv-line); margin-top: .5rem; padding-top: .5rem; }

/* Life events timeline */
.tv-timeline { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--tv-line); border-radius: .75rem; overflow: hidden; }
.tv-timeline li { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--tv-line); }
.tv-timeline li:first-child { border-top: 0; }
.tv-timeline li.relative { background: #fafaf8; color: #4b5563; }
.tv-timeline li.tag-birt .tv-label, .tv-timeline li.tag-deat .tv-label, .tv-timeline li.tag-marr .tv-label { font-weight: 650; }
.tv-date { font-weight: 600; }
.tv-date-eq { font-size: .82rem; color: var(--tv-muted); }
.tv-label span { color: var(--tv-muted); }
.tv-age { margin-inline-start: .4rem; font-size: .8rem; background: #eef2f1; color: var(--tv-green) !important; border-radius: 1rem; padding: 0 .45rem; }
.tv-value { color: #374151; }
.tv-place, .tv-cite { font-size: .85rem; color: var(--tv-muted); }
.tv-note, .tv-note-block { white-space: pre-line; font-size: .9rem; background: #fffbea; border-inline-start: 3px solid #f2d27a; padding: .3rem .6rem; margin-top: .3rem; }
@media (max-width: 575.98px) { .tv-timeline li { grid-template-columns: 1fr; gap: .2rem; } }

/* Family */
.tv-family { background: #fff; border: 1px solid var(--tv-line); border-radius: .75rem; padding: .8rem; margin-bottom: .8rem; }
.tv-family-title { font-weight: 650; margin-bottom: .5rem; }
.tv-family-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tv-muted); margin: .7rem 0 .35rem; }
.tv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.tv-stack { display: grid; gap: .4rem; }
.tv-self { font-size: .9rem; color: var(--tv-muted); padding: .2rem .6rem; }

.tv-card { display: block; text-decoration: none; color: var(--tv-ink); background: #fbfbfa; border: 1px solid var(--tv-line); border-inline-start: 4px solid var(--tv-u);
           border-radius: .5rem; padding: .45rem .65rem; line-height: 1.25; transition: background .15s, box-shadow .15s; }
a.tv-card:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); color: var(--tv-ink); }
.tv-card.sex-m { border-inline-start-color: var(--tv-m); } .tv-card.sex-f { border-inline-start-color: var(--tv-f); }
.tv-card.is-dead { background: #f3f4f6; }
.tv-card-empty { color: var(--tv-muted); border-style: dashed; }
.tv-role { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tv-muted); }
.tv-card-name { display: block; font-weight: 600; }
.tv-card-heb { display: block; font-family: "SBL Hebrew", "Times New Roman", serif; color: #4b5563; }
.tv-card-years { display: block; font-size: .8rem; color: var(--tv-muted); }

.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.tv-surnames { display: grid; grid-template-columns: 2.2rem 1fr; gap: .4rem .6rem; }
.tv-letter { font-weight: 700; color: var(--tv-green); }
.tv-surname-list { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.tv-surname-list a { text-decoration: none; }
.tv-heb-inline { font-family: "SBL Hebrew", "Times New Roman", serif; white-space: nowrap; }
.tv-count { font-size: .75rem; color: var(--tv-muted); margin-inline-start: .15rem; }

/* ---- Family tree chart (People/Chart) ---- */
.tc-section { background: #fff; border: 1px solid var(--tv-line); border-radius: .75rem; padding: .5rem 1rem 1rem; margin-bottom: 1rem; }
.tc-scroll { overflow-x: auto; padding: .5rem 0; }
.tc-box { display: inline-flex; flex-direction: column; min-width: 8.5rem; max-width: 12rem; padding: .35rem .55rem; border-radius: .5rem;
          background: #fbfbfa; border: 1px solid var(--tv-line); border-inline-start: 4px solid var(--tv-u); text-decoration: none; color: var(--tv-ink);
          line-height: 1.2; text-align: start; vertical-align: middle; }
a.tc-box:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); color: var(--tv-ink); }
.tc-box.sex-m { border-inline-start-color: var(--tv-m); } .tc-box.sex-f { border-inline-start-color: var(--tv-f); }
.tc-box.is-dead { background: #f3f4f6; }
.tc-box.is-focus { outline: 3px solid #f2c94c; background: #fffbea; }
.tc-unknown { color: var(--tv-muted); border-style: dashed; font-size: .8rem; }
.tc-role { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tv-muted); }
.tc-name { font-weight: 600; font-size: .85rem; }
.tc-heb { font-family: "SBL Hebrew", "Times New Roman", serif; color: #4b5563; font-size: .95rem; }
.tc-years { font-size: .72rem; color: var(--tv-muted); }

/* Ancestors: the person on the left, parents to the right, joined by elbow lines. */
.tc-anc { display: flex; align-items: center; }
.tc-anc-parents { display: flex; flex-direction: column; justify-content: center; position: relative; margin-left: 1.25rem; }
.tc-anc-parents::before { content: ""; position: absolute; left: -1.25rem; top: 50%; width: 1.25rem; border-top: 2px solid #94a3b8; }
.tc-anc-parents > .tc-anc { position: relative; padding: .2rem 0 .2rem 1rem; }
.tc-anc-parents > .tc-anc::before { content: ""; position: absolute; left: 0; top: 50%; width: 1rem; border-top: 2px solid #94a3b8; }
.tc-anc-parents > .tc-anc::after { content: ""; position: absolute; left: 0; border-left: 2px solid #94a3b8; }
.tc-anc-parents > .tc-anc:first-child::after { top: 50%; bottom: 0; }
.tc-anc-parents > .tc-anc:last-child::after { top: 0; bottom: 50%; }
.tc-anc-parents > .tc-anc:only-child::after { display: none; }

/* Descendants: a top-down tree. */
.tc-desc { display: inline-block; min-width: 100%; }
.tc-desc ul { position: relative; padding: 1.25rem 0 0; margin: 0; display: flex; justify-content: center; }
.tc-desc > ul { padding-top: 0; }
.tc-desc li { list-style: none; position: relative; padding: 1.25rem .35rem 0; text-align: center; }
.tc-desc > ul > li { padding-top: 0; }
.tc-desc li::before, .tc-desc li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 1.25rem; border-top: 2px solid #94a3b8; }
.tc-desc li::after { right: auto; left: 50%; border-left: 2px solid #94a3b8; }
.tc-desc li:only-child::before { display: none; }
.tc-desc li:only-child::after { border-top: 0; width: 0; }
.tc-desc li:first-child::before, .tc-desc li:last-child::after { border: 0 none; }
.tc-desc li:last-child::before { border-right: 2px solid #94a3b8; border-radius: 0 6px 0 0; }
.tc-desc li:first-child::after { border-radius: 6px 0 0 0; }
.tc-desc ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 1.25rem; border-left: 2px solid #94a3b8; }
.tc-desc > ul > li::before, .tc-desc > ul > li::after { display: none; }
.tc-couple { display: inline-flex; align-items: center; gap: .3rem; background: #fff; border: 1px solid #d6dbe1; border-radius: .65rem; padding: .3rem; }
.tc-ring { display: flex; flex-direction: column; align-items: center; color: #92400e; font-size: 1rem; line-height: 1; }
.tc-ring small { font-size: .65rem; color: var(--tv-muted); }
.tc-more { font-size: .75rem; margin-top: .2rem; }
.tv-heb-input { font-family: "SBL Hebrew", "Times New Roman", serif; font-size: 1.15rem; }

/* On-screen Hebrew keyboard (same as Hebrew Reminders) */
.hkb-wrap { position: relative; }
.hkb-wrap > input, .hkb-wrap > textarea { padding-inline-start: 2.4rem; }
.hkb-toggle { position: absolute; inset-inline-start: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.2rem; line-height: 1; color: #6b7280; padding: .2rem; cursor: pointer; }
.hkb-toggle:hover { color: #2563eb; }
.hkb { position: absolute; z-index: 1080; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: .5rem; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: .4rem; user-select: none; }
.hkb[hidden] { display: none; }
.hkb-row { display: flex; justify-content: center; gap: .25rem; margin: .25rem 0; }
.hkb-key { min-width: 2.3rem; height: 2.5rem; border: 1px solid #cbd5e1; border-radius: .35rem; background: #fff; font-family: "David", "Frank Ruhl Libre", "Times New Roman", serif; font-size: 1.3rem; cursor: pointer; }
.hkb-key:hover { background: #e0e7ff; }
.hkb-key:active { background: #c7d2fe; }
.hkb-wide { min-width: 9rem; font-family: Segoe UI, Arial, sans-serif; font-size: .95rem; }
.hkb-fn { min-width: 3rem; font-family: Segoe UI, Arial, sans-serif; font-size: 1.1rem; background: #e2e8f0; }
@media (max-width: 480px) { .hkb-key { min-width: 1.85rem; height: 2.3rem; font-size: 1.15rem; } .hkb-row { gap: .15rem; } }
.hkb-marks { flex-wrap: wrap; max-width: 30rem; margin-inline: auto !important; padding-top: .25rem; border-top: 1px dashed #cbd5e1; }
.hkb-mark { min-width: 2.1rem; background: #f8fafc; font-size: 1.45rem; line-height: 1; }

/* Edit form: one marriage / event row */
.tv-fact-row { border: 1px solid #e5e7eb; border-radius: .5rem; padding: .6rem .75rem; margin-bottom: .6rem; background: #fcfcfd; }
.tv-kid { padding: .3rem 0; border-bottom: 1px dashed #e5e7eb; }
.tv-kid-new { border: 1px dashed #cbd5e1; border-radius: .4rem; padding: .45rem .55rem; margin: .3rem 0; background: #fff; }
.tv-note-shared { white-space: pre-line; background: #f3f4f6; border-radius: .35rem; padding: .4rem .6rem; }

/* EN | RU switch in the header */
.tv-lang { display: flex; border: 1px solid rgba(255,255,255,.55); border-radius: .35rem; overflow: hidden; }
.tv-lang a { color: #fff; text-decoration: none; font-size: .8rem; padding: .2rem .5rem; opacity: .8; }
.tv-lang a + a { border-inline-start: 1px solid rgba(255,255,255,.55); }
.tv-lang a.active { background: rgba(255,255,255,.9); color: #1f4d3d; opacity: 1; font-weight: 600; }
.tv-lang a:hover { opacity: 1; }

/* Photos and documents */
.tv-portrait { flex: none; display: block; width: 96px; height: 120px; border-radius: .5rem; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.tv-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.tv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.tv-media { margin: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; overflow: hidden; display: flex; flex-direction: column; }
.tv-media-thumb { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f3f4f6; }
.tv-media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.tv-enhanced { position: absolute; inset-inline-end: .35rem; top: .3rem; font-size: .9rem; line-height: 1; background: rgba(255,255,255,.85); border-radius: 1rem; padding: .15rem .3rem; }
.tv-viewer-switch { position: static !important; width: auto !important; height: auto !important; border-radius: 1rem !important; font-size: .85rem !important; padding: .25rem .8rem; margin-top: .45rem; }
.tv-media-doc { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: #374151; text-decoration: none; font-weight: 600; }
.tv-media-doc-icon { font-size: 2.2rem; }
.tv-media figcaption { padding: .45rem .6rem .55rem; font-size: .85rem; line-height: 1.3; }
.tv-media-title { font-weight: 600; }
.tv-media-note { color: #6b7280; margin-top: .15rem; }
.tv-media-people { margin-top: .25rem; }
.tv-viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.tv-viewer::backdrop { background: rgba(10, 12, 16, .88); }
.tv-viewer[open] { display: flex; align-items: center; justify-content: center; }
.tv-viewer figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: calc(100vw - 7rem); }
.tv-viewer img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; border-radius: .25rem; background: #222; }
.tv-viewer figcaption { color: #f3f4f6; text-align: center; margin-top: .6rem; font-size: .95rem; }
.tv-viewer-title { font-weight: 600; }
.tv-viewer-note, .tv-viewer-people, .tv-viewer-count { color: #cbd5e1; font-size: .85rem; }
.tv-viewer button { position: fixed; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 2.6rem; height: 2.6rem; font-size: 1.6rem; line-height: 1; }
.tv-viewer button:hover { background: rgba(255,255,255,.25); }
.tv-viewer-close { top: 1rem; right: 1rem; }
.tv-viewer-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.tv-viewer-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Check the tree */
.tv-check { padding: .45rem 0; border-bottom: 1px solid #eef0f2; }
.tv-check-fix { display: block; color: #0f5132; font-size: .9rem; margin-top: .1rem; }

/* Family view (made for phones): one column of cards */
.fv { max-width: 560px; margin: 0 auto; }
.fv-tabs { display: flex; gap: .25rem; background: #e9eef0; border-radius: .6rem; padding: .25rem; margin-bottom: 1rem; position: sticky; top: .5rem; z-index: 5; }
.fv-tabs a { flex: 1; text-align: center; padding: .45rem .25rem; border-radius: .45rem; color: #374151; text-decoration: none; font-weight: 600; font-size: .95rem; }
.fv-tabs a.active { background: #fff; color: #1f5f4a; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.fv-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fv-card { display: flex; flex-direction: column; padding: .55rem .7rem; background: #fff; border: 1px solid #e5e7eb; border-inline-start: 4px solid #9ca3af; border-radius: .55rem; color: inherit; text-decoration: none; min-height: 3.4rem; justify-content: center; }
.fv-card:active { background: #f3f4f6; }
.fv-card.sex-m { border-inline-start-color: #3b82f6; }
.fv-card.sex-f { border-inline-start-color: #ec4899; }
.fv-card.is-dead .fv-name::after { content: "\00a0\1F56F\FE0F"; font-size: .8em; font-weight: 400; vertical-align: .05em; } /* memorial candle */
.fv-focus.is-dead .fv-focus-name::after { content: "\00a0\1F56F\FE0F"; font-size: .75em; font-weight: 400; }
.fv-unknown { color: #9ca3af; border-style: dashed; }
.fv-role { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.fv-name { font-weight: 600; line-height: 1.2; }
.fv-years { font-size: .85rem; color: #6b7280; }
.fv-extra { color: #6b7280; }
.fv-label { font-size: .8rem; color: #6b7280; margin: .6rem 0 .25rem; }
.fv-down { text-align: center; color: #9ca3af; line-height: 1; margin: .35rem 0; }
.fv-focus { display: flex; gap: .9rem; align-items: flex-start; background: #fff; border: 2px solid #1f5f4a; border-radius: .8rem; padding: .9rem; margin-bottom: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.fv-photo { flex: none; width: 84px; height: 104px; border-radius: .5rem; overflow: hidden; }
.fv-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.fv-focus-text { min-width: 0; }
.fv-focus-name { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.fv-heb { color: #4b5563; margin-top: .1rem; }
.fv-event { font-size: .9rem; color: #374151; margin-top: .2rem; }
.fv-links { display: flex; gap: 1rem; margin-top: .5rem; font-size: .9rem; }
.fv-family { border-inline-start: 2px solid #d1d5db; padding-inline-start: .6rem; margin-block: 0 1rem; margin-inline: .4rem 0; }
.fv-kids { display: flex; flex-direction: column; gap: .4rem; margin-top: .45rem; padding-inline-start: .9rem; }
.fv-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin: 1.2rem 0 0; }
.fv-h + .fv-kids { padding-inline-start: 0; }
.fv-outline-head { margin-bottom: .6rem; }
.fv-outline, .fv-outline ul { list-style: none; margin: 0; padding: 0; }
.fv-outline ul { padding-inline-start: 1.1rem; border-inline-start: 1px dashed #d1d5db; margin-inline-start: .45rem; }
.fv-outline li { margin: .15rem 0; }
.fv-outline summary { cursor: pointer; padding: .35rem 0; list-style: none; }
.fv-outline summary::-webkit-details-marker { display: none; }
.fv-outline summary::before { content: "▸"; display: inline-block; width: 1.1rem; color: #6b7280; transition: transform .15s; }
.fv-outline details[open] > summary::before { transform: rotate(90deg); }
.fv-leaf { padding: .35rem 0 .35rem 1.1rem; }
.fv-oname { font-weight: 600; text-decoration: none; }
.fv-oname.sex-m { color: #1d4ed8; }
.fv-oname.sex-f { color: #be185d; }
.fv-with { font-size: .88rem; color: #4b5563; margin: .1rem 0 .1rem 1.1rem; }

/* How are we related? */
.rel-result { background: #fff; border: 2px solid #1f5f4a; border-radius: .8rem; padding: .9rem 1rem; margin-bottom: 1rem; }
.rel-line { font-size: 1.05rem; margin: .15rem 0; }
.rel-line strong { color: #1f5f4a; }
.rel-path { list-style: none; padding: 0; margin: .5rem 0 0; counter-reset: none; }
.rel-path li { position: relative; padding-block: .45rem; padding-inline: 1.4rem 0; border-inline-start: 2px solid #d1d5db; margin-inline-start: .5rem; }
.rel-path li::before { content: ""; position: absolute; inset-inline-start: -.42rem; top: .85rem; width: .7rem; height: .7rem; border-radius: 50%; background: #1f5f4a; }
.rel-path li:first-child, .rel-path li:last-child { font-weight: 600; }
.rel-role { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.fv-flip { display: inline-block; margin-inline-start: .35rem; padding: 0 .45rem; border: 1px solid #c7d7d0; border-radius: 1rem; font-size: .75rem; line-height: 1.5; color: #1f5f4a; text-decoration: none; white-space: nowrap; vertical-align: .1em; }
.fv-flip:hover { background: #e7f1ec; }

/* Sign-in */
.tv-code { letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.tv-users td { vertical-align: middle; }

/* Access: people in the tree with an email address */
.tv-candidates { columns: 2 320px; column-gap: 1.5rem; }
.tv-candidates .form-check { break-inside: avoid; }

/* 📲 "Install the app" card (js/pwa.js) */
.pwa-offer { position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 1090; margin: 0 auto; max-width: 520px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--tv-green); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.22); padding: 10px 12px; }
.pwa-offer img { width: 40px; height: 40px; border-radius: 9px; }
.pwa-offer-text { flex: 1; min-width: 12em; font-size: .95rem; }
.pwa-offer-text b { display: block; }

/* ✎ under a picture (editors): opens Edit picture */
.tv-media figcaption { position: relative; }
.tv-media-edit { float: inline-end; margin-inline-start: .3rem; text-decoration: none; opacity: .65; }
.tv-media-edit:hover { opacity: 1; }

/* 🎬 Recordings (Video/Play): the video and, beside it (below on a phone), its transcript */
.tv-rec { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.tv-rec-player { position: sticky; top: .5rem; }
.tv-rec-player video { width: 100%; max-height: 70vh; background: #000; border-radius: .5rem; }
.tv-rec-text { max-height: 78vh; overflow: auto; position: relative; }
.tv-transcript { margin: 0; }
.tv-transcript li { border-radius: .35rem; }
.tv-line { all: unset; display: block; width: 100%; box-sizing: border-box; cursor: pointer; padding: .2rem .4rem; border-radius: .35rem; line-height: 1.35; }
.tv-line:hover, .tv-line:focus-visible { background: #eef5f1; outline: none; }
.tv-transcript li.tv-current .tv-line { background: #dcefe5; font-weight: 500; }
.tv-transcript li.tv-target { box-shadow: inset 3px 0 0 #f2b84a; background: #fff6e0; }
.tv-rec-time { font-variant-numeric: tabular-nums; color: #5b7d70; font-size: .82rem; margin-inline-end: .25rem; }
.tv-rec-now { font-variant-numeric: tabular-nums; min-width: 3.5em; }
.tv-rec-list li { padding: .25rem 0; }
.tv-rec-hits li { padding: .2rem 0; border-bottom: 1px solid #eee; }
a.tv-rec-link { white-space: nowrap; }
@media (max-width: 760px) {
    .tv-rec { grid-template-columns: 1fr; }
    .tv-rec-player { position: static; }
    .tv-rec-player video { max-height: 32vh; }
    .tv-rec-text { max-height: 52vh; }
}
.tv-viewer-people a { color: #d9f2e4; text-decoration: underline; text-underline-offset: 2px; }
.tv-rec-player video.tv-audio-only { height: 54px; max-height: 54px; background: #e9efe9; }

/* 📝 A recording's summary (Video/Play): headings, points, times that play the recording */
.tv-summary { line-height: 1.45; }
.tv-summary p { margin-bottom: .6rem; }
.tv-sum-h { font-size: 1rem; font-weight: 600; color: #2f5d50; margin: .9rem 0 .3rem; }
.tv-sum-list { padding-inline-start: 1.1rem; margin-bottom: .4rem; }
.tv-sum-list li { margin-bottom: .25rem; }
/* People a summary names: their name links to their card; their photos sit beside the line. */
.tv-sum-person { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.tv-sum-row { display: flex; gap: .5rem; align-items: flex-start; }
.tv-sum-text { flex: 1 1 auto; min-width: 0; }
.tv-sum-faces { flex: 0 0 auto; display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 7.5rem; padding-top: 2px; }
.tv-sum-faces img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; border: 1px solid #c9d6d0; display: block; }
a.tv-seek { font-variant-numeric: tabular-nums; white-space: nowrap; }
a.tv-seek.tv-playing { background: #dcefe5; border-radius: .25rem; }
.tv-rec-blurb { max-width: 60rem; }

/* "How are we related?": the connection as a small tree */
.rel-tree-wrap { overflow-x: auto; padding: .25rem 0 .75rem; }
.rel-tree { position: relative; display: grid; column-gap: 1rem; row-gap: 1.6rem; width: max-content; }
.rel-tree-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.rel-tree-lines path { fill: none; stroke: #8aa89b; stroke-width: 1.5; }
.rel-tree-lines path.rel-sp { stroke: #c27b9c; }
.rel-box { position: relative; z-index: 1; display: block; background: #fff; border: 1px solid #d9e2dd; border-inline-start: 4px solid #9ca3af; border-radius: .5rem; padding: .35rem .55rem; text-decoration: none; color: inherit; line-height: 1.25; }
.rel-box.sex-m { border-inline-start-color: #3b82f6; }
.rel-box.sex-f { border-inline-start-color: #e0569b; }
.rel-box.rel-end { box-shadow: 0 0 0 2px #2f5d50; }
.rel-box.rel-extra { opacity: .85; }
.rel-box:hover { background: #f1f7f4; }
.rel-box-name { display: block; font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }

/* 💬 Memories */
.tv-memory { background: #fff; border: 1px solid #e3e8e5; border-radius: .6rem; padding: .75rem .9rem; margin-bottom: .8rem; }
.tv-memory-pending { border-style: dashed; border-color: #e0b44a; background: #fffcf3; }
.tv-memory-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.tv-memory-text { white-space: pre-line; line-height: 1.5; }
.tv-memory-audio { width: 100%; max-width: 480px; margin: .4rem 0 .2rem; display: block; }
.tv-filters a { margin-inline-end: .9rem; text-decoration: none; }
.tv-filters a.active { font-weight: 600; text-decoration: underline; }
.tv-recorder { background: #f3f7f5; border-radius: .6rem; padding: .75rem; }
.tv-rec-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: #b42318; }
.tv-rec-clock::before { content: "● "; animation: tv-blink 1s steps(2) infinite; }
@keyframes tv-blink { 50% { opacity: 0; } }
.tv-rec-clock.done { color: #5b6b63; }
.tv-rec-clock.done::before { content: "🎙 "; animation: none; }

/* ℹ️ About */
.tv-about h2 { font-size: 1.15rem; color: #2f5d50; margin-top: 1.6rem; scroll-margin-top: 1rem; }
.tv-about li { margin-bottom: .35rem; }
.tv-about-toc { background: #eef5f1; border-radius: .5rem; padding: .5rem .75rem; }

/* 📍 map links: quiet, like the text around them, underlined on hover. */
a.tv-map { color: inherit; text-decoration: none; }
a.tv-map span, .fv-event a.tv-map { border-bottom: 1px dotted currentColor; }
a.tv-map:hover, a.tv-map:hover span { color: var(--bs-link-color, #0d6efd); border-bottom-style: solid; }
.tv-value a.tv-map { font-size: .85rem; color: var(--tv-muted); margin-inline-start: .35rem; white-space: nowrap; }

/* Hebrew (right to left): the tree's English and Russian text keeps its own order inside a right-to-left page
   (an address or a note written in English reads left to right, still lined up on the right). */
[dir=rtl] .tv-value, [dir=rtl] .tv-note, [dir=rtl] .tv-note-block, [dir=rtl] .tv-cite, [dir=rtl] .tv-note-shared,
[dir=rtl] .tv-memory-text, [dir=rtl] .tv-sum, [dir=rtl] .tv-line { unicode-bidi: plaintext; text-align: right; }
[dir=rtl] .tv-place bdi, [dir=rtl] a.tv-map, [dir=rtl] a.tv-map span { unicode-bidi: isolate; }
/* The charts keep their left-to-right layout (lines between boxes are drawn that way). */
[dir=rtl] .tc-scroll, [dir=rtl] .tc-anc, [dir=rtl] .tc-desc { direction: ltr; }
[dir=rtl] .tc-box { direction: rtl; }

/* ℹ️ / 📝 after a place: its own page (📝 when it has a note). */
a.tv-place-page { text-decoration: none; font-size: .8rem; opacity: .75; margin-inline-start: .15rem; }
a.tv-place-page:hover { opacity: 1; }

/* Long notes (a transcribed document): a few lines in the grid; the whole note in the viewer, scrolling if it's long. */
.tv-media-note { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tv-viewer-note { white-space: pre-line; overflow-wrap: anywhere; max-height: 28vh; overflow-y: auto; text-align: start; max-width: 60rem; margin-inline: auto; }
a.tv-viewer-switch:not([hidden]) { display: inline-block; color: inherit; text-decoration: none; }

/* Person edit page: the form in tabs (Main / Parents / Spouses and children / Events and facts / Notes).
   On a phone the tabs wrap onto two lines, smaller, so all of them stay in sight. */
.tv-edit-tabs .nav-link { white-space: nowrap; color: var(--tv-green); }
.tv-edit-tabs .nav-link.active { font-weight: 600; color: inherit; }
@media (max-width: 575.98px) {
    .tv-edit-tabs .nav-link { padding: .35rem .6rem; font-size: .9rem; }
}

/* Where people are on a photo: the boxes in the viewer (media-viewer.js) and on the Edit picture page (photo-tagger.js). */
.tv-viewer-pic { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.tv-viewer-tags { position: absolute; inset: 0; }
.tv-viewer-tag { position: absolute; border: 2px solid rgba(255,255,255,.9); border-radius: .3rem; box-shadow: 0 0 0 1px rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; }
.tv-viewer-pic:hover .tv-viewer-tag { opacity: .55; }
.tv-viewer-pic .tv-viewer-tag:hover, .tv-viewer-pic .tv-viewer-tag:focus-visible, .tv-viewer-tag.tv-lit, .tv-viewer-named .tv-viewer-tag { opacity: 1; }
.tv-viewer-tag span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; line-height: 1.2; white-space: nowrap; font-size: .78rem; color: #fff; background: rgba(0,0,0,.7); padding: .1rem .4rem; border-radius: .25rem; display: none; }
.tv-viewer-tag:hover span, .tv-viewer-tag:focus-visible span, .tv-viewer-tag.tv-lit span, .tv-viewer-named .tv-viewer-tag span { display: block; }
.tv-tagger { position: relative; line-height: 0; user-select: none; -webkit-user-select: none; }
.tv-tagger img { width: 100%; height: auto; border-radius: .375rem; border: 1px solid #dee2e6; }
.tv-tagger.tv-tagging { cursor: crosshair; touch-action: none; outline: 3px solid var(--tv-green, #2f6f4f); outline-offset: 2px; border-radius: .375rem; }
.tv-tag { position: absolute; padding: 0; background: transparent; border: 2px solid #fff; border-radius: .3rem; box-shadow: 0 0 0 1px rgba(0,0,0,.5); line-height: 1.2; cursor: pointer; }
.tv-tag span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; white-space: nowrap; font-size: .75rem; color: #fff; background: rgba(0,0,0,.7); padding: .05rem .35rem; border-radius: .25rem; pointer-events: none; }
.tv-tag-new { border-style: dashed; border-color: #ffd54a; pointer-events: none; }
.tv-tagging .tv-tag { pointer-events: none; opacity: .6; }
