/* The site's own layer over the web demo tree (T3, 20.10.2026), with site/demo-overlay.js; linked by
   tools/build_demo.py into the web build only. Every rule of the bar and the phone view hangs off a class
   the script sets on <html> (rvbar, rvbar-off, rvp-on), so nothing here changes the home page's hero
   frame, where the script does not run (except section 5, which applies there too). Palette of the approved mockups (demo-tree-review/design):
   bg #efe2c2, card #f7efd9, border #b79a63, ink #3b2a17, accent #8a3324. */

/* ---------------------------------------------------------------- 1. the order bar */
#rvBar { display: none; }
html.rvbar #rvBar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 32px;
  padding: 12px 40px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #f7efd9; border-top: 1px solid #b79a63; color: #3b2a17;
  box-shadow: 0 -4px 14px rgba(60, 40, 15, .12);
}
html.rvbar.rvbar-off #rvBar { display: none; }
/* the tree, the tabs' views, the stories strip and the family circle's zoom bar all end above the bar */
html.rvbar:not(.rvbar-off) #stage { bottom: var(--rvBarH, 0px); }
html.rvbar:not(.rvbar-off) .fanzoom { bottom: calc(var(--rvBarH, 0px) + 12px); }
/* R3 polish: on a phone the family circle's floating zoom panel lay on its legend and hint in the first view;
   it goes (the circle already fits the screen, and a pinch still zooms the page). The template pads the
   circle's page for that panel from the panel's position (fanPad), so its own bottom padding comes back */
