/* Familienarchiv – Fächerdiagramm, Zeitleiste, Zeitschieber (zu ansichten.js).
   Nutzt die Variablen aus app.css (mit Rückfallwerten); helle und dunkle Variante. */
:root{
  --av-c0a:#dbe8f4; --av-c0b:#c9ddee;   /* blau */
  --av-c1a:#f3dfd3; --av-c1b:#ecccbb;   /* ziegelrot */
  --av-c2a:#dcebd9; --av-c2b:#c8dfc3;   /* grün */
  --av-c3a:#e6dff0; --av-c3b:#d6cce6;   /* violett */
  --av-selfa:#f1d9a0; --av-selfb:#f1d9a0;
  --av-leer:#efeadf; --av-leer-rand:#cfc9bb;
  --av-krieg:rgba(122,75,30,.08); --av-krieg-t:#6b4a1f;
}
@media (prefers-color-scheme: dark){
  :root{
    --av-c0a:#26384a; --av-c0b:#2f4660;
    --av-c1a:#4a3128; --av-c1b:#5c3c30;
    --av-c2a:#28402b; --av-c2b:#33523a;
    --av-c3a:#3d3150; --av-c3b:#4b3c63;
    --av-selfa:#6a5424; --av-selfb:#6a5424;
    --av-leer:#2a2824; --av-leer-rand:#45423b;
    --av-krieg:rgba(224,168,104,.10); --av-krieg-t:#e0b27c;
  }
}
.av-c0{--av-f:var(--av-c0a)} .av-c0.t1{--av-f:var(--av-c0b)}
.av-c1{--av-f:var(--av-c1a)} .av-c1.t1{--av-f:var(--av-c1b)}
.av-c2{--av-f:var(--av-c2a)} .av-c2.t1{--av-f:var(--av-c2b)}
.av-c3{--av-f:var(--av-c3a)} .av-c3.t1{--av-f:var(--av-c3b)}
.av-self{--av-f:var(--av-selfa)}
.av-leer{color:var(--muted,#5f5b52);padding:12px 0}

.av-legende{display:flex;flex-wrap:wrap;gap:6px 16px;margin:8px 0 0;font-size:12.5px;color:var(--muted,#5f5b52);align-items:center}
.av-leg{display:inline-flex;align-items:center;gap:6px}
.av-sw{display:inline-block;width:14px;height:14px;border-radius:3px;background:var(--av-f);border:1px solid var(--line,#cfc9bb)}
.av-sw.av-leer-sw{background:var(--av-leer);border:1px dashed var(--av-leer-rand)}

/* ---------- Fächer ---------- */
.fa-svg{display:block;width:100%;height:auto;margin:0 auto;user-select:none;-webkit-user-select:none}
.fa-seg path{fill:var(--av-f);stroke:var(--panel,#fffdf9);stroke-width:1.5}
.fa-seg[data-id]{cursor:pointer}
.fa-seg[data-id]:hover path{filter:brightness(.94)}
@media (prefers-color-scheme: dark){ .fa-seg[data-id]:hover path{filter:brightness(1.25)} }
.fa-seg:focus{outline:none}
.fa-seg:focus-visible path{stroke:var(--accent,#7a4b1e);stroke-width:3.5}
.fa-leer-seg path{fill:var(--av-leer);fill-opacity:.55;stroke:var(--av-leer-rand);stroke-width:.8;stroke-dasharray:3 3}
.fa-wurzel path{stroke:var(--accent,#7a4b1e);stroke-width:2}
.fa-text{pointer-events:none}
.fa-text text{fill:var(--ink,#23211c);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;font-weight:600}
.fa-text text.fa-jahre{font-weight:400;fill:var(--ink,#23211c);fill-opacity:.82}

/* ---------- Zeitleiste ---------- */
.zl{position:relative}
.zl-leiste{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 8px}
.zl-knopf{min-width:44px;min-height:44px;padding:0 12px;font-size:16px;line-height:1}
.zl-hinweis{font-size:12.5px;color:var(--muted,#5f5b52);margin-left:6px}
.zl-achse{touch-action:pan-y;border:1px solid var(--line,#cfc9bb);border-bottom:0;border-radius:8px 8px 0 0;background:var(--panel,#fffdf9);overflow:hidden;cursor:grab}
.zl-scroll{touch-action:pan-y;overflow-x:hidden;overflow-y:auto;border:1px solid var(--line,#cfc9bb);border-radius:0 0 8px 8px;background:var(--panel,#fffdf9);cursor:grab}
.zl-achse.zieht,.zl-scroll.zieht{cursor:grabbing}
.zl-svg{display:block;max-width:none;user-select:none;-webkit-user-select:none}
.zl-krieg{fill:var(--av-krieg)}
.zl-krieg-t{font:600 10px -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;fill:var(--av-krieg-t)}
.zl-tick{stroke:var(--muted,#5f5b52);stroke-width:1}
.zl-jahr{font:12px -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;fill:var(--ink,#23211c)}
.zl-achslinie{stroke:var(--line,#cfc9bb);stroke-width:1}
.zl-achslinie-l{stroke:var(--line,#cfc9bb);stroke-width:1}
.zl-raster{stroke:var(--line3,#efeadf);stroke-width:1}
.zl-raster.gross{stroke:var(--line2,#e4dfd3)}
.zl-zeile{fill:transparent}
.zl-zeile.alt{fill:var(--line3,#efeadf);fill-opacity:.45}
.zl-zeile.sel{fill:var(--sel,#fff3c9);fill-opacity:.55}
.zl-namefeld{fill:var(--panel,#fffdf9)}
.zl-name.sel .zl-namefeld{fill:var(--sel,#fff3c9)}
.zl-name{cursor:pointer}
.zl-name:focus{outline:none}
.zl-name:focus-visible .zl-namefeld{stroke:var(--accent,#7a4b1e);stroke-width:2}
.zl-name:hover .zl-n{text-decoration:underline}
.zl-n{font:600 12.5px -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;fill:var(--ink,#23211c)}
.zl-r{font:11.5px -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;fill:var(--muted,#5f5b52)}
.zl-balken{fill:var(--av-f);stroke:var(--muted,#5f5b52);stroke-width:1;stroke-opacity:.7;cursor:pointer}
.zl-balken.zl-self{stroke:var(--accent,#7a4b1e);stroke-width:1.6;stroke-opacity:1}
.zl-balken.gestrichelt{stroke-dasharray:4 3;fill-opacity:.55}
.zl-balken.offen{stroke:none}
.zl-st-c0{stop-color:var(--av-c0b)} .zl-st-c1{stop-color:var(--av-c1b)} .zl-st-c2{stop-color:var(--av-c2b)} .zl-st-c3{stop-color:var(--av-c3b)} .zl-st-self{stop-color:var(--av-selfa)}
.zl-pkt{cursor:pointer}
.zl-pkt:focus{outline:none}
.zl-pkt .zl-hit{fill:transparent}
.zl-pkt:focus-visible .zl-hit{stroke:var(--accent,#7a4b1e);stroke-width:2}
.zl-p{fill:var(--unge,#7a7a7a);stroke:var(--panel,#fffdf9);stroke-width:1.5}
.zl-p.hohl{fill:var(--panel,#fffdf9);stroke:var(--unge,#7a7a7a);stroke-width:2}
.si-b .zl-p{fill:var(--belegt,#2f6b3f)} .si-b .zl-p.hohl{stroke:var(--belegt,#2f6b3f);fill:var(--panel,#fffdf9)}
.si-w .zl-p{fill:var(--wahr,#a0701a)} .si-w .zl-p.hohl{stroke:var(--wahr,#a0701a);fill:var(--panel,#fffdf9)}
.si-a .zl-p{fill:var(--annahme,#a8402f)} .si-a .zl-p.hohl{stroke:var(--annahme,#a8402f);fill:var(--panel,#fffdf9)}
.zl-pkt:hover .zl-p,.zl-pkt:focus .zl-p{stroke:var(--ink,#23211c)}
.zl-pop{pointer-events:none}
.zl-pop-bg{fill:var(--panel,#fffdf9);stroke:var(--ink,#23211c);stroke-width:1;filter:drop-shadow(0 1px 3px rgba(0,0,0,.25))}
.zl-pop-t{font:12px -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;fill:var(--ink,#23211c)}
.zl-info{min-height:22px;margin-top:6px;font-size:13px;color:var(--ink,#23211c)}
.zl-legende .zl-sw{display:inline-block;width:22px;height:10px;border-radius:3px;background:var(--av-c0a);border:1px solid var(--muted,#5f5b52)}
.zl-legende .zl-sw.gestrichelt{border-style:dashed;background:transparent}
.zl-legende .zl-sw.offen{border:0;background:linear-gradient(90deg,var(--av-c0b),transparent)}
.zl-p-leg{fill:var(--ink,#23211c);fill-opacity:.7}
.zl-p-leg.hohl{fill:none;stroke:var(--ink,#23211c);stroke-width:1.6}
.zl-sich i{display:inline-block;width:9px;height:9px;border-radius:50%;margin:0 3px 0 8px;vertical-align:baseline}
.zl-sich i:first-child{margin-left:0}
.pkt-b{background:var(--belegt,#2f6b3f)} .pkt-w{background:var(--wahr,#a0701a)} .pkt-a{background:var(--annahme,#a8402f)} .pkt-u{background:var(--unge,#7a7a7a)}

/* ---------- Zeitschieber ---------- */
.zs{max-width:none}
.zs-kopf{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:2px}
.zs-anz{font:600 16px var(--serif,Georgia,serif);color:var(--ink,#23211c);font-variant-numeric:tabular-nums}
.zs-alle{min-height:44px}
.zs-regler{position:relative;height:44px}
.zs-spur,.zs-bereich{position:absolute;top:50%;height:6px;margin-top:-3px;border-radius:3px}
.zs-spur{left:0;right:0;background:var(--line,#cfc9bb)}
.zs-bereich{background:var(--accent,#7a4b1e)}
.zs .zs-regler input[type=range]{position:absolute;left:0;top:0;width:100%;height:44px;margin:0;padding:0;border:0;border-radius:0;background:none;min-height:0;-webkit-appearance:none;appearance:none;pointer-events:none}
.zs .zs-regler input[type=range]::-webkit-slider-runnable-track{background:none;border:0;height:44px}
.zs .zs-regler input[type=range]::-moz-range-track{background:none;border:0;height:44px}
.zs .zs-regler input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;pointer-events:auto;width:26px;height:26px;margin-top:9px;border-radius:50%;background:var(--panel,#fffdf9);border:3px solid var(--accent,#7a4b1e);box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:grab}
.zs .zs-regler input[type=range]::-moz-range-thumb{pointer-events:auto;width:20px;height:20px;border-radius:50%;background:var(--panel,#fffdf9);border:3px solid var(--accent,#7a4b1e);box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:grab}
.zs .zs-regler input[type=range]:focus{outline:none}
.zs .zs-regler input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--ink,#23211c);outline-offset:2px}
.zs .zs-regler input[type=range]:focus-visible::-moz-range-thumb{outline:2px solid var(--ink,#23211c);outline-offset:2px}
.zs-skala{display:flex;justify-content:space-between;font-size:12px;color:var(--muted,#5f5b52);font-variant-numeric:tabular-nums}
.zs:not(.zs-gefiltert) .zs-alle{opacity:.7}
