/* Site 7: paleta „Galeria” (zamiana kolorów sepii z site6) */
:root {
  --paper: #ffffff;
  --paper-2: #eef0f3;
  --ink: #111418;
  --ink-soft: #5b6170;
  --seal: #b24a26;
  --line: rgba(17, 20, 24, 0.16);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --side: 196px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; background: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; }
h1 { font-size: clamp(3.4rem, 7vw, 6.2rem); line-height: 0.9; margin: 0; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 0.4rem; }
p { max-width: 62ch; }

.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  padding: 1.6rem 1.2rem;
  border-right: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 5;
}
.brand {
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.2rem;
}
.side a:not(.brand) {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.45rem 0 0.45rem 0.7rem;
  border-left: 2px solid transparent;
}
.side a.is-on { color: var(--ink); border-left-color: var(--seal); }

main { margin-left: var(--side); }
section { padding: 4.5rem 6vw 5rem; }
.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--seal);
  margin: 0 0 0.7rem;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.note { color: var(--ink-soft); font-size: 0.95rem; }

.house { margin: 1.6rem 0 2.4rem; }
.house img { width: 100%; max-height: 520px; object-fit: cover; object-position: center 40%; }
.house figcaption {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tree-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  gap: 1.2rem;
  align-items: start;
  margin-top: 1rem;
}
.tree { width: 100%; height: auto; background: #f7f8fa; border: 1px solid var(--line); }
.node rect { fill: #f7f8fa; stroke: var(--ink-soft); cursor: pointer; }
.node text { font-family: var(--serif); font-size: 13px; fill: var(--ink); pointer-events: none; }
.node .yrs { font-size: 11px; fill: var(--ink-soft); }
.node.on rect { fill: var(--ink); stroke: var(--ink); }
.node.on text { fill: var(--paper); }
.node.hero-node rect { stroke: var(--seal); stroke-width: 2; }
.link { stroke: var(--ink-soft); fill: none; }
.link.dash { stroke-dasharray: 4 3; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: end; margin: 0.6rem 0 1rem; }
.toolbar label, .search { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.toolbar input, .toolbar select, .search input, .toolbar button {
  border: 1px solid var(--line); background: #f7f8fa; padding: 0.4rem 0.55rem;
  font: inherit; letter-spacing: 0; text-transform: none; color: var(--ink); font-size: 0.95rem;
}
.tree-screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.tree-screen.has-profile { grid-template-columns: minmax(0, 1fr) 280px; }
.tree-side { display: none; flex-direction: column; gap: 0.8rem; }
.tree-screen.has-profile .tree-side { display: flex; animation: profile-in 0.22s ease-out; }
@keyframes profile-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tree-screen.has-profile .tree-side { animation: none; } }
.profile-close { position: absolute; top: 0.4rem; right: 0.5rem; border: 0; font-size: 1.4rem; line-height: 1; padding: 0.2rem 0.4rem; color: var(--ink-soft); }
.profile-close:hover { color: var(--seal); }
#family-chart {
  --female-color: #ecd7cf;
  --male-color: #d9cfc2;
  --genderless-color: #e6dfd4;
  --background-color: #f7f8fa;
  --text-color: var(--ink);
  height: 72vh;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
}
#family-chart div.card-rect { width: 150px; min-height: 78px; }
#family-chart div.card-rect .card-label { white-space: normal; line-height: 1.15; }
#family-chart div.card-main .card-inner { outline-color: var(--seal); }
.branch { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
.kidrow { display: flex; gap: 0.7rem; align-items: flex-start; padding-top: 0.45rem; border-top: 1px solid var(--line); }
.tnode, .plist button, .person-list button {
  border: 1px solid var(--line); background: #f7f8fa; text-align: left; padding: 0.35rem 0.55rem; min-width: 7.5rem;
}
.tnode b, .person-list b { display: block; font-family: var(--serif); font-size: 1.05rem; font-weight: 500; }
.tnode span, .person-list span { color: var(--ink-soft); font-size: 0.78rem; }
.tnode.is-on, .person-list button.is-on { background: var(--ink); color: var(--paper); }
.tnode.is-on span, .person-list button.is-on span { color: #d9dde3; }
.person-layout { display: grid; grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr); gap: 1rem; align-items: start; }
.person-list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow: auto; border-top: 1px solid var(--line); }
.person-list li { border-bottom: 1px solid var(--line); }
.person-list button { width: 100%; border: 0; background: transparent; }
.timeline { list-style: none; margin: 0.8rem 0; padding: 0 0 0 1rem; border-left: 2px solid var(--seal); }
.timeline li { margin: 0 0 0.75rem; }
.timeline time { display: block; color: var(--seal); font-size: 0.82rem; }
.timeline b { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.timeline span { display: block; color: var(--ink-soft); font-size: 0.9rem; }
.rel { font-size: 0.92rem; }
.rel span { display: block; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; color: var(--ink-soft); }
.rel button { border-bottom: 1px solid var(--line); margin: 0 0.4rem 0.2rem 0; padding: 0; }
#house-map { height: 440px; border: 1px solid var(--line); background: #eef0f3; }
.leaflet-control-layers { font-family: var(--sans); }

.profile {
  position: sticky;
  top: 1.2rem;
  background: #f7f8fa;
  border: 1px solid var(--line);
  padding: 1.2rem 1.2rem 1.4rem;
  min-height: 12rem;
}
.profile h3 { font-size: 1.8rem; margin: 0.15rem 0; line-height: 1; }
.profile .yrs { color: var(--seal); font-size: 0.85rem; }
.profile p { color: var(--ink-soft); font-size: 0.95rem; }
.profile dt { color: var(--ink-soft); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.7rem; }
.profile dd { margin: 0; }

.places { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); margin-top: 1.2rem; }
.place { padding: 1rem 1rem 1.2rem 0; border-bottom: 1px solid var(--line); }
.place strong { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 500; }
.place span { color: var(--ink-soft); font-size: 0.92rem; }

.dark { background: var(--ink); color: var(--paper); }
.dark .eyebrow { color: #e7b2a8; }
.gallery {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  grid-auto-rows: 220px;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.gallery figure { margin: 0; position: relative; overflow: hidden; background: #2a241e; }
.gallery figure:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.2rem 0.7rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  font-size: 0.8rem;
}

.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem 1.2rem; margin-top: 1rem; }
.person { border-top: 1px solid var(--ink); padding-top: 0.6rem; text-align: left; }
.person b { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; }
.person em { color: var(--ink-soft); font-style: normal; font-size: 0.85rem; }

.chapters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.4rem; }
.chapters button {
  border: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}
.chapters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chapter { max-width: 920px; }
.honza-head { display: grid; grid-template-columns: 180px 1fr; gap: 1.4rem; align-items: end; margin-bottom: 1.2rem; }
.honza-head img { width: 180px; background: #fff; border: 1px solid var(--line); }
.honza-head h3 { font-size: 2.4rem; margin: 0 0 0.3rem; }
.sub { font-size: 1.8rem; margin: 2rem 0 0.3rem; }

.compare { border: 1px solid var(--line); background: #f7f8fa; }
.compare-head { display: flex; background: var(--paper-2); }
.compare-head button {
  flex: 1;
  border: 0;
  padding: 0.7rem 0.8rem;
  text-align: left;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.compare-head button[aria-selected="true"] { background: #f7f8fa; color: var(--ink); box-shadow: inset 0 3px 0 var(--seal); }
.stage { position: relative; min-height: 240px; user-select: none; }
.pane { padding: 1.3rem 1.4rem 1.5rem; }
.pane h3 { margin: 0.1rem 0 0.5rem; font-size: 1.45rem; }
.pane p { margin: 0 0 0.6rem; font-size: 0.98rem; }
.pane-archive {
  position: absolute; inset: 0;
  background: #f7f8fa;
  background-image: repeating-linear-gradient(#f7f8fa 0 28px, rgba(17,20,24,.06) 28px 29px);
  clip-path: inset(0 0 0 50%);
}
.tag { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--seal); }
.handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: var(--seal); cursor: col-resize;
}
.handle::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; background: var(--seal);
}
.compare-note { margin: 0; padding: 0 1.4rem 1.1rem; color: var(--ink-soft); font-size: 0.92rem; }
.ribbon { width: 100%; background: #f7f8fa; border: 1px solid var(--line); }
.yr { fill: #eef0f3; }
.jailseg { fill: var(--seal); cursor: pointer; }
.ribbon text { font-family: var(--sans); font-size: 11px; fill: var(--ink-soft); }
.ribbon-out { border: 1px solid var(--line); border-top: 0; padding: 0.9rem 1rem; min-height: 4.5rem; background: #f7f8fa; font-size: 0.95rem; }

@media (max-width: 680px) {
  .side { position: sticky; top: 0; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.8rem; padding: 0.7rem 1rem; }
  .brand { margin: 0 0.6rem 0 0; font-size: 1.3rem; }
  main { margin-left: 0; }
  .tree-grid, .places, .people, .gallery, .honza-head, .person-layout, .tree-screen { grid-template-columns: 1fr; }
  .gallery figure:first-child { grid-row: auto; }
  .profile { position: static; }
}

/* GEDCOM import */
.toolbar .import-btn {
  position: relative; cursor: pointer; align-self: end;
  padding: 0.5rem 0.9rem; border: 1px solid var(--ink); border-radius: 4px;
  background: var(--ink); color: var(--paper);
  text-transform: none; letter-spacing: 0; font-size: 0.95rem;
}
.toolbar .import-btn:hover { background: var(--seal); border-color: var(--seal); }
.toolbar .import-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.toolbar .import-btn:focus-within { outline: 2px solid var(--seal); outline-offset: 2px; }
#tree-status { margin: -0.4rem 0 0.8rem; }

/* ---- Descendant chart (site2) ---- */
.toolbar .ctl { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.stepper, .seg { display: flex; }
.toolbar .stepper button, .toolbar .seg button { margin-left: -1px; min-width: 2.2rem; }
.stepper output { border: 1px solid var(--line); border-left: 0; border-right: 0; background: #f7f8fa; padding: 0.4rem 0.7rem; font-size: 0.95rem; color: var(--ink); letter-spacing: 0; min-width: 2.4rem; text-align: center; }
.toolbar .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dt-bar { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; margin: 0 0 0.5rem; max-width: none; }
.act { border-bottom: 1px solid var(--seal); color: var(--seal); padding: 0; }
.dt-note { background: #f7f8fa; border-left: 2px solid var(--seal); padding: 0.4rem 0.7rem; max-width: none; }
.dt-note button { border-bottom: 1px solid var(--seal); color: var(--seal); padding: 0; }

.dtree {
  height: 72vh;
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, rgba(17, 20, 24, 0.07) 1px, transparent 1.2px) 0 0 / 18px 18px,
    #f8f9fb;
  cursor: grab;
  overscroll-behavior: contain;
}
.dtree.is-dragging { cursor: grabbing; user-select: none; }
.dtree:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.tree-screen > * { min-width: 0; }
.dt-stage { position: relative; }
.dt-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.dt-links { position: absolute; left: 0; top: 0; pointer-events: none; }
.dt-links path { fill: none; stroke: rgba(91, 97, 112, 0.55); stroke-width: 1.2; }
.dt-head {
  position: absolute; top: 12px;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--line); padding-bottom: 0.2rem;
}

.dt-card {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid #c3c8d0;
  padding: 0.35rem 0.6rem 0.35rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.06);
}
.dt-card.f { border-left-color: #c99a8c; }
.dt-card.line { border-left-color: var(--seal); }
.dt-card.living { opacity: 0.7; border-style: dashed; }
.dt-card.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dt-card.is-on .dt-main span, .dt-card.is-on .dt-sp, .dt-card.is-on .dt-sp span { color: #d9dde3; }
.dt-main, .dt-sp button, .dt-note button, .act, .rel button { border: 0; }
.rel button { border-bottom: 1px solid var(--line); }
.act, .dt-note button { border-bottom: 1px solid var(--seal); }
.dt-main { display: block; width: 100%; text-align: left; padding: 0; }
.dt-main b {
  display: block; font-family: var(--serif); font-size: 1.04rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dt-main span { color: var(--ink-soft); font-size: 0.76rem; }
.dt-sp { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.12rem; }
.dt-sp button { padding: 0; text-align: left; }
.dt-sp button:hover, .dt-main:hover b { text-decoration: underline; text-decoration-color: var(--seal); }
.dt-sp span { font-size: 0.72rem; }
.dt-more { font-style: italic; }
.dt-start {
  position: absolute; left: -4px; top: -16px;
  background: var(--seal); color: #fff;
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.12rem 0.4rem; line-height: 1.2;
}
.dt-tog {
  position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  min-width: 26px; height: 24px; padding: 0 0.35rem;
  border: 1px solid var(--ink-soft); border-radius: 12px;
  background: #ffffff; color: var(--ink); font-size: 0.74rem; line-height: 1;
  z-index: 2;
}
.dt-tog[aria-expanded="false"] { background: var(--seal); border-color: var(--seal); color: #fff; }
.dt-tog:hover { border-color: var(--seal); }
.dt-tog:focus-visible, .dt-main:focus-visible, .dt-sp button:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }

.admin { border-top: 1px dashed var(--line); background: #f3f4f6; }
.side a.admin-link { margin-top: auto; font-size: 0.7rem; opacity: 0.75; }

@media (max-width: 680px) {
  .tree-screen, .tree-screen.has-profile { grid-template-columns: minmax(0, 1fr); }
  .dtree { height: 70vh; }
  .toolbar .ctl { flex: 1 1 auto; }
}

/* Profile: occupation, religion, notes, sources */
.facts { margin: 0.9rem 0 0.4rem; font-size: 0.92rem; }
.facts .sec { display: block; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 0.25rem; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li { margin: 0 0 0.45rem; }
.facts li b { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; }
.facts li span { display: block; color: var(--ink-soft); font-size: 0.85rem; }
.facts li em { display: block; font-style: normal; font-size: 0.85rem; border-left: 2px solid var(--line); padding-left: 0.5rem; margin-top: 0.15rem; }
.facts .pnote { margin: 0 0 0.5rem; color: var(--ink); font-size: 0.9rem; white-space: normal; }
.facts.sources li b { font-family: var(--sans); font-size: 0.88rem; font-weight: 500; }
.facts.sources a { color: var(--seal); word-break: break-all; }
.rel .plain { display: inline; letter-spacing: 0; text-transform: none; font-size: 0.92rem; color: var(--ink); margin: 0 0.4rem 0.2rem 0; }

/* ---- Wersja 3: treść z baz wiedzy ---- */
:root { color-scheme: light; }
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1.2rem; margin: 2.2rem 0 0; border-top: 1px solid var(--line); max-width: 980px; }
.numbers div { padding: 0.9rem 0 0.4rem; }
.numbers dt { font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--seal); }
.numbers dd { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.85rem; }
.branches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-top: 2rem; max-width: 1180px; }
.branch-card { text-align: left; border: 1px solid var(--line); background: #f7f8fa; padding: 1rem 1rem 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; transition: border-color 0.15s, transform 0.15s; }
.branch-card:hover { border-color: var(--seal); transform: translateY(-2px); }
.branch-card b { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; line-height: 1.05; }
.branch-card span { color: var(--ink-soft); font-size: 0.9rem; }
.branch-card em { margin-top: auto; font-style: normal; color: var(--seal); font-size: 0.82rem; letter-spacing: 0.06em; }
.place em { display: block; font-style: normal; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--seal); margin: 0.1rem 0 0.25rem; }

.chapter h3 { font-size: 2.4rem; margin: 0 0 0.5rem; line-height: 1.05; }
.chapter h4 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin: 2rem 0 0.4rem; }
.chapter p { max-width: 70ch; }
.chapter .deck { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; color: var(--ink); font-style: italic; max-width: 60ch; }
.list { padding-left: 1.1rem; max-width: 72ch; }
.list li { margin: 0 0 0.45rem; }
.tbl { overflow-x: auto; margin: 1rem 0 1.4rem; border-top: 2px solid var(--ink); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.tbl th { text-align: left; font-weight: 500; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); padding: 0.55rem 0.8rem 0.45rem 0; border-bottom: 1px solid var(--line); }
.tbl td { vertical-align: top; padding: 0.55rem 0.8rem 0.55rem 0; border-bottom: 1px solid var(--line); }
.tbl td:first-child { white-space: nowrap; color: var(--seal); font-variant-numeric: tabular-nums; }
.ph { margin: 1.2rem 0 1.6rem; }
.ph img { width: 100%; max-height: 460px; object-fit: contain; background: #f1f2f4; border: 1px solid var(--line); }
.ph figcaption { margin-top: 0.4rem; font-size: 0.82rem; color: var(--ink-soft); max-width: 70ch; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.two .ph img { height: 320px; }
.trop { margin: 1.6rem 0 1rem; padding: 0.8rem 1rem; background: #f7f8fa; border-left: 3px solid var(--seal); font-size: 0.92rem; max-width: 74ch; }
.trop b:first-child { display: block; font-weight: 500; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--seal); margin-bottom: 0.25rem; }
.src { font-size: 0.82rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 0.6rem; max-width: 80ch; }
.src span { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.15rem; }

.bio { margin: 0.6rem 0 0.8rem; padding: 0.6rem 0 0.7rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bio p { color: var(--ink) !important; margin: 0 0 0.35rem; }
.bio .bio-src { color: var(--ink-soft) !important; font-size: 0.8rem !important; }
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; max-width: 1100px; }
.about h3 { font-size: 1.6rem; margin: 0 0 0.4rem; }
#house-caption { max-width: 80ch; }
#house-caption em { color: var(--seal); font-style: normal; }
#house-caption .who { display: block; margin-top: 0.4rem; }
#house-caption .who button { border: 0; border-bottom: 1px solid var(--line); padding: 0; color: var(--ink); }
#house-caption .who button:hover { border-color: var(--seal); }
.person-list button.is-on b, .person-list button.is-on { color: var(--paper); }

@media (max-width: 980px) {
  .branches, .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .places { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  section { padding: 3rem 16px 3.5rem; }
  .branches, .numbers, .two, .about, .places { grid-template-columns: minmax(0, 1fr); }
  .two .ph img { height: auto; }
  .chapter h3 { font-size: 2rem; }
  .tbl td:first-child { white-space: normal; }
}

/* Map: year slider for the historical map */
.map-years { background: #f7f8fa; padding: 0.45rem 0.7rem 0.5rem; font-size: 0.8rem; color: var(--ink); display: grid; grid-template-columns: auto 1fr auto; gap: 0.2rem 0.6rem; align-items: center; width: min(420px, calc(100vw - 80px)); }
.map-years label { letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.68rem; color: var(--ink-soft); }
.map-years input { width: 100%; accent-color: var(--seal); }
.map-years output { font-family: var(--serif); font-size: 1.35rem; color: var(--seal); min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.map-years-marks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.map-years-marks button { border: 1px solid var(--line); background: #fff; padding: 0.05rem 0.4rem; font-size: 0.75rem; border-radius: 2px; }
.map-years-marks button:hover { border-color: var(--seal); color: var(--seal); }
.map-help { font-size: 0.82rem; margin: 0.5rem 0 0.2rem; max-width: 80ch; }
/* The page-wide `section` padding must not reach Leaflet's layer list (it is a <section> too). */
.leaflet-control-layers section { padding: 0; }
.leaflet-control-layers-expanded { padding: 0.4rem 0.7rem; font-family: var(--sans); font-size: 0.85rem; }
.map-years[hidden] { display: none; }

/* House markers: blue dots, numbered clusters */
.house-pin span { display: block; width: 16px; height: 16px; margin: 3px; border-radius: 50%; background: #1f5fbf; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(10, 40, 90, 0.55), 0 1px 4px rgba(0, 0, 0, 0.35); }
.house-pin.is-on span { width: 22px; height: 22px; margin: 0; background: #0b3d91; box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.35), 0 1px 5px rgba(0, 0, 0, 0.45); }
.house-cluster span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #1f5fbf; color: #fff; font: 600 0.85rem/1 var(--sans); border: 3px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 4px rgba(31, 95, 191, 0.3), 0 1px 4px rgba(0, 0, 0, 0.35); }
.house-cluster:hover span { background: #0b3d91; }

/* Miejscowości: general descriptions */
.places.towns { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem 2rem; border-top: 0; }
.town { border-top: 1px solid var(--ink); padding-top: 0.7rem; }
.town h3 { font-size: 1.7rem; margin: 0; line-height: 1.1; }
.town em { display: block; font-style: normal; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--seal); margin: 0.2rem 0 0.5rem; }
.town p { margin: 0 0 0.5rem; font-size: 0.95rem; }
.bio-src { color: var(--ink-soft); font-size: 0.8rem; }

/* Person card + story */
.person-main { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.person-main .profile { position: static; }
.person-story { background: #f7f8fa; border: 1px solid var(--line); padding: 1.4rem 1.6rem 1.6rem; min-width: 0; }
.person-story .deck { font-family: var(--serif); font-size: 1.3rem; line-height: 1.35; font-style: italic; }
.person-story h4 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 1.6rem 0 0.4rem; }
.person-story p { max-width: 72ch; }
.tree-notes { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.tree-notes summary { cursor: pointer; color: var(--seal); font-size: 0.88rem; }
.card-acts { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.place-link { color: inherit; text-decoration: underline; text-decoration-color: #1f5fbf; text-underline-offset: 2px; }
.place-link:hover { color: #1f5fbf; }

/* Klouda / Staněk badges in the surname table */
.nm { display: inline-block; padding: 0.05rem 0.45rem; margin: 0 0.15rem 0.1rem 0; border-radius: 2px; font-size: 0.82rem; letter-spacing: 0.03em; }
.nm-k { background: #f1f2f4; color: var(--ink); }
.nm-s { background: var(--seal); color: #fff; }

/* "Next chapter" button at the end of each chapter */
.chapter-next { margin: 2.4rem 0 0.6rem; }
.chapter-next button { border: 1px solid var(--seal); background: transparent; color: var(--seal); padding: 0.65rem 1.1rem; font: inherit; font-size: 0.95rem; cursor: pointer; border-radius: 2px; text-align: left; }
.chapter-next button:hover { background: var(--seal); color: #fff; }
.chapter-next b { font-weight: 500; }

/* The chapter title is shown on the active chapter button, so it is not repeated above the text. */
.chapter > h3 { display: none; }

/* ---- Wersja 24 X 2026: fragmenty skanów, droga, zasady, paski, sąd ---- */
.scan { margin: 1.3rem 0 1.7rem; max-width: 880px; }
.scan img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #f1f2f4; }
.scan-tr { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-top: 0; background: #f7f8fa; }
.scan-tr span { padding: 0.55rem 0.8rem; font-size: 0.88rem; line-height: 1.4; }
.scan-o { font-family: var(--serif); font-style: italic; font-size: 1rem !important; color: var(--ink); border-right: 1px solid var(--line); }
.scan-p { color: var(--ink-soft); }
.scan-o::before, .scan-p::before { display: block; font-family: var(--sans); font-style: normal; font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--seal); margin-bottom: 0.15rem; }
.scan-o::before { content: "W księdze"; }
.scan-p::before { content: "Po polsku"; }
.scan figcaption { margin-top: 0.45rem; font-size: 0.82rem; color: var(--ink-soft); max-width: 70ch; }

.q { margin: 1.2rem 0 1.4rem; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 3px solid var(--seal); max-width: 64ch; }
.q p { font-family: var(--serif); font-size: 1.32rem; line-height: 1.35; font-style: italic; margin: 0 0 0.35rem; max-width: none !important; }
.q cite { font-style: normal; font-size: 0.8rem; color: var(--ink-soft); }

.route { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 1.6rem 0 1.8rem; padding: 0; max-width: 940px; counter-reset: st; }
.route li { position: relative; padding: 1.5rem 0.9rem 0 0; border-top: 2px solid var(--seal); }
.route li::before { content: ""; position: absolute; top: -8px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--seal); }
.route li:last-child::before { background: var(--seal); }
.route li:last-child { border-top-color: transparent; }
.route b { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; line-height: 1.05; }
.route i { font-style: normal; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--seal); }
.route time { display: block; font-size: 0.85rem; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.route span { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.15rem; }

.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 1.2rem 0 1.5rem; max-width: 980px; }
.rules div { background: #f7f8fa; border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 0.8rem 0.9rem 0.9rem; }
.rules em { display: block; font-style: normal; font-family: var(--serif); color: var(--seal); font-size: 1.3rem; line-height: 1; }
.rules b { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; margin: 0.25rem 0 0.3rem; line-height: 1.1; }
.rules span { font-size: 0.88rem; color: var(--ink-soft); }

.bars { margin: 1rem 0 0.4rem; max-width: 760px; border-top: 2px solid var(--ink); }
.bar { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 4.5rem; gap: 0.8rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.bar-l { font-size: 0.88rem; }
.bar-t { height: 14px; background: #f3f4f6; }
.bar-t span { display: block; height: 100%; background: #c3c8d0; }
.bar.hi .bar-t span { background: var(--seal); }
.bar-v { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--serif); font-size: 1.15rem; }
.bar.hi .bar-v { color: var(--seal); }

.court { list-style: none; margin: 1.2rem 0 1.5rem; padding: 0; max-width: 640px; }
.court li { position: relative; padding: 0.55rem 0 0.55rem 1rem; border-left: 2px solid var(--line); }
.court li:nth-child(2) { margin-left: 1.5rem; }
.court li:nth-child(3) { margin-left: 3rem; border-left-color: var(--seal); }
.court b { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.court span { font-size: 0.88rem; color: var(--ink-soft); }

@media (max-width: 680px) {
  .scan-tr { grid-template-columns: minmax(0, 1fr); }
  .scan-o { border-right: 0; border-bottom: 1px solid var(--line); }
  .route { grid-template-columns: minmax(0, 1fr); border-left: 2px solid var(--seal); padding-left: 1rem; }
  .route li { border-top: 0; padding: 0 0 1rem; }
  .route li::before { top: 4px; left: calc(-1rem - 8px); }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .bar { grid-template-columns: minmax(0, 1fr) 4.2rem; }
  .bar-t { grid-column: 1 / -1; grid-row: 2; }
  .court li:nth-child(2), .court li:nth-child(3) { margin-left: 0; }
}
/* Ramka pod skanem: tylko tłumaczenie, bez etykiety */
.scan-tr { grid-template-columns: minmax(0, 1fr); }
.scan-p::before { content: none; }
.scan-p { color: var(--ink); font-size: 0.92rem; }
/* Podstrony: widoczna tylko aktywna sekcja */
main > section.page-off { display: none; }
main > section { min-height: 100vh; }

/* Mini drzewo nazwisk (rozdział o przydomku) */
.ntree { position: relative; margin: 1.4rem 0 1.6rem; max-width: 900px; }
.nt-gen { position: relative; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.6rem; padding-bottom: 1.1rem; }
.nt-gen::before { content: ""; position: absolute; left: 1.2rem; top: 1.8rem; bottom: 0; border-left: 2px solid var(--seal); }
.nt-gen:last-child::before { display: none; }
.nt-g { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px solid var(--seal); background: var(--paper); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 0.95rem; color: var(--seal); position: relative; z-index: 1; }
.nt-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.nt-card { background: #ffffff; border: 1px solid var(--line); border-left: 4px solid #c3c8d0; padding: 0.45rem 0.7rem 0.5rem; min-width: 11rem; max-width: 19rem; opacity: 0.8; }
.nt-card.line { border-left-color: var(--seal); opacity: 1; }
.nt-card b { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.1; }
.nt-card em { display: block; font-style: normal; font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 0.25rem; }
.nt-f { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.2rem; }
.nt-f time { font-size: 0.75rem; color: var(--seal); font-variant-numeric: tabular-nums; min-width: 2.6rem; }
.nt-card small { display: block; font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.3rem; line-height: 1.3; }
.nt-card.hero { background: var(--ink); color: var(--paper); border-color: var(--ink); border-left-color: var(--seal); }
.nt-card.hero b { font-weight: 700; font-size: 1.3rem; }
.nt-card.hero em, .nt-card.hero small { color: #d9dde3; }
.nt-card.hero .nt-f time { color: #f0b9a8; }
@media (max-width: 680px) { .nt-card { min-width: 0; flex: 1 1 100%; max-width: none; } }
.nt-f { flex-wrap: wrap; }
.nt-f i { font-style: normal; font-size: 0.72rem; color: var(--ink-soft); }
.nt-card.hero .nt-f i { color: #d9dde3; }
.nt-card { max-width: 22rem; }
.nt-card b .nm { font-family: var(--sans); font-weight: 400; vertical-align: 2px; margin-left: 0.3rem; }
.nt-card { min-width: 9rem; }
/* Wyrównanie: nazwisko w jednej linii z imieniem, plakietki jednakowej wielkości */
.nt-card b { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.nt-card b .nm { margin: 0; vertical-align: baseline; }
.ntree .nm { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 1.35rem; min-width: 4.4rem; padding: 0 0.45rem; margin: 0; font-family: var(--sans); font-size: 0.78rem; font-weight: 400; line-height: 1; letter-spacing: 0.03em; }
.nt-f { align-items: center; gap: 0.4rem; margin-top: 0.35rem; }
/* Karta: siatka 2 kolumny – imię/rok | plakietki, żeby plakietki stały równo jedna pod drugą */
.nt-card { display: grid; grid-template-columns: max-content max-content; column-gap: 0.6rem; row-gap: 0.35rem; align-items: center; opacity: 1 !important; }
.nt-card b { display: block; }
.nt-card time { font-size: 0.75rem; color: var(--seal); font-variant-numeric: tabular-nums; }
.nt-card.hero time { color: #f0b9a8; }
.nt-s { display: flex; gap: 0.3rem; }
.nt-card:not(.line) b { color: var(--ink-soft); }

/* Drzewo genealogiczne z gałęziami (rozdział o przydomku) */
.ftree { overflow-x: auto; margin: 1.4rem 0 1.6rem; padding-bottom: 0.4rem; --br: #c3c8d0; }
.ftree ul { display: flex; justify-content: center; position: relative; margin: 0; padding: 22px 0 0; list-style: none; }
.ftree > ul { padding-top: 0; width: max-content; min-width: 100%; }
.ftree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 5px 0; list-style: none; }
.ftree > ul > li { padding-top: 0; }
.ftree li::before, .ftree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--br); }
.ftree li::after { right: auto; left: 50%; border-left: 2px solid var(--br); }
.ftree li:only-child::before, .ftree li:only-child::after { display: none; }
.ftree li:only-child { padding-top: 0; }
.ftree li:first-child::before, .ftree li:last-child::after { border: 0 none; }
.ftree li:last-child::before { border-right: 2px solid var(--br); }
.ftree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--br); }
.ftree li.ln > ul::before { border-left-color: var(--seal); }
.ftree li:only-child > .nt-card { margin-top: 0; }
.ftree .nt-card { min-width: 0; max-width: none; text-align: left; font-size: 0.85rem; }
.ftree .nt-card b { font-size: 1.05rem; white-space: nowrap; }
.ftree .nt-card.hero b { font-size: 1.15rem; }
/* kompaktowe karty w drzewie z gałęziami */
.ftree li { padding-left: 3px; padding-right: 3px; }
.ftree .nt-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; width: 92px; padding: 0.4rem 0.45rem 0.45rem; border-left-width: 3px; }
.ftree .nt-card b { white-space: normal; font-size: 0.98rem; line-height: 1.1; }
.ftree .nt-card.hero b { font-size: 1.05rem; }
.ftree .nt-card time { margin-top: 0.15rem; font-size: 0.7rem; }
.ftree .nt-s { flex-wrap: wrap; gap: 0.2rem; }
.ftree .nm { min-width: 0; width: 4.6rem; height: 1.25rem; font-size: 0.72rem; }
.ftree ul { align-items: flex-start; }
.ftree .nt-card { height: auto; align-self: center; }
/* plakietki w jednym wierszu (np. „Staněk Klouda” jako jeden zapis) */
.ftree .nt-card { width: auto; min-width: 78px; }
.ftree .nt-s { flex-wrap: nowrap; }
.ftree .nm { width: 4.2rem; }
.ftree li { padding-left: 2px; padding-right: 2px; }
/* nazwisko z chrztu tuż przy imieniu; lata zmian pod spodem, plakietki w jednej kolumnie */
.ftree .nt-card { display: grid; grid-template-columns: max-content max-content; column-gap: 0.35rem; row-gap: 0.25rem; align-items: center; justify-items: start; padding: 0.35rem 0.4rem 0.4rem; min-width: 0; }
.ftree .nt-card b { font-size: 0.92rem; white-space: nowrap; }
.ftree .nt-card.hero b { font-size: 1rem; }
.ftree .nt-card time { margin-top: 0; font-size: 0.66rem; }
.ftree .nm { width: 3.5rem; height: 1.15rem; font-size: 0.66rem; padding: 0 0.25rem; }
.ftree li { padding-left: 2px; padding-right: 2px; }
/* rodzeństwo spoza linii głównej: kafelki jeden pod drugim na jednej gałęzi */
.nt-stack { display: flex; flex-direction: column; align-items: stretch; gap: 8px; position: relative; }
.nt-stack .nt-card { position: relative; }
.nt-stack .nt-card + .nt-card::before { content: ""; position: absolute; top: -10px; left: 50%; height: 8px; border-left: 2px solid var(--br); }
.ftree .nm { display: inline-flex; align-items: center; justify-content: center; line-height: 1; box-sizing: border-box; }
.nt-stack .nt-card { width: 100%; box-sizing: border-box; grid-template-columns: 1fr max-content; }
/* rodzeństwo poziomo; drzewo przewijane/przeciągane, gdy się nie mieści */
.ftree { cursor: grab; }
.ftree.dragging { cursor: grabbing; user-select: none; }
.ftree .nt-card { column-gap: 0.3rem; padding: 0.3rem 0.35rem 0.35rem; }
.ftree .nt-card b { font-size: 0.86rem; }
.ftree .nm { width: 3.1rem; height: 1.1rem; font-size: 0.62rem; padding: 0 0.15rem; }
.ftree li { padding-left: 1px; padding-right: 1px; }
/* drzewo na całą szerokość treści (poza marginesy sekcji), czytelniejsze plakietki */
.ftree { margin-left: -6vw; margin-right: -6vw; padding-left: 1vw; padding-right: 1vw; }
.ftree .nt-card b { font-size: 0.92rem; }
.ftree .nm { width: 3.4rem; height: 1.15rem; font-size: 0.68rem; }
@media (max-width: 680px) { .ftree { margin-left: -16px; margin-right: -16px; } }

/* Pionowe drzewo (vtree.js) – ten sam styl co drzewo w zakładce „Drzewo” */
.vtree { position: relative; overflow-x: auto; overflow-y: hidden; margin: 1.4rem -6vw 1.6rem; padding: 0 1vw; cursor: grab;
  background: radial-gradient(circle, rgba(17, 20, 24, 0.07) 1px, transparent 1.2px) 0 0 / 18px 18px, #f8f9fb;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vtree.dragging { cursor: grabbing; user-select: none; }
.vt-stage { position: relative; margin: 0 auto; }
.vt-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.vt-links { position: absolute; left: 0; top: 0; pointer-events: none; }
.vt-links path { fill: none; stroke-width: 1.6; }
.vt-links path.g { stroke: rgba(91, 97, 112, 0.5); }
.vt-links path.r { stroke: var(--seal); stroke-width: 2; }
.vt-card { position: absolute; white-space: nowrap; background: #ffffff; border: 1px solid var(--line); border-left: 4px solid #c3c8d0;
  padding: 0.35rem 0.5rem 0.4rem; box-shadow: 0 1px 2px rgba(17, 20, 24, 0.06);
  display: grid; grid-template-columns: max-content max-content; column-gap: 0.4rem; row-gap: 0.25rem; align-items: center; }
.vt-card.line { border-left-color: var(--seal); }
.vt-card b { font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.vt-card time { font-size: 0.7rem; color: var(--seal); font-variant-numeric: tabular-nums; }
.vt-card .nt-s { display: flex; gap: 0.25rem; }
.vt-card .nm { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 3.6rem; height: 1.2rem; margin: 0; padding: 0 0.2rem; font-family: var(--sans); font-size: 0.7rem; line-height: 1; }
.vt-card.hero { background: var(--ink); color: var(--paper); border-color: var(--ink); border-left-color: var(--seal); }
.vt-card.hero b { font-size: 1.1rem; }
.vt-card.hero time { color: #f0b9a8; }
.vt-tog { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); min-width: 24px; height: 22px; padding: 0 0.3rem;
  border: 1px solid var(--ink-soft); border-radius: 11px; background: #ffffff; color: var(--ink); font-size: 0.72rem; line-height: 1; cursor: pointer; z-index: 2; }
.vt-tog[aria-expanded="false"] { background: var(--seal); border-color: var(--seal); color: #fff; }
.vt-tog:hover { border-color: var(--seal); }
@media (max-width: 680px) { .vtree { margin-left: -16px; margin-right: -16px; } }
.vt-card { padding: 0.3rem 0.4rem 0.35rem; column-gap: 0.3rem; }
.vt-card .nm { width: 3.3rem; }
/* vtree: pasek przybliżania i okno z przewijaniem/przeciąganiem */
.vtree { overflow: visible; cursor: default; background: none; border: 0; padding: 0; }
.vt-bar { display: flex; align-items: center; gap: 0.3rem; padding: 0 1vw 0.4rem; }
.vt-bar button { border: 1px solid var(--line); background: #f7f8fa; color: var(--ink); min-width: 2rem; height: 1.9rem; padding: 0 0.6rem; font: inherit; font-size: 0.85rem; cursor: pointer; }
.vt-bar button:hover { border-color: var(--seal); color: var(--seal); }
.vt-bar output { min-width: 3.2rem; text-align: center; font-size: 0.8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.vt-view { position: relative; overflow: auto; cursor: grab; touch-action: pan-x pan-y;
  background: radial-gradient(circle, rgba(17, 20, 24, 0.07) 1px, transparent 1.2px) 0 0 / 18px 18px, #f8f9fb;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vt-view.dragging { cursor: grabbing; user-select: none; }
.vt-tog { display: none; }

/* === Porządek kolumny rozdziału: wszystkie bloki w tej samej szerokości co tekst === */
.chapter { --col: 46rem; }
.chapter > * { max-width: var(--col); }
.chapter .deck, .chapter .src, .chapter .q, .chapter .note { max-width: var(--col); }
.chapter .scan, .chapter .ph, .chapter .rules, .chapter .bars, .chapter .route, .chapter .court, .chapter .tbl, .chapter .vtree { width: 100%; max-width: var(--col); margin-left: 0; margin-right: 0; }
.chapter .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* vtree w kolumnie tekstu, kontrolki w prawym górnym rogu okna drzewa */
.vtree { position: relative; margin: 1.4rem 0 1.6rem; padding: 0; }
.vt-bar { position: absolute; top: 6px; right: 6px; z-index: 3; padding: 0.2rem; gap: 0.2rem; background: rgba(250, 246, 238, 0.92); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(17, 20, 24, 0.08); }
.vt-bar button { min-width: 1.7rem; height: 1.6rem; padding: 0 0.45rem; font-size: 0.8rem; }
.vt-bar input[type="range"] { width: 6.5rem; accent-color: var(--seal); }
.vt-bar output { min-width: 2.6rem; font-size: 0.75rem; }
.vt-view { border: 1px solid var(--line); }
/* ciaśniejsze kafelki */
.vt-card { padding: 0.25rem 0.35rem 0.3rem; column-gap: 0.25rem; row-gap: 0.2rem; }
.vt-card b { font-size: 0.95rem; }
.vt-card .nm { width: 3.1rem; height: 1.1rem; font-size: 0.66rem; padding: 0 0.15rem; }
.vt-card time { font-size: 0.66rem; }
@media (max-width: 680px) {
  .vt-bar input[type="range"] { display: none; }
  .chapter .rules { grid-template-columns: minmax(0, 1fr); }
}
.chapter p { max-width: var(--col); }
@media (max-width: 680px) { .vt-bar { right: 4px; top: 4px; } }
@media (max-width: 680px) { .vt-bar { position: static; width: max-content; margin: 0 0 4px auto; } }
.chapter { --col: 62rem; }
/* skany nie są rozciągane ponad swoją naturalną wielkość */
.chapter .scan { width: fit-content; }
.chapter .scan img { width: auto; max-width: 100%; max-height: 480px; }
.chapter .scan figcaption { max-width: none; }
/* pasek przybliżania nad oknem drzewa, po prawej (poza widokiem drzewa) */
.vt-bar { position: static; width: max-content; margin: 0 0 6px auto; box-shadow: none; }

/* Wacław w drzewie: wyróżniony ramką zamiast czarnego tła */
.vt-card.hero { background: #ffffff; color: var(--ink); border: 2px solid var(--seal); border-left-width: 5px; }
.vt-card.hero b { font-weight: 700; }
.vt-card.hero time { color: var(--seal); }

/* „Skaner” na skanach: oryginał, a spod niego po przeciągnięciu wyłania się tłumaczenie */
.sx { position: relative; display: block; container-type: inline-size; cursor: ew-resize; user-select: none; touch-action: pan-y; overflow: hidden; border: 1px solid var(--line); }
.sx img { display: block; border: 0 !important; }
.sx-tr { position: absolute; inset: 0; background: #f6efe2;
  background-image: repeating-linear-gradient(0deg, transparent 0 23px, rgba(178, 74, 38, 0.06) 23px 24px);
  clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.sx-tr span { position: absolute; display: flex; align-items: center; padding: 0 0.6cqw; box-sizing: border-box;
  font-family: var(--serif); font-style: italic; font-size: 1.7cqw; line-height: 1.2; color: var(--ink); overflow: hidden; }
.sx-tr span b { font-weight: 600; font-style: normal; color: var(--seal); }
.sx-line { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; background: var(--seal); box-shadow: 0 0 10px 2px rgba(178, 74, 38, 0.35); }
.sx-line i { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: var(--seal); color: #fff; font-style: normal; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.sx-line:focus-visible { outline: 2px solid var(--ink); }
.sx-tr span em { display: block; font-style: italic; }

/* === Duże ekrany: płynna wielkość, wyśrodkowana kolumna, szersze drzewo === */
html { font-size: clamp(16px, calc(10px + 0.5vw), 20px); }
body { font-size: 1.0625rem; }
:root { --col: 62rem; --wide: 84rem; }
section > * { max-width: var(--wide); margin-left: auto; margin-right: auto; }
#historie > *, .chapter > * { max-width: var(--col); margin-left: auto; margin-right: auto; }
.chapter { --col: 62rem; }
/* drzewo wychodzi szerzej niż tekst, ale symetrycznie względem kolumny */
.chapter > .vtree { --w: 100%; /* drzewko nigdy nie szersze niż kolumna tekstu */ width: var(--w); max-width: none; margin-left: calc((100% - var(--w)) / 2); margin-right: 0; }
@media (max-width: 680px) { .chapter > .vtree { --w: 100%; } }
/* skan nigdy szerszy niż jego naturalny rozmiar (ustawiane w app.js) i nie szerszy niż kolumna */
.chapter .scan { width: 100%; }
.chapter { max-width: var(--col); }
.chapter, #historie > *, .chapter > * { --col: 52rem; } :root { --col: 52rem; }
.chapter > .vtree { min-width: min(100%, 30rem); }
:root { --side: 12.25rem; }

/* Skaner metryk: tłumaczenie jako tabela z nagłówkami kolumn; skany zawsze wyśrodkowane */
.chapter .scan { margin-left: auto; margin-right: auto; }
.chapter .scan figcaption { text-align: center; }
.sx-tr.tb span { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; border-right: 1px solid rgba(178, 74, 38, 0.28); }
.sx-tr.tb span:last-child { border-right: 0; }
/* papier: drobne ziarno + delikatne smugi włókien + lekko pociemniałe brzegi */
.sx-tr, .sx-tr.tb { background-color: #fffefb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.40 0 0 0 0 0.36 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.05' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.47 0 0 0 0 0.42 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"), radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%);
  background-size: 220px 220px, 600px 600px, 100% 100%;
  box-shadow: inset 0 0 2cqw rgba(120, 105, 85, 0.11); }
.sx-tr.tb span > small { display: block; font-family: var(--sans); font-style: normal; font-weight: 600; font-size: max(6.5px, calc(var(--colw, 936px) * 0.013 * var(--ls, 1))); line-height: max(6.5px, calc(var(--colw, 936px) * 0.013));
  text-transform: uppercase; letter-spacing: 0.02em; color: var(--seal); padding: 1cqw 0.5cqw 0.9cqw; white-space: nowrap; overflow: hidden;
  border-bottom: 1px solid rgba(178, 74, 38, 0.35); background: rgba(178, 74, 38, 0.07); }
.sx-tr .sx-n { font-family: var(--sans); font-style: normal; font-size: 0.75em; color: var(--ink-soft); }
.sx-tr.tb em { margin: auto 0; padding: 0 0.6cqw; }

.sx-tr { inset: -1px; }

.chapter .scanx.tall img { max-height: none; }
.sx-tr:not(.tb) span em { text-align: left; }
.sx-tr i.ctr { display: block; text-align: center; font-style: inherit; }
.sx-tr:not(.tb) span em { width: 100%; }

/* Nawigacja między rozdziałami i jednakowy odstęp przed źródłami */
.chapter-nav { display: flex; justify-content: space-between; align-items: stretch; gap: 1rem; margin: 3.5rem auto 0; }
.chapter-nav button { flex: 0 1 48%; display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid var(--seal); background: transparent; color: var(--seal);
  padding: 0.7rem 1.1rem; font: inherit; font-size: 0.85rem; cursor: pointer; border-radius: 2px; text-align: left; }
.chapter-nav button b { font-weight: 500; font-size: 1rem; }
.chapter-nav .ch-next { margin-left: auto; text-align: right; align-items: flex-end; }
.chapter-nav button:hover { background: var(--seal); color: #fff; }
.chapter .src { margin-top: 3.5rem; }
.chapter-nav + .src { margin-top: 2.5rem; }
@media (max-width: 560px) { .chapter-nav { flex-direction: column; } .chapter-nav button { flex-basis: auto; } .chapter-nav .ch-next { margin-left: 0; } }

/* linki w tekście rozdziałów */
.chapter p a, .chapter li a { color: var(--seal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.chapter p a:hover { text-decoration-thickness: 2px; }

/* mapki obok siebie */
.chapter .maps { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; margin: 1.3rem auto 1.7rem; }
.chapter .maps figure { margin: 0; }
.chapter .maps img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fbf8f1; }
.chapter .maps figcaption { margin-top: 0.45rem; font-size: 0.82rem; color: var(--ink-soft); }
@media (max-width: 680px) { .chapter .maps { grid-template-columns: 1fr; } }
.chapter figcaption a { color: var(--seal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* przybliżana mapa historyczna */
.chapter .zfig { margin: 1.3rem auto 1.7rem; }
.chapter .zmap { width: 100%; height: min(70vh, 620px); background: #f3ece0; border: 1px solid var(--line); }
.chapter [data-zmap="zedowice"]:not(.leaflet-container) {
  height: auto;
  aspect-ratio: 1040 / 680;
  background: #f5efe2 url("img/zedowice-odleglosci.png") center / contain no-repeat;
}
.chapter .zfig figcaption { margin-top: 0.45rem; font-size: 0.82rem; color: var(--ink-soft); }
.zmap-label { background: #1a73e8; color: #fff; border: 0; font: 600 0.85rem/1.2 var(--sans, sans-serif); padding: 3px 8px; box-shadow: none; }
.zmap-label::before { border-right-color: #1a73e8 !important; }
.zmap-btns a { width: auto !important; padding: 0 10px; font: 0.8rem/30px var(--sans, sans-serif); color: var(--ink) !important; white-space: nowrap; }
.zmap-btns a + a { border-top: 1px solid #ccc; }
.zmap .leaflet-control-layers { font: 0.8rem/1.4 var(--sans, sans-serif); color: var(--ink); }
.zmap-op { display: block; padding: 4px 10px 6px; font: 0.75rem/1.2 var(--sans, sans-serif); color: var(--ink); background: #fff; border-top: 1px solid #ccc; }
.zmap-op input { display: block; width: 110px; margin-top: 3px; accent-color: #b24a26; }
.zmap-pin { background: none; border: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35)); }

/* Dwa domy na osi czasu (rozdz. o karczmie) */
.houses { margin: 1.4rem 0 1.8rem; max-width: 980px; }
.hs-in { overflow-x: auto; }
.hs-lane { display: grid; grid-template-columns: 9.5rem 1fr; align-items: center; gap: 0.8rem; min-width: 640px; }
.hs-lane + .hs-lane { margin-top: 0.5rem; }
.hs-name b { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; line-height: 1.1; }
.hs-name span { font-size: 0.78rem; color: var(--ink-soft); letter-spacing: 0.06em; text-transform: uppercase; }
.hs-track { position: relative; height: 3.4rem; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.hs-seg { position: absolute; top: 0; bottom: 0; padding: 0.35rem 0.45rem; overflow: hidden; border-right: 2px solid var(--paper); color: #fff; }
.hs-seg i { display: block; font-style: normal; font-family: var(--serif); font-size: 1.05rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-seg small { display: block; font-size: 0.72rem; opacity: 0.85; white-space: nowrap; }
.g1 { background: #111418; }
.g2 { background: #b24a26; }
.g3 { background: #b06a45; }
.g4 { background: #d8b48c; color: var(--ink); }
.hs-seg.g4 { color: var(--ink); }
.g0 { background: repeating-linear-gradient(45deg, var(--paper-2) 0 4px, transparent 4px 8px); }
.hs-axis .hs-track { height: 1.4rem; border: 0; border-top: 1px solid var(--line); }
.hs-axis span { position: absolute; top: 0.2rem; transform: translateX(-50%); font-size: 0.75rem; color: var(--ink-soft); }
.hs-axis span::before { content: ""; position: absolute; left: 50%; top: -0.45rem; height: 0.3rem; border-left: 1px solid var(--ink-soft); }
.hs-leg { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.7rem; font-size: 0.85rem; color: var(--ink-soft); }
.hs-leg span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hs-leg i { width: 0.9rem; height: 0.9rem; display: inline-block; }

/* Rozdział o Honzie: mapa drogi ze słupem */
.zmap-label-p { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.zmap-label-p.sm { font-weight: 500; font-size: 0.75rem; }
.zmap-label-p::before { border-right-color: #fff !important; border-left-color: #fff !important; }
.zmap-label-post { background: #b24a26; }
.zmap-label-post::before { border-right-color: #b24a26 !important; }
.zmap-label-b { background: #7b3fa0; }
.zmap-walk { background: #fffdf8; border: 1px solid var(--line); padding: 0.6rem 0.7rem; max-width: 230px; font: 0.82rem/1.35 var(--sans, sans-serif); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.zmap-walk button { display: block; width: 100%; border: 0; background: #b24a26; color: #fff; font: 600 0.85rem var(--sans, sans-serif); padding: 0.45rem 0.6rem; cursor: pointer; }
.zmap-walk output { display: block; font-family: var(--serif); font-size: 1.6rem; margin: 0.35rem 0 0.1rem; }
.zmap-walk span { display: block; color: var(--ink-soft); }
.zmap-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin-top: 0.45rem; font-size: 0.8rem; color: var(--ink-soft); }
.zmap-legend i { display: inline-block; width: 1.6rem; height: 0; vertical-align: middle; margin-right: 0.35rem; border-top: 4px solid #b24a26; }
.zmap-legend i.r { border-top: 3px dashed rgba(141,47,36,0.5); }
.zmap-legend i.b { border-top: 3px dotted #7b3fa0; }

/* Rysopis więzienny */
.rysopis { max-width: 520px; margin: 1.4rem 0 1.6rem; background: #fbf7ee; border: 1px solid #d5dbe2; box-shadow: 4px 4px 0 var(--paper-2); padding: 1rem 1.2rem 1.1rem; font-family: var(--serif); }
.rysopis header { border-bottom: 2px solid var(--ink); padding-bottom: 0.4rem; margin-bottom: 0.6rem; }
.rysopis header b { display: block; font-size: 1.35rem; font-weight: 500; letter-spacing: 0.04em; }
.rysopis header span { font: 0.75rem var(--sans, sans-serif); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.rysopis dl { display: grid; grid-template-columns: 9.5rem 1fr; margin: 0; }
.rysopis dt, .rysopis dd { margin: 0; padding: 0.28rem 0; border-bottom: 1px dotted #d5dbe2; }
.rysopis dt { font: 0.78rem var(--sans, sans-serif); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); padding-top: 0.42rem; }
.rysopis dd { font-size: 1.08rem; font-style: italic; }
.rysopis footer { margin-top: 0.7rem; font-size: 1.05rem; color: var(--seal); font-style: italic; }

/* Kartoteka wyroków */
.rap { list-style: none; margin: 1.2rem 0 1.6rem; padding: 0; max-width: var(--col, 760px); border-top: 2px solid var(--ink); }
.rap li { display: grid; grid-template-columns: 4.2rem 1fr 9.5rem; gap: 0.9rem; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.rap time { font-family: var(--serif); font-size: 1.35rem; color: var(--seal); }
.rap span { font-size: 0.95rem; }
.rap em { font-style: normal; font-size: 0.82rem; color: var(--ink-soft); text-align: right; }
.rap li.sum { border-bottom: 0; }
.rap li.sum span { font-family: var(--serif); font-size: 1.2rem; }
@media (max-width: 640px) { .rap li { grid-template-columns: 3.4rem 1fr; } .rap em { grid-column: 2; text-align: left; } .rysopis dl { grid-template-columns: 7rem 1fr; } }

/* Obrazek bez ramki i tła (np. rysunek Honzy) */
.chapter .ph.bare { text-align: center; }
.chapter .ph.bare img { display: block; margin: 0 auto; width: auto; max-width: 100%; max-height: 640px; background: none; border: 0; }
.chapter .ph.bare figcaption { margin-left: auto; margin-right: auto; }

/* Rozdział o Wiszence (26 X 2026): kolory miejsc w drzewie, szersze paski z kwotami */
.vt-card.pl-w { border-left-color: #2f6b4a; background: #eef5ef; }
.vt-card.pl-z { border-left-color: #a8641e; background: #fbf3ef; }
.vt-card.pl-l { border-left-color: #3a5a8c; background: #eef2f9; }
.vt-card.pl-m { border-left-color: #7a808c; background: #f4f0ea; }
.vt-leg { display: flex; flex-wrap: wrap; gap: 0.35rem 1.2rem; margin: -0.8rem 0 1.4rem; font-size: 0.85rem; color: var(--ink-soft); }
.vt-leg span { display: inline-flex; align-items: center; gap: 0.4rem; }
.vt-leg i { display: inline-block; width: 0.95rem; height: 0.95rem; border-left: 4px solid; }
.vt-leg i.pl-w { border-color: #2f6b4a; background: #eef5ef; }
.vt-leg i.pl-z { border-color: #a8641e; background: #fbf3ef; }
.vt-leg i.pl-l { border-color: #3a5a8c; background: #eef2f9; }
.vt-leg i.pl-m { border-color: #7a808c; background: #f4f0ea; }
.bars.money .bar { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 7.2rem; }
.bar-l small { display: block; font-size: 0.75rem; color: var(--ink-soft); }
@media (max-width: 680px) { .bars.money .bar { grid-template-columns: minmax(0, 1fr) 6.6rem; } }

/* ===== Honza z Bříště (27 X 2026): oś życia i „Podanie i akta” – honza.js ===== */
.chapter .htl, .chapter .hleg, .chapter .htl-list { width: 100%; max-width: var(--col); }
.htl { margin: 1.2rem 0 0.6rem; }
.htl-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.5rem; }
.htl-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.htl-legend i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; }
.htl-legend i.k-w { background: var(--seal); }
.htl-legend i.k-n { background: #ffffff; border: 2px solid var(--seal); box-sizing: border-box; }
.htl-legend i.k-j { width: 1.4rem; height: 0.55rem; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px), #c9643f; }
.htl-scroll { overflow-x: auto; border: 1px solid var(--line); background: #f8f9fb; }
.htl-track { position: relative; min-width: 640px; padding: 0.6rem 1rem 0.2rem 5.6rem; }
.htl-row { position: relative; border-bottom: 1px dashed var(--line); }
.htl-lab { position: absolute; left: -5rem; top: 50%; transform: translateY(-50%); width: 4.6rem; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.htl-ev { height: 4.6rem; }
.htl-dot { position: absolute; bottom: calc(0.55rem + var(--lane) * 1.55rem); transform: translateX(-50%); width: 1.45rem; height: 1.45rem; padding: 0; border-radius: 50%;
  border: 2px solid var(--seal); background: var(--seal); color: #fff; font: 600 0.62rem/1 var(--sans); cursor: pointer; display: grid; place-items: center; transition: transform 0.15s, box-shadow 0.15s; }
.htl-dot.k-n { background: #ffffff; color: var(--seal); }
.htl-dot:hover, .htl-dot:focus-visible { transform: translateX(-50%) scale(1.2); outline: none; box-shadow: 0 0 0 3px rgba(178, 74, 38, 0.25); }
.htl-dot.on { transform: translateX(-50%) scale(1.25); box-shadow: 0 0 0 3px var(--ink); }
.htl-jail { height: 1.8rem; }
.htl-bar { position: absolute; top: 0.45rem; height: 0.9rem; padding: 0; border: 0; border-radius: 2px; cursor: pointer; min-width: 4px;
  background: repeating-linear-gradient(90deg, rgba(17, 20, 24, 0.55) 0 2px, transparent 2px 6px), #c9643f; }
.htl-bar:hover, .htl-bar:focus-visible, .htl-bar.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.htl-life { height: 2.6rem; border-bottom: 0; }
.htl-life-i { position: absolute; top: 0.2rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; }
.htl-life-i i { width: 1px; height: 0.45rem; background: var(--ink-soft); }
.htl-life-i em { font-style: normal; font-size: 0.7rem; color: var(--ink-soft); }
.htl-life-i.lo { top: 1.1rem; }
.htl-life-i.lo i { height: 1.3rem; margin-top: -0.9rem; }
.htl-axis { position: relative; height: 1.4rem; border-top: 1px solid var(--ink); }
.htl-axis span { position: absolute; top: 0.2rem; transform: translateX(-50%); font-size: 0.72rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.htl-axis span::before { content: ""; position: absolute; left: 50%; top: -0.45rem; height: 0.3rem; border-left: 1px solid var(--ink); }
.htl-out { margin-top: 0.7rem; min-height: 3rem; }
.htl-hint { margin: 0; padding: 0.8rem 1rem; border: 1px dashed var(--line); color: var(--ink-soft); font-size: 0.9rem; }
.htl-card { border: 1px solid var(--line); border-left: 4px solid var(--seal); background: #ffffff; padding: 0.8rem 1rem 0.7rem; animation: htlIn 0.2s ease-out; }
.htl-card.k-n { border-left-style: dashed; }
.htl-card.k-j { border-left-color: #c9643f; }
@keyframes htlIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.htl-card header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.7rem; margin-bottom: 0.35rem; }
.htl-card header b { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.htl-card time { font-size: 0.78rem; color: var(--seal); letter-spacing: 0.04em; }
.htl-no { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--seal); color: #fff; font-size: 0.65rem; font-weight: 600; align-self: center; }
.htl-card.k-n .htl-no { background: #ffffff; color: var(--seal); border: 2px solid var(--seal); box-sizing: border-box; }
.htl-card p { margin: 0 0 0.5rem; font-size: 0.95rem; }
.htl-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0 0 0.5rem; font-size: 0.85rem; }
.htl-card dt { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); padding-top: 0.15rem; }
.htl-card dd { margin: 0; }
.htl-card nav { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 0.45rem; font-size: 0.78rem; color: var(--ink-soft); }
.htl-card nav button { border: 0; background: none; color: var(--seal); font: inherit; cursor: pointer; padding: 0.2rem 0; }
.htl-card nav button:disabled { color: var(--line); cursor: default; }
.htl-sum { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.htl-list { margin: 0.4rem 0 1.4rem; }
.htl-list summary { cursor: pointer; font-size: 0.85rem; color: var(--seal); }
.htl-list .tbl { margin-top: 0.6rem; }

.hleg { margin: 1.2rem 0 1.6rem; border: 1px solid var(--line); background: #f8f9fb; }
.hleg-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.hleg-tabs button { border: 1px solid var(--line); background: #ffffff; color: var(--ink-soft); font: 0.88rem/1 var(--sans); padding: 0.45rem 0.75rem; border-radius: 999px; cursor: pointer; }
.hleg-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.hleg-stage { position: relative; min-height: 12rem; user-select: none; touch-action: pan-y; cursor: col-resize; overflow: hidden; transition: height 0.15s; }
.hleg-pane { position: absolute; top: 0; bottom: 0; overflow: hidden; box-sizing: border-box; }
.hleg-in { padding: 1.1rem 1.4rem 1.2rem; transition: opacity 0.15s; }
.hleg-pane.thin .hleg-in { opacity: 0; }
.hleg-lg { left: 0; right: calc(100% - var(--p)); background: #f4ead5; background-image: radial-gradient(rgba(178, 74, 38, 0.07) 1px, transparent 1px); background-size: 9px 9px; }
.hleg-ar { left: var(--p); right: 0; background: #fffdf8; background-image: repeating-linear-gradient(#fffdf8 0 27px, rgba(58, 90, 140, 0.13) 27px 28px); }
.hleg-lg .hleg-in { padding-right: 1.6rem; }
.hleg-ar .hleg-in { padding-left: 1.6rem; }
.hleg-tag { padding-left: 0; }
.hleg-tag { display: inline-block; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0.2rem 0.5rem; margin-bottom: 0.4rem; }
.hleg-lg .hleg-tag { background: var(--seal); color: #fff; }
.hleg-ar .hleg-tag { background: #3a5a8c; color: #fff; }
.hleg-pane h5 { margin: 0 0 0.45rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.hleg-lg .hleg-txt p { font-family: var(--serif); font-size: 1.12rem; font-style: italic; line-height: 1.45; }
.hleg-ar .hleg-txt p { font-size: 0.95rem; line-height: 1.5; }
.hleg-txt p { margin: 0 0 0.5rem; }
.hleg-who { margin: 0.4rem 0 0; font-size: 0.75rem; color: var(--ink-soft); }
.hleg-who::before { content: "— "; }
.hleg-line { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; background: var(--ink); z-index: 2; }
.hleg-line i { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 0.9rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.hleg-line:focus-visible { outline: 2px solid var(--seal); }
.hleg-note { margin: 0; padding: 0.75rem 1.4rem; border-top: 1px solid var(--line); font-size: 0.9rem; background: #ffffff; }
.hleg-note b { color: var(--seal); font-weight: 600; }
.hleg-quick { display: flex; gap: 0.4rem; justify-content: center; padding: 0 1rem 0.8rem; background: #ffffff; }
.hleg-quick button { border: 0; background: none; color: var(--ink-soft); font: 0.75rem var(--sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@media (max-width: 680px) {
  .hleg-in { padding: 0.9rem 0.9rem 1rem; }
  .hleg-pane h5 { font-size: 1.25rem; }
  .hleg-lg .hleg-txt p { font-size: 1rem; }
}

/* Kafelki drzewek w rozdziałach, które prowadzą do karty osoby (vtree.js) */
.vt-card.vt-link { cursor: pointer; }
.vt-card.vt-link:hover, .vt-card.vt-link:focus-visible { box-shadow: 0 0 0 2px var(--seal); outline: none; }
.vtree .vt-view.dragging .vt-card.vt-link { cursor: grabbing; }

/* rycina otwierająca rozdział */
.chapter .ph.hero { max-width: none; width: 100%; margin: 0.6rem 0 2.2rem; }
.chapter .ph.hero img { width: 100%; max-height: none; height: auto; border: 0; background: none; box-shadow: none; }
.chapter .ph.hero figcaption { max-width: var(--col); }

/* Spis rozdziałów w częściach (zakładka Historie) i widoczny tytuł rozdziału */
.toc { margin: 0.6rem 0 2.8rem; border-top: 1px solid var(--line); max-width: 920px; }
.toc-part { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.toc-part > h4 { margin: 0.45rem 0 0; font-family: inherit; font-size: 0.72rem; font-weight: 500; line-height: 1.3; letter-spacing: 0.16em; text-transform: uppercase; color: var(--seal); }
.toc-part > h4 small { display: block; margin-top: 0.2rem; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: none; color: var(--ink-soft); }
.toc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.45rem 1.2rem; }
.toc-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: 0.35rem; align-items: baseline; text-align: left; background: none; border: 0; border-left: 2px solid transparent; padding: 0.4rem 0.5rem; cursor: pointer; color: var(--ink); font: inherit; }
.toc-item .n { font-family: var(--serif); font-size: 1.5rem; color: var(--ink-soft); }
.toc-item .t { font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.toc-item:hover .t { color: var(--seal); }
.toc-item[aria-pressed="true"] { border-left-color: var(--seal); background: rgba(178, 74, 38, 0.06); }
.toc-item[aria-pressed="true"] .n, .toc-item[aria-pressed="true"] .t { color: var(--seal); }
.chapter > h3 { display: block; font-size: 3.2rem; margin: 0 0 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.chapter > .ch-kicker { font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--seal); margin: 0 0 0.5rem; }
.chapter > .ch-kicker span { color: var(--ink-soft); }
@media (max-width: 680px) {
  .toc-part { grid-template-columns: 1fr; gap: 0.4rem; }
  .chapter > h3 { font-size: 2.3rem; }
}

/* Spis rozdziałów z prawej strony tekstu (szerokie ekrany); na węższych – zwijany pasek u góry */
.toc-toggle { display: none; }
@media (min-width: 1100px) {
  #historie { display: grid; grid-template-columns: minmax(0, 52rem) 15rem; column-gap: 3rem; justify-content: center; align-items: start; }
  #historie > * { grid-column: 1; margin-left: 0; margin-right: 0; }
  #historie > #chapter-box { grid-column: 1; grid-row: 1; }
  #historie > #chapters.toc { grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; margin: 0; border: 0; max-width: none; max-height: calc(100vh - 3rem); overflow-y: auto; }
  #chapters .toc-part { display: block; padding: 0 0 0.9rem; border: 0; }
  #chapters .toc-part > h4 { margin: 0 0 0.3rem; font-size: 0.66rem; }
  #chapters .toc-part > h4 small { display: inline; margin-left: 0.4rem; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; }
  #chapters .toc-list { display: block; border-left: 1px solid var(--line); }
  #chapters .toc-item { width: 100%; grid-template-columns: 1.35rem minmax(0, 1fr); padding: 0.35rem 0.6rem; margin-left: -1px; }
  #chapters .toc-item .n { font-size: 0.95rem; }
  #chapters .toc-item .t { font-size: 0.98rem; }
}
@media (max-width: 1099px) {
  #chapters.toc { position: sticky; top: 0; z-index: 20; background: var(--paper, #ffffff); border-top: 0; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
  .toc-toggle { display: flex; align-items: baseline; gap: 0.7rem; width: 100%; background: none; border: 0; padding: 0.7rem 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
  .toc-toggle small { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--seal); white-space: nowrap; }
  .toc-toggle span { font-family: var(--serif); font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toc-toggle i { margin-left: auto; font-style: normal; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
  #chapters .toc-part { display: none; }
  #chapters.toc-open .toc-part { display: grid; }
  #chapters.toc-open { max-height: 85vh; overflow-y: auto; }
}
@media (max-width: 680px) { #chapters.toc-open .toc-part { display: block; } }

/* Zdjęcia w rozdziałach: bez ramki i tła, wyśrodkowane, w naturalnym rozmiarze (najwyżej szerokość kolumny) */
.chapter .ph:not(.hero) { text-align: center; }
.chapter .ph:not(.hero) img { display: block; width: auto; height: auto; max-width: 100%; max-height: none; margin: 0 auto; border: 0; background: none; box-shadow: none; }
.chapter .ph:not(.hero) figcaption { margin-left: auto; margin-right: auto; }
.chapter .two .ph img { height: auto; }

/* Krechów: dwie akwarele Rybkowskiego w jednym wierszu, równej wysokości */
.two.two-krechow { grid-template-columns: 1.559fr 1.354fr; }
@media (max-width: 680px) { .two.two-krechow { grid-template-columns: minmax(0, 1fr); } }

/* Powiększenie zdjęć po kliknięciu (lightbox.js) */
figure.ph img, figure.scan:not(.scanx) img { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 9999; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; padding: 2.5rem 1rem 1rem; background: rgba(20, 16, 12, 0.92); cursor: zoom-out; }
.lb.open { display: flex; }
.lb img { display: block; flex: 1 1 auto; min-height: 0; width: 100%; height: 100%; object-fit: contain; border: 0; background: none; box-shadow: none; }
.lb-cap { margin: 0; max-width: 80ch; text-align: center; color: #e9e1d4; font-size: 0.85rem; }
.lb-cap a { color: inherit; }
.lb-x { position: absolute; top: 0.4rem; right: 0.8rem; border: 0; background: none; color: #fff; font-size: 2.2rem; line-height: 1; padding: 0.2rem 0.5rem; cursor: pointer; }
html.lb-lock { overflow: hidden; }

.zmap-label-d { background: #b24a26; }
.zmap-label-d::before { border-top-color: #b24a26 !important; border-bottom-color: #b24a26 !important; border-right-color: #b24a26 !important; }

/* pasek przełączników pod mapą (zmap-bar.js) */
.zmap-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.6rem; padding: 0.6rem 0.75rem; background: #f7f8fa; border: 1px solid var(--line); border-top: 0; font: 0.82rem/1.2 var(--sans); color: var(--ink); }
.zbar-g { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.zbar-t { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.zbar-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.zbar-seg button { border: 0; padding: 0.34rem 0.8rem; font: inherit; color: var(--ink); background: none; }
.zbar-seg button + button { border-left: 1px solid var(--line); }
.zbar-seg button:hover { background: #eef4fd; }
.zbar-seg button[aria-pressed="true"] { background: #1a73e8; color: #fff; }
.zbar-op { display: inline-flex; align-items: center; gap: 0.45rem; }
.zbar-op input { width: 120px; accent-color: #1a73e8; }
.zbar-op input:disabled { opacity: 0.35; }
.zbar-op output { min-width: 2.8em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.zbar-go { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.zbar-go button { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 0.34rem 0.8rem; font: inherit; color: var(--ink); }
.zbar-go button:hover { border-color: #1a73e8; color: #1a73e8; }
.zbar-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chapter .zmap-bar + .note, .chapter .zfig .zmap-bar ~ figcaption { margin-top: 0.45rem; }
@media (max-width: 680px) {
  .zmap-bar { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .zbar-seg button, .zbar-go button { padding: 0.55rem 0.9rem; }
  .zbar-op input { flex: 1; width: auto; }
}

.zbar-tog { display: inline-flex; align-items: center; gap: 0.45rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 0.34rem 0.8rem; font: inherit; color: var(--ink); }
.zbar-tog:hover { border-color: #1a73e8; }
.zbar-box { width: 0.85rem; height: 0.85rem; border: 1.5px solid #1a73e8; border-radius: 3px; background: #fff; }
.zbar-tog[aria-pressed="true"] { border-color: #1a73e8; background: #eef4fd; }
.zbar-tog[aria-pressed="true"] .zbar-box { background: #1a73e8; box-shadow: inset 0 0 0 2px #fff; }
.zbar-leg { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.3rem; color: var(--ink-soft); font-size: 0.75rem; }
.zbar-leg i { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3ea6ff; }
@media (max-width: 680px) { .zbar-tog { padding: 0.55rem 0.9rem; } }

/* ramka „Dalej: linia boczna” – wskazówki, gdzie czytać o rodzinie, której rozdział nie rozwija (21 XI 2026) */
.dalej { margin: 1.8rem 0 1.4rem; padding: 0.9rem 1.1rem 0.7rem; background: #f7f8fa; border: 1px solid var(--line); border-left: 3px solid var(--ink-soft); max-width: var(--col, 74ch); font-size: 0.93rem; }
.dalej > b { display: block; font-weight: 500; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.3rem; }
.dalej p { margin: 0 0 0.5rem; }
.dalej ul { margin: 0; padding-left: 1.1rem; }
.dalej li { margin: 0 0 0.45rem; }
.dalej li span { display: block; color: var(--ink-soft); font-size: 0.86rem; }
.dalej a { color: var(--seal); }

/* krótki odcinek na osi czasu: podpis obok, na prawo od paska (rozdział „Żędowice”, Rolisław 1904–1912) */
.hs-seg.hs-out { overflow: visible; }
.hs-seg.hs-out i, .hs-seg.hs-out small { position: relative; left: calc(100% + 0.5rem); width: max-content; color: var(--ink); overflow: visible; }
.hs-seg.hs-mini small { display: none; }

/* Pod Przemyślanami: okładka nut i zapowiedź z gazety w jednym wierszu, równej wysokości */
.two.two-muzyka { grid-template-columns: 0.780fr 1.113fr; align-items: start; }
.chapter .two.two-muzyka .ph img { width: 100%; height: auto; max-width: none; }
@media (max-width: 680px) { .two.two-muzyka { grid-template-columns: minmax(0, 1fr); } }
.zmap-label.leaflet-tooltip-left::before { border-left-color: #1a73e8 !important; }

/* rozdział „Sześć nadobnych cór”: pary zdjęć o równej wysokości (proporcje szer./wys. obrazów) */
.two.two-ederowie { grid-template-columns: 0.650fr 0.660fr; align-items: start; }
.two.two-sokol { grid-template-columns: 0.501fr 1.045fr; align-items: start; }
.chapter .two.two-ederowie .ph img, .chapter .two.two-sokol .ph img { width: 100%; height: auto; max-width: none; }
@media (max-width: 680px) { .two.two-ederowie, .two.two-sokol { grid-template-columns: minmax(0, 1fr); } }

/* Znaczniki miejsc na mapach w rozdziałach: kółka z numerami i legenda pod mapą (zmap-bar.js, ZMapBar.points) */
.zmap-num { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; border-radius: 50%;
  background: #b24a26; color: #fff; border: 2px solid #fff; font: 700 12px/1 var(--sans, sans-serif); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); cursor: pointer; }
.zmap-num.sm { background: #5b6170; font-size: 10px; }
.leaflet-marker-icon.zmap-num:hover { transform-origin: center; filter: brightness(1.15); }
.zmap-tip { background: rgba(255, 250, 242, 0.96); color: #111418; border: 1px solid #c9bba6; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  padding: 2px 7px; font: 600 12px/1.3 var(--sans, sans-serif); }
.zmap-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem; margin: 0; padding: 0.55rem 0.75rem; background: #f7f8fa; border: 1px solid var(--line); border-top: 0; }
.zmap-legend button { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid transparent; border-radius: 999px; background: none; padding: 0.2rem 0.6rem 0.2rem 0.25rem;
  font: 0.82rem/1.2 var(--sans); color: var(--ink); cursor: pointer; }
.zmap-legend button:hover, .zmap-legend button:focus-visible { border-color: #b24a26; background: #fff; }
.zmap-legend .zmap-num { width: 20px; height: 20px; font-size: 11px; box-shadow: none; }
.zmap-legend .zmap-num.sm { font-size: 10px; }
.zfig .zmap-legend + .zmap-bar { border-top: 1px dashed var(--line); }

/* STATIONS – jedna linia czasu z miejscami (rozdział „Ostatni na wschód”) */
.stations { margin: 1.4rem 0 1.8rem; max-width: 980px; }
.st-in { padding: 0 1.5rem; overflow-x: auto; }
.st-track { position: relative; height: 13.5rem; min-width: 560px; }
.st-line { position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--line); }
.st-pt { position: absolute; top: 50%; width: 0; }
.st-pt::before { content: ""; position: absolute; left: -0.4rem; top: -0.4rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--seal); }
.st-pt.seg::before { left: 0; width: 100%; border-radius: 0.4rem; }
.st-lb { position: absolute; left: 0; transform: translateX(-50%); width: 6.4rem; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.1; }
.st-pt.seg .st-lb { left: 50%; }
.st-pt b { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; }
.st-pt small { font-size: 0.72rem; color: var(--ink-soft); margin-top: 0.1rem; }
.st-pt.up.l1 .st-lb { bottom: 0.75rem; }
.st-pt.up.l2 .st-lb { bottom: 3.1rem; }
.st-pt.dn.l1 .st-lb { top: 0.75rem; }
.st-pt.dn.l2 .st-lb { top: 3.1rem; }
.st-pt.l2::after { content: ""; position: absolute; left: 0; height: 2.4rem; border-left: 1px solid var(--line); }
.st-pt.up.l2::after { bottom: 0.5rem; }
.st-pt.dn.l2::after { top: 0.5rem; }
.st-axis { position: relative; height: 1.3rem; min-width: 560px; border-top: 1px solid var(--line); }
.st-axis span { position: absolute; top: 0.2rem; transform: translateX(-50%); font-size: 0.75rem; color: var(--ink-soft); }
.stations figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--ink-soft); }

/* HOUSES: odcinki-linki do kart osób i osie lat pod pasami */
.hs-seg.hs-link { cursor: pointer; }
.hs-seg.hs-link:hover, .hs-seg.hs-link:focus-visible { filter: brightness(1.12); outline: none; }
.hs-seg.hs-link:hover i { text-decoration: underline; }
.hs-lane.hs-lax { margin-top: 0; }
.hs-lane.hs-lax .hs-track { height: 1.3rem; }

/* Osie wykresów (HOUSES, STATIONS): bez żadnego paska przewijania na komputerze; przewijanie w poziomie tylko na wąskim ekranie */
.hs-in, .st-in { overflow: visible; }
.hs-lane, .st-track, .st-axis { min-width: 0; }
@media (max-width: 680px) {
  .hs-in, .st-in { overflow-x: auto; overflow-y: hidden; padding-bottom: 0.3rem; }
  .hs-lane { min-width: 560px; }
  .st-track, .st-axis { min-width: 560px; }
}

/* HOUSES: wspólna oś lat na dole (ticks = "auto") – wyraźny pasek, lata zmian gospodarzy w dwóch rzędach */
.hs-lane.hs-axis2 { margin-top: 0.6rem; align-items: start; }
.hs-axis2 .hs-name b { font-size: 1rem; }
.hs-axis2 .hs-name span { position: static; transform: none; }
.hs-axis2 .hs-track { height: 2.7rem; border: 0; border-top: 4px solid var(--ink-soft); }
.hs-axis2 .hs-track span { position: absolute; transform: translateX(-50%); font-size: 0.78rem; color: var(--ink); }
.hs-axis2 .hs-track span::before { content: ""; position: absolute; left: 50%; border-left: 1px solid var(--ink-soft); }
.hs-axis2 .hs-track span.hi { top: 0.35rem; }
.hs-axis2 .hs-track span.hi::before { top: -0.6rem; height: 0.5rem; }
.hs-axis2 .hs-track span.lo { top: 1.4rem; }
.hs-axis2 .hs-track span.lo::before { top: -1.65rem; height: 1.55rem; }

/* Czcionki do tłumaczeń metryk naśladujących oryginał: Old Standard TT (druk XIX w.) i Kalam (pismo ręczne); SIL Open Font License, pliki w fonts/ */
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/old-standard-tt-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/old-standard-tt-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/kalam-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/kalam-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Metryka jako formularz (SCANX z klasą „metryka”): drukowane nagłówki rubryk, linie tabeli i wpisy „ręczne” w tych samych miejscach co w oryginale */
.scanx.metryka .sx-tr span { padding: 0; overflow: hidden; color: #2b2520; }
.scanx.metryka .sx-tr span em { font-style: normal; width: 100%; }
.scanx.metryka .mt-pr em { font-family: "Old Standard TT", var(--serif); font-size: 1.75cqw; line-height: 1.45; text-align: center; color: #1f1b18; }
.scanx.metryka .mt-pr b { display: block; font-weight: 400; color: #1f1b18; font-size: 3cqw; line-height: 1.15; margin-bottom: 0.5cqw; letter-spacing: 0.01em; }
.scanx.metryka .mt-rod { align-items: flex-end; border-bottom: 0.25cqw solid #2b2520; }
.scanx.metryka .mt-rod em { font-size: 2.2cqw; letter-spacing: 0.35em; padding-bottom: 0.3cqw; }
.scanx.metryka .mt-hd { align-items: center; border-right: 0.12cqw solid #2b2520; border-bottom: 0.5cqw double #2b2520; }
.scanx.metryka .mt-kh { border-left: 0.25cqw solid #2b2520; border-right: 0.25cqw solid #2b2520; }
.scanx.metryka .mt-c { align-items: flex-start; border-right: 0.12cqw solid #2b2520; }
.scanx.metryka .mt-kb { border-left: 0.25cqw solid #2b2520; border-right: 0.25cqw solid #2b2520; }
.scanx.metryka .mt-edge { border-left: 0.25cqw solid #2b2520; }
.scanx.metryka .mt-hw em { font-family: "Kalam", cursive; font-size: 2.85cqw; line-height: 1.6; padding: 1.2cqw 1cqw 0 1.4cqw; text-align: left; color: #2b2520; }
.scanx.metryka .mt-vc em { height: 100%; display: flex; align-items: center; justify-content: center; padding: 0; }
.scanx.metryka .mt-v { display: block; font-style: normal; white-space: nowrap; transform: rotate(-90deg); }
.scanx.metryka .mt-pr .mt-v { font-size: 1.45cqw; }
.scanx.metryka .mt-hw .mt-v { font-size: 2.7cqw; }
.scanx.metryka .mt-kb em { height: 100%; display: flex; flex-direction: column; }
.scanx.metryka .mt-k1 { display: block; font-style: normal; text-align: center; padding-top: 2.5cqw; }
.scanx.metryka .mt-k2 { display: block; font-style: normal; margin-top: auto; padding-bottom: 1.5cqw; }
.scanx.metryka .mt-kb em { font-size: 2.5cqw; }
.scanx.metryka .mt-kb .mt-k1 { padding-top: 1.8cqw; }

/* Wszystkie skany z suwakiem w tym samym stylu co metryka Bohumila (klasy SCANX): „rek” – rękopis (Kalam), „druk” – druk (Old Standard TT), „form” – drukowany formularz z wpisami ręcznymi (<b> = wpis ręczny) */
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/kalam-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/kalam-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/old-standard-tt-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Old Standard TT"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/old-standard-tt-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.scanx.rek .sx-tr span, .scanx.druk .sx-tr span, .scanx.form .sx-tr span { color: #2b2520; }
.scanx.rek .sx-tr span em { font-family: "Kalam", cursive; font-style: normal; line-height: 1.35; }
.scanx.druk .sx-tr span em, .scanx.form .sx-tr span em { font-family: "Old Standard TT", var(--serif); font-style: normal; line-height: 1.4; }
.scanx.druk .sx-tr span em:only-child { line-height: 1.3; }
.scanx.rek .sx-tr b, .scanx.druk .sx-tr b { font-weight: 700; color: inherit; }
.scanx.form .sx-tr b { font-family: "Kalam", cursive; font-weight: 400; color: #2b2520; font-size: 1.08em; }
.scanx.rek .sx-tr i.ctr, .scanx.druk .sx-tr i.ctr, .scanx.form .sx-tr i.ctr { font-style: normal; }
.scanx.rek .sx-tr .sx-n { font-family: "Kalam", cursive; color: #5b6170; }
/* rubryki dodane przez nas nad rękopisem: nagłówki drukiem jak w formularzu, linie atramentem */
.scanx.rek .sx-tr.tb span { border-right: 0.12cqw solid #2b2520; }
.scanx.rek .sx-tr.tb span:last-child { border-right: 0; }
.scanx.rek .sx-tr.tb span > small { font-family: "Old Standard TT", var(--serif); font-weight: 400; text-transform: none; letter-spacing: 0.01em; color: #1f1b18; background: none; border-bottom: 0.35cqw double #2b2520; text-align: center; font-size: max(7px, calc(var(--colw, 936px) * 0.016 * var(--ls, 1))); line-height: max(8px, calc(var(--colw, 936px) * 0.02)); padding: 0.6cqw 0.4cqw 0.5cqw; }
.scanx.form .sx-tr .mt-tyt { font-weight: 700; letter-spacing: 0.12em; }
.g5 { background: repeating-linear-gradient(90deg, #d8b48c 0 2px, transparent 2px 6px); }
/* wąskie odcinki osi właścicieli: mniejszy napis zamiast ucinania imienia */
.hs-seg { container-type: inline-size; }
@container (max-width: 60px) { .hs-seg i { font-size: 0.85rem; } .hs-seg small { font-size: 0.62rem; } }
@container (max-width: 60px) { .hs-seg > i, .hs-seg > small { margin-left: -0.2rem; margin-right: -0.25rem; } }

/* PHOTOX: dawne i dzisiejsze zdjęcie nałożone na siebie */
.photox .sx-tr.sx-ph { background: none; box-shadow: none; inset: 0; }
.photox .sx-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photox .px-lab { position: absolute; top: 0.6rem; padding: 0.15rem 0.55rem; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: rgba(17, 20, 24, 0.55); border-radius: 2px; pointer-events: none; }
.photox .px-new { left: 0.6rem; }
.photox .px-old { right: 0.6rem; }

/* dymek miejsca z opisem (zmap: places[].info) */
.zmap-tip.zmap-tip-info { white-space: normal; width: 15rem; padding: 6px 9px 7px; font-weight: 400; line-height: 1.35; }
.zmap-tip.zmap-tip-info b { display: block; font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.zmap-tip.zmap-tip-info span { display: block; font-size: 12px; color: #3a312a; }

/* dymek: lata pobytu */
.zmap-tip.zmap-tip-info em { display: block; font-style: normal; font-size: 11px; color: #b24a26; margin-bottom: 2px; }

/* imiona w podpisach zdjęć jako linki do kart osób */
.plink { cursor: pointer; color: var(--seal); border-bottom: 1px dotted currentColor; }
.plink:hover, .plink:focus-visible { border-bottom-style: solid; outline: none; }

/* STATIONS: opis miejsca po najechaniu – w panelu pod osią (.st-info), nie w dymku nad osią */
.st-pt[data-tip] .st-lb { cursor: pointer; }
.st-tip { display: none; }
.st-pt:focus { outline: none; }
.st-pt.sel .st-lb b { color: var(--seal); }
.st-pt.sel::before { box-shadow: 0 0 0 3px rgba(178, 74, 38, 0.25); }
.st-info { margin-top: 0.4rem; padding: 0.55rem 0.8rem 0.6rem; background: #ffffff; border: 1px solid var(--line); border-radius: 3px; min-height: 3.6rem; font-size: 0.9rem; line-height: 1.45; color: var(--ink); }
.st-info b { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.st-info em { font-style: normal; color: var(--seal); font-size: 0.85rem; margin: 0 0.5rem 0 0.4rem; }
.st-info .st-hint { margin: 0; color: var(--ink-soft); font-style: italic; }

/* wspólny panel mapa + oś (st-info[data-link]) i podświetlenie wybranego miejsca na mapie */
.st-info[data-link] { margin: 0.5rem 0 0.2rem; }
.zmap-legend button.hl { border-color: var(--seal); background: #fff; }
.leaflet-marker-icon.zmap-num.hl { filter: brightness(1.25); box-shadow: 0 0 0 4px rgba(178, 74, 38, 0.3); border-radius: 50%; z-index: 2000 !important; }

/* Mapa z pionową osią czasu po lewej (VSTATIONS w .mapline) – jeden moduł: oś | mapa, pod spodem pasek warstw i panel z opisem na całą szerokość */
.chapter .mapline { display: grid; grid-template-columns: 10rem 1fr; max-width: var(--col); margin: 1.3rem auto 0; border: 1px solid var(--line); background: #f7f8fa; }
.mapline .zfig { margin: 0; min-width: 0; }
.mapline .zmap { border: 0; border-left: 1px solid var(--line); }
.mapline .vst { margin: 0; }
.mapline .zbar-ml { grid-column: 1 / -1; margin: 0; border: 0; border-top: 1px solid var(--line); }
.vst-in { position: relative; height: calc(min(70vh, 620px) - 2.6rem); margin: 1.3rem 0; }
.vst-line { position: absolute; top: 0; bottom: 0; left: 1.6rem; border-left: 2px solid var(--line); }
.vst-tick { position: absolute; left: 0.2rem; width: 2.1rem; transform: translateY(-50%); text-align: right; font-size: 0.7rem; color: var(--ink-soft); }
.vst-tick::after { content: ""; position: absolute; left: 2.3rem; top: 50%; width: 0.45rem; border-top: 1px solid var(--ink-soft); }
.vst-pt { position: absolute; left: 1.6rem; height: 0; width: 0; }
.vst-pt::before { display: none; }
.vst-num { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; border-radius: 50%; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  background: var(--seal); color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); font: 600 11px/1 var(--sans, sans-serif); cursor: pointer; }
.vst-pt.sm .vst-num { background: #5b6170; }
.vst-pt .st-lb { position: absolute; left: 1rem; top: 0; transform: translateY(-50%); width: 7.4rem; text-align: left; display: block; line-height: 1.02; cursor: pointer; }
.vst-pt .st-lb b { display: block; font-family: var(--serif); font-size: 0.92rem; font-weight: 500; }
.vst-pt .st-lb small { display: block; font-size: 0.64rem; color: var(--ink-soft); }
.vst-pt.sel .st-lb b { color: var(--seal); }
.vst-pt.sel .vst-num { box-shadow: 0 0 0 4px rgba(178, 74, 38, 0.3); }
.mapline + .st-info[data-link] { margin: 0 auto 1.7rem; border-top: 0; border-radius: 0 0 3px 3px; max-width: var(--col); }
@media (max-width: 680px) { .chapter .mapline { grid-template-columns: 1fr; } .vst-in { height: 32rem; } .mapline .zmap { border-left: 0; border-top: 1px solid var(--line); } }

/* mapa z osią: wszystkie kółka tej samej wielkości (tylko kolor odróżnia miejsca rodziców i dzieci) */
.zmap-num.sm.uni { font-size: 11px; }
/* Nagłówki prasowe: zwięzły przegląd relacji o tragedii w Wiszence. */
.press-headlines {
  margin: 2rem 0;
  padding: clamp(1.1rem, 3vw, 2rem);
  border-block: 1px solid rgba(40, 44, 52, .25);
  background: linear-gradient(135deg, rgba(122, 36, 28, .055), rgba(122, 36, 28, 0) 68%);
}
.press-headlines-intro { display: grid; grid-template-columns: minmax(8rem, .45fr) 1fr; gap: 1rem; align-items: baseline; margin-bottom: 1rem; }
.press-headlines-intro > span { color: var(--seal); font: 600 .76rem/1.2 var(--sans, sans-serif); letter-spacing: .14em; text-transform: uppercase; }
.press-headlines-intro p { margin: 0; color: var(--ink-soft); }
.press-headline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.press-headline {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(40, 44, 52, .2);
  background: rgba(255, 252, 245, .74);
  box-shadow: 0 3px 12px rgba(17, 20, 24, .045);
}
.press-headline-feature { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; border-top: 3px solid var(--seal); }
.press-paper { display: block; color: var(--seal); font: 600 .72rem/1.35 var(--sans, sans-serif); letter-spacing: .075em; text-transform: uppercase; }
.press-headline h4 { margin: .55rem 0 .45rem; color: var(--ink); font: 500 clamp(1.15rem, 2vw, 1.65rem)/1.15 var(--serif); }
.press-headline-feature h4 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.press-headline p { margin: 0; color: var(--ink-soft); font-size: .83rem; line-height: 1.45; }
.press-headline-vienna h4 { font-size: clamp(1rem, 1.55vw, 1.25rem); }
.press-headlines-note { margin: .9rem 0 0; color: var(--ink-soft); font-size: .76rem; font-style: italic; }
@media (max-width: 680px) {
  .press-headlines-intro { grid-template-columns: 1fr; gap: .4rem; }
  .press-headline-grid { grid-template-columns: 1fr; }
  .press-headline-feature { grid-row: auto; }
}