html.rvp-slim #fanZoom { display: none !important; }
html.rvp-slim #fanWrap { padding-bottom: 34px !important; }
.rv-bar-t { flex: 1 1 220px; font-size: 18px; font-weight: 700; line-height: 1.35; max-width: 420px; }
/* the note wraps to the width of the buttons above it (min-content: the buttons do not wrap) */
.rv-bar-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; }
@media (min-width: 641px) { #rvBar .rv-bar-r { width: min-content; } #rvBar .rv-bar-b { flex-wrap: nowrap; } }
.rv-bar-b { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; }
.rv-bar a { color: #8a3324; }
.rv-bar .rv-b1, .rv-bar .rv-b2 {
  box-sizing: border-box; min-height: 48px; padding: 0 24px; display: inline-flex; align-items: center;
  justify-content: center; border: 2px solid #8a3324; border-radius: 8px; font-size: 17px; font-weight: 700;
  line-height: 1.15; text-decoration: none; white-space: nowrap; text-align: center;
}
.rv-bar .rv-b1 { background: #8a3324; color: #fff; gap: .3em; }   /* the label and its <span class="pr"> are two flex items */
.rv-bar .rv-b2 { background: none; color: #8a3324; }
.rv-bar-n { font-size: 12px; line-height: 1.35; color: #5c4526; text-align: right; }
.rv-bar .rv-short { display: none; }
.rv-bar-n { width: 100%; }
@media (hover: hover) {
  .rv-bar .rv-b1:hover { background: #6f271b; border-color: #6f271b; }
  .rv-bar .rv-b2:hover { background: #f3e6c9; }
}
.rv-bar a:focus-visible { outline: 3px solid #3b2a17; outline-offset: 2px; }
/* a tablet: tighter padding, so the title and the two buttons keep one row */
@media (min-width: 641px) and (max-width: 900px) {
  html.rvbar #rvBar { padding-left: 20px; padding-right: 20px; gap: 10px 20px; }
  .rv-bar-t { font-size: 16px; }
  .rv-bar .rv-b1, .rv-bar .rv-b2 { padding: 0 16px; }
}
/* a landscape phone: the title goes, the buttons and the note stay */
@media (min-width: 641px) and (max-height: 500px) {
  html.rvbar #rvBar { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .rv-bar-t { display: none; }
  .rv-bar .rv-b1, .rv-bar .rv-b2 { min-height: 44px; }
}
/* a phone (R2): two rows only, the two buttons, then one short line; no title */
@media (max-width: 640px) {
  html.rvbar #rvBar {
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .rv-bar-t { display: none; }
  .rv-bar-r { align-items: stretch; gap: 4px; margin-left: 0; }
  .rv-bar-b { flex-wrap: nowrap; gap: 8px; }
  .rv-bar .rv-b1, .rv-bar .rv-b2 { min-height: 44px; padding: 2px 10px; font-size: 15px; white-space: normal; }
  .rv-bar .rv-b1 { flex: 1 1 auto; }
  .rv-bar .rv-b2 { flex: 0 0 auto; }
  .rv-bar .rv-long { display: none; }
  .rv-bar .rv-short { display: inline; }
  .rv-bar-n { max-width: none; text-align: center; font-size: 12px; line-height: 1.3; }
}

/* ---------------------------------------------------------------- 2. the phone view of the Tree tab */
#rvPhone { display: none; }
html.rvp-on #rvPhone {
  display: block; position: absolute; inset: 0; z-index: 30; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #efe2c2; color: #3b2a17;
}
/* the template's own tree is kept laid out (its sizes stay right for «Усе дерево»), only not shown */
html.rvp-on #treeView, html.rvp-on #stories, html.rvp-on #leftRail, html.rvp-on #rightRail { visibility: hidden !important; }
/* R2: under the cards the phone's chrome stays at a quarter of the screen: no generation chips (the cards
   go generation by generation), no relatives toggle (the cards list them), «Як читати» moves beside
   «Усе дерево». R3: the same on every other tab (rvp-slim; only «Усе дерево» keeps the template's
   header), where «Як читати» sits in the header's first row (#rvAbout) */
html.rvp-slim #genBar, html.rvp-slim #relBtn, html.rvp-slim #candBtn, html.rvp-slim header .hdr-right { display: none !important; }
#rvAbout { display: none; }
html.rvp-slim:not(.rvp-on) #rvAbout { display: inline-flex; align-items: center; flex: none; white-space: nowrap; }
.rvp-in { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; padding: 10px 16px 20px; }
.rvp-count {
  background: #f7efd9; border: 1px solid #b79a63; border-radius: 8px; padding: 8px 12px;
  text-align: center; font-size: 14px; line-height: 1.45;
}
.rvp-count b { font-size: 18px; }
.rvp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* the line keys sit in the counter box, one row; «Як читати» and «Усе дерево» share the row below it */
.rvp-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin-top: 4px; font-size: 14px; color: #5c4526; }
#rvPhone .rvp-row > button { flex: 1 1 0; }
.rvp-key { display: inline-flex; align-items: center; gap: 6px; }
.rvp-key i { width: 18px; height: 5px; border-radius: 2px; flex: none; }
#rvPhone button { font: inherit; color: #3b2a17; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#rvPhone .rvp-full, #rvPhone .rvp-about {
  flex: none; min-height: 44px; padding: 0 14px; background: none; border: 2px solid #8a3324; border-radius: 8px;
  color: #8a3324; font-size: 15px; font-weight: 700; white-space: nowrap;
}
#rvPhone .rvp-nav {
  min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #f7efd9;
  border: 1px solid #b79a63; border-radius: 8px; font-size: 16px; font-weight: 700;
}
#rvPhone .rvp-nav:disabled { opacity: .45; cursor: default; }
.rvp-h { margin: 2px 0 0; padding-bottom: 5px; border-bottom: 1px solid #b79a63; font-size: 16px; font-weight: 700; line-height: 1.3; outline: none; }
.rvp-hk { margin-top: 10px; font-size: 16px; }
#rvPhone .rvp-card {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; margin: 0; padding: 10px 12px; text-align: left;
  background: #f7efd9; border: 1px solid #b79a63; border-top: 5px solid var(--rvp-line, #b3872f); border-radius: 8px;
}
.rvp-body { flex: 1; min-width: 0; display: block; }
.rvp-nm { display: block; font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.rvp-sub { display: block; margin-top: 3px; font-size: 14px; line-height: 1.35; color: #5c4526; }
.rvp-hook { display: block; margin-top: 6px; font-size: 14px; font-style: italic; line-height: 1.4; }
.rvp-seal {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.rvp-seal.rvp-doc { background: #2f7d46; }
.rvp-seal.rvp-strong { background: #c1861f; }
.rvp-seal.rvp-inferred { background: #8d8172; }
#rvPhone button:focus-visible { outline: 3px solid #8a3324; outline-offset: 2px; }

/* ---------------------------------------------------------------- 3. the progress tab, a finished job */
/* no date of the last update, no "of N" under the ring, no bars (each one is a share of a total), no
   "not found yet" key (always the last one the template writes); the script hides what the data still
   says as "N of M" or a percent (.rvx-hide) and keeps only the found count of each generation */
#progWrap .pg-upd, #progWrap .pg-of, #progWrap .pg-bar, #progWrap .pg-leg li:last-child { display: none !important; }
#progWrap .pg-gens { grid-template-columns: 1fr auto; }
#progWrap .rvx-hide { display: none !important; }
/* R2: only the found ancestors are drawn; a place not found is no segment and has no tooltip */
#progWrap .pg-seg.pg-open, #progWrap .pg-seg.pg-active { fill: transparent; stroke: none; pointer-events: none; }

/* ---------------------------------------------------------------- 4. the order line at the end of a person card */
.rv-card-cta { margin: 18px 0 6px; padding: 14px 16px; background: #f7efd9; border: 1px solid #b79a63; border-radius: 8px; color: #3b2a17; }
.rv-card-cta p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.rv-card-cta a {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 44px; padding: 0 20px;
  background: #8a3324; border: 2px solid #8a3324; border-radius: 8px; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none;
  gap: .3em;
}
@media (hover: hover) { .rv-card-cta a:hover { background: #6f271b; border-color: #6f271b; } }
.rv-card-cta a:focus-visible { outline: 3px solid #3b2a17; outline-offset: 2px; }
/* home-feedback-1011: Рід beside the Розвідка button is a text link */
.rv-card-cta a.rv-cc2 { padding: 0 8px; background: none; border-color: transparent; color: #8a3324; font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .rv-card-cta a.rv-cc2:hover { background: none; border-color: transparent; color: #5f2118; } }

/* ---------------------------------------------------------------- 9. «← Назад» (home-feedback-1011, 10.11.2026) */
/* the first item of the template's header (demo-overlay.js), in its flow, so it never lies on the crest, the search or the
   tabs; dressed like the header's own outlined buttons, as tall as the search (36 px) so a wrapped header row grows by nothing. On a phone the brand's word gives it the room, the crest stays */
.rv-back { display: none; }
html.rvback header .rv-back {
  display: inline-flex; flex: none; align-items: center; gap: 6px; box-sizing: border-box; height: 36px; padding: 0 14px;
  border: 1px solid #b3872f; border-radius: 8px; background: rgba(0, 0, 0, .2); color: #f3e4c0;
  font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
}
@media (hover: hover) { html.rvback header .rv-back:hover { background: rgba(0, 0, 0, .35); color: #fff; } }
html.rvback header .rv-back:focus-visible { outline: 2px solid #f3e4c0; outline-offset: 2px; }
@media (max-width: 640px) {
  html.rvback header .rv-back { padding: 0 10px; }
  html.rvback header #brandTitle { display: none; }
}

/* ---------------------------------------------------------------- 5. call 09.11 S2: the sample reads as found */
/* No dashed line and no hatched fill anywhere in the demo, the home page's hero frame included (these rules
   hang off no script class on purpose): a dashed outline read as "they will find nothing" */
#stage [stroke-dasharray] { stroke-dasharray: none !important; }
.node.ghost { border-style: solid; }
.node.anchhot { outline-style: solid; }
.cand.cnd { border-left-style: solid; }
.mgl-mk.mgl-cl i { border-style: solid; }
.dr-photo { border: 1px solid #e3d8c2; background: #F4F1EA; }
#modalBox .row span[style*="dashed"], #hud .row span[style*="dashed"] { border-top-style: solid !important; }
/* a probable person: an ochre «ймовірно» chip under the years instead of the grey «?»; one record found
   is a confirmed person (the two-entry legend: confirmed, probable) */
.node .seal.strong { background: radial-gradient(circle at 35% 30%, #57a86a, #2f7d46); }
.node .seal.inferred, .node .seal.guess, .node .seal.weak {
  position: static; display: inline-flex; width: auto; height: 18px; margin: 4px 0 0 5px; padding: 0 7px;
  border-radius: 9px; background: #F0E6CF; box-shadow: none; font-size: 0; color: #6b4f1d;
}
.node .seal.inferred::after, .node .seal.guess::after, .node .seal.weak::after { content: 'ймовірно'; font-size: 11px; font-weight: 600; }
html[lang="ru"] .node .seal.inferred::after, html[lang="ru"] .node .seal.guess::after, html[lang="ru"] .node .seal.weak::after { content: 'вероятно'; }
html[lang="en"] .node .seal.inferred::after, html[lang="en"] .node .seal.guess::after, html[lang="en"] .node .seal.weak::after { content: 'probable'; }
/* the reader and the parents (anonymous cards, ids a1 a2 a3): solid, quiet paper, no seal */
.node[data-id="a1"], .node[data-id="a2"], .node[data-id="a3"] { background: #FBF8F1; border-color: #d8ccb2; box-shadow: none; color: #5c4526; }
.node[data-id="a1"] .seal, .node[data-id="a2"] .seal, .node[data-id="a3"] .seal { display: none; }
/* the family circle: an empty place in a drawn generation is a pale sector, no outline dash, no «?», no tap */
#fanWrap .fan-seg.empty { display: inline !important; fill: #F4F1EA !important; fill-opacity: 1 !important; stroke: #fff !important; stroke-width: 1.4px; pointer-events: none; }
#fanWrap .fan-q { display: none !important; }
#fanWrap g.fan-seg.is-prob > path:first-child { fill-opacity: .45 !important; }
#fanWrap g.fan-seg.rv-anon > path:first-child, #fanWrap .rv-anon-disc { fill: #FBF8F1 !important; fill-opacity: 1 !important; stroke: #d8ccb2 !important; }
#fanWrap g.fan-seg.rv-anon text { fill: #5c4526 !important; stroke: none !important; }
.rv-fan-lines { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin: 8px auto 0; font-size: 13px; color: #5c4526; }
.rv-ln { display: inline-flex; align-items: center; gap: 6px; }
.rv-ln i { width: 18px; height: 5px; border-radius: 2px; flex: none; }
.rv-sw { width: 22px; height: 13px; border-radius: 3px; flex: none; background: linear-gradient(90deg, #8a3324 50%, #2f6e5b 50%); }
.rv-sw-prob { opacity: .45; }
/* the «ймовірно» chip, everywhere it is written by the script */
.rv-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 12px; font-style: normal; font-weight: 600; line-height: 1; white-space: nowrap; }
.rv-badge.rv-prob { background: #F0E6CF; color: #6b4f1d; }
.rv-badge.rv-doc { background: #e3efe2; color: #2f6b3f; }
#hud .row .rv-badge, #modalBox .row .rv-badge { margin-right: 6px; }
#modalBox .row .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; color: #fff; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fan-legend .rv-badge { margin-right: 2px; }
/* the count and the caption: in the phone's strip, and top right over the tree wider than a phone */
.rv-st { display: block; }
.rv-cap { display: block; margin-top: 2px; font-size: 13px; color: #5c4526; }
#rvStats { display: none; }
html.rvs-on #rvStats {
  display: block; position: absolute; top: 14px; right: 14px; z-index: 6; max-width: 300px; padding: 8px 12px;
  background: #f7efd9; border: 1px solid #b79a63; border-radius: 8px; color: #3b2a17; font-size: 14px; line-height: 1.4;
  box-shadow: 0 2px 8px rgba(60, 40, 15, .12);
}
#rvStats b { font-size: 16px; }
/* the phone's first screen: the father's line as couples, oldest first, down to the reader */
.rvp-line { display: flex; flex-direction: column; gap: 6px; }
.rvp-line-h { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
.rvp-lr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rvp-lr.is-one { grid-template-columns: minmax(0, 60%); justify-content: center; }
#rvPhone .rvp-lc {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; margin: 0; padding: 7px 9px;
  text-align: left; background: #f7efd9; border: 1px solid #b79a63; border-top: 4px solid var(--rvp-line, #b3872f); border-radius: 8px;
}
#rvPhone .rvp-lc.is-anon { background: #FBF8F1; border-color: #d8ccb2; border-top-color: #d8ccb2; color: #5c4526; justify-content: center; }
.rvp-lc-nm { font-size: 14px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.rvp-lc-yr { font-size: 13px; color: #5c4526; }
.rvp-lc .rv-badge { margin-top: 2px; height: 18px; font-size: 11.5px; }
.rv-key2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: #5c4526; }
.rv-key2 span { display: inline-flex; align-items: center; gap: 6px; }
