/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: black;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(images/layers.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(images/layers-2x.png);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #333;
	background: #fff;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(images/marker-icon.png);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #fff;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #fff;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #fff;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #fff;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}

/* Family tree — archive sheet style (continues Draft 2) */
:root {
  --bg: #eef1f4; --sheet: #ffffff; --ink: #18222e; --muted: #5c6877; --line: #8a96a6;
  --line-soft: #d5dbe2; --accent: #9a6b1f; --accent-ink: #ffffff; --accent-soft: #f4ead8;
  --unknown: #f3f5f7; --danger: #a3342b; --ok: #2f6b45; --dim: .22;
  --pat: #e6edf5; --mat: #f5ebe0; --shadow: 0 1px 2px rgba(24,34,46,.06), 0 8px 24px rgba(24,34,46,.08);
  --display: "Spectral", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --hebrew: "Noto Serif Hebrew", "Frank Ruhl Libre", "David", serif;
  --scale: 1;
  --top: 0px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11161d; --sheet: #19212b; --ink: #e6ebf1; --muted: #9aa6b5; --line: #5d6a7b; --line-soft: #2b3542;
  --accent: #d9a556; --accent-ink: #1a1408; --accent-soft: #3a2f1e; --unknown: #1f2833; --danger: #e0786e; --ok: #7cc495;
  --pat: #1d2938; --mat: #2e261d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.he { font-family: var(--hebrew); direction: rtl; unicode-bidi: isolate; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .5rem 1rem;
  border-radius: .5rem; border: 1px solid var(--line-soft); background: var(--sheet); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--line); }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--line) 12%, transparent); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 2.25rem; padding: .3rem .7rem; font-size: .9rem; }
.btn.icon { width: 2.75rem; padding: 0; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.field { display: grid; gap: .3rem; }
.field > span { font-size: .8rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 2.9rem; padding: .55rem .75rem; border-radius: .5rem; border: 1px solid var(--line-soft);
  background: var(--sheet); font-size: 1.05rem; }
textarea.input { min-height: 7rem; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.check { display: inline-flex; gap: .5rem; align-items: center; min-height: 2.5rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--line-soft); border-radius: .5rem; overflow: hidden; }
.seg button { border: 0; background: var(--sheet); padding: .5rem .9rem; min-height: 2.6rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-soft); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem .3rem .3rem; border-radius: 999px; border: 1px solid var(--line-soft);
  background: var(--sheet); cursor: pointer; min-height: 2.4rem; font-size: .95rem; }
.chip .av { width: 1.8rem; height: 1.8rem; font-size: .7rem; }
.chip.plain { padding: .3rem .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-block; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .45rem; border-radius: .3rem; background: color-mix(in srgb, var(--line) 18%, transparent); color: var(--muted); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tag.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.card { background: var(--sheet); border: 1px solid color-mix(in srgb, var(--line) 35%, transparent); border-radius: .7rem; padding: 1.1rem 1.2rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* avatar */
.av { width: 3rem; height: 3rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); font-family: var(--display); font-weight: 700; font-size: 1rem; border: 1px solid var(--line-soft); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.unknown { background: var(--unknown); color: var(--muted); border-style: dashed; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.app > .appbar { grid-row: 1; position: sticky; top: 0; z-index: 30; transition: box-shadow .2s; }
.app > .appbar.scrolled { box-shadow: 0 6px 18px rgba(24,34,46,.08); }
.app > .main { grid-row: 2; animation: viewin .28s ease-out; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } }
.topbar { position: relative; display: flex; align-items: center; gap: .8rem; padding: .6rem max(1rem, env(safe-area-inset-left)) .6rem max(1rem, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.brand { display: grid; line-height: 1.1; min-width: 0; }
.brand h1 { font-size: clamp(1.15rem, 3.2vw, 1.6rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 1; max-width: 26rem; margin-left: auto; }
.search .input { padding-left: 2.4rem; min-height: 2.6rem; font-size: 1rem; }
.search > svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--sheet); border: 1px solid var(--line-soft); border-radius: .6rem;
  box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 40; padding: .3rem; }
.result { display: flex; gap: .7rem; align-items: center; width: 100%; padding: .5rem .6rem; border: 0; background: transparent; border-radius: .45rem; cursor: pointer; text-align: left; }
.result:hover, .result[aria-selected="true"] { background: var(--accent-soft); }
.result .av { width: 2.3rem; height: 2.3rem; font-size: .8rem; }
.place { position: relative; }
.place-results { top: calc(100% + 4px); max-height: 22rem; }
.place-results .result { padding: .45rem .55rem; }
.place-results .result > svg { width: 1.05rem; height: 1.05rem; color: var(--muted); flex: none; }
.place-credit { font-size: .7rem; color: var(--muted); text-align: right; padding: .15rem .5rem 0; }
.tabs { display: flex; gap: .2rem; padding: 0 max(1rem, env(safe-area-inset-left)); border-bottom: 1px solid var(--line-soft); overflow-x: auto; background: var(--bg); scrollbar-width: none; }
.tab { border: 0; background: transparent; padding: .7rem .75rem; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2.5px solid transparent; white-space: nowrap; display: inline-flex; gap: .45rem; align-items: center; }
.tab svg { width: 1.1rem; height: 1.1rem; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.main { position: relative; min-height: 0; }
.page { max-width: 62rem; margin: 0 auto; padding: 1.4rem max(1rem, env(safe-area-inset-left)) 6rem; display: grid; gap: 1.1rem; align-content: start; }
.page-head { display: grid; gap: .3rem; }
.page-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.bottomnav { display: none; }

@media (max-width: 760px) {
  .tabs { display: none; }
  .brand .eyebrow { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: color-mix(in srgb, var(--sheet) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-soft); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav button { border: 0; background: transparent; display: grid; justify-items: center; gap: .1rem; padding: .45rem 0 .5rem; font-size: .72rem; color: var(--muted); cursor: pointer; }
  .bottomnav button svg { width: 1.45rem; height: 1.45rem; }
  .bottomnav button[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .search { max-width: none; min-width: 0; }
  .topbar { flex-wrap: wrap; row-gap: .5rem; padding-top: max(.6rem, env(safe-area-inset-top)); }
  .brand { flex: 1 1 100%; }
  .topbar .hide-sm { display: none; }
}

/* ---------- tree ---------- */
.treewrap { position: absolute; inset: 0; overflow: hidden; background:
  radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
.treewrap > svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.treewrap > svg.dragging { cursor: grabbing; }
.gen-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--muted); text-transform: uppercase; }
.lk { stroke: var(--line); stroke-width: 1.7; fill: none; }
.lk.ended { stroke-dasharray: 6 5; }
.wring circle { fill: var(--bg, #fff); stroke: #d4a017; stroke-width: 3; }
.wring path { fill: none; stroke: #f6dc8a; stroke-width: 1.2; stroke-linecap: round; }
.legend .sw.ring { width: 11px; height: 11px; border: 2.5px solid #d4a017; border-radius: 50%; background: none; }
.lk.sib { stroke-dasharray: 1.5 5; stroke-linecap: round; stroke-width: 2.2; }
.lk.adopt { stroke-dasharray: 3 4; }
.lk.hl { stroke: var(--accent); stroke-width: 3; }
.ring { fill: var(--sheet); stroke: var(--line); stroke-width: 1.5; }
.pc { cursor: pointer; transition: opacity .25s; }
.pc .bg { fill: var(--sheet); stroke: color-mix(in srgb, var(--line) 75%, transparent); stroke-width: 1.2; filter: drop-shadow(0 1px 1.5px rgba(24,34,46,.08)); }
.pc .stripe { fill: var(--line-soft); }
.pc.M .stripe { fill: #8aa4c2; } .pc.F .stripe { fill: #c9a07a; }
.pc.unknown .bg { fill: var(--unknown); stroke-dasharray: 5 4; }
.pc.group .bg2 { fill: var(--unknown); stroke: color-mix(in srgb, var(--line) 60%, transparent); stroke-dasharray: 4 3; }
.pc.me .bg { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.pc.sel .bg { stroke: var(--accent); stroke-width: 3; }
.pc:hover .bg { stroke: var(--accent); }
.pc:focus { outline: none; } .pc:focus-visible .bg { stroke: var(--accent); stroke-width: 3.5; }
.pc .nm { font-family: var(--display); font-weight: 700; fill: var(--ink); }
.pc .sn { font-family: var(--display); font-weight: 500; fill: var(--ink); }
.pc .hn { font-family: var(--hebrew); fill: var(--ink); }
.pc.unknown .nm { font-style: italic; font-weight: 500; fill: var(--muted); }
.pc .yr { font-family: var(--mono); font-size: 12.5px; fill: var(--muted); }
.pc .mono-av { fill: var(--accent-soft); stroke: var(--line-soft); }
.pc .mono-tx { font-family: var(--display); font-weight: 700; font-size: 15px; fill: var(--accent); }
.pc.dim, .lkg.dim { opacity: var(--dim); }
.pc .badge { font-family: var(--mono); font-size: 10px; fill: var(--accent); letter-spacing: .06em; }
.ctrls { position: absolute; right: max(1rem, env(safe-area-inset-right)); bottom: 1rem; display: grid; gap: .4rem; z-index: 5; }
.ctrls .btn { box-shadow: var(--shadow); }
.legend { position: absolute; left: max(1rem, env(safe-area-inset-left)); bottom: 1rem; z-index: 5; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted);
  background: color-mix(in srgb, var(--sheet) 90%, transparent); padding: .45rem .8rem; border-radius: .5rem; border: 1px solid var(--line-soft); max-width: calc(100% - 6rem); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.sw { width: 24px; height: 0; border-top: 2px solid var(--line); display: inline-block; }
.sw.dash { border-top-style: dashed; } .sw.dot { border-top-style: dotted; border-top-width: 3px; }
.sw.you { width: 12px; height: 12px; border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 3px; }
.hlbar { position: absolute; top: .8rem; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: .6rem; align-items: center;
  background: var(--sheet); border: 1px solid var(--accent); border-radius: 999px; padding: .35rem .5rem .35rem 1rem; box-shadow: var(--shadow); max-width: calc(100% - 2rem); }
@media (max-width: 760px) { .ctrls { bottom: calc(5rem + env(safe-area-inset-bottom)); } .legend { display: none; } }

/* ---------- side panel / sheet ---------- */
.panel { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(30rem, 100%); background: var(--sheet); box-shadow: -10px 0 40px rgba(24,34,46,.18);
  display: grid; grid-template-rows: auto auto 1fr; animation: slidein .22s ease-out; border-left: 1px solid var(--line-soft); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@media (max-width: 760px) { .panel { width: 100%; border-left: 0; animation: slideup .22s ease-out; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.panel-head { padding: max(.8rem, env(safe-area-inset-top)) 1rem .6rem 1.2rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; border-bottom: 1px solid var(--line-soft); }
.panel-head .av { width: 4.6rem; height: 4.6rem; font-size: 1.5rem; }
.panel-head h2 { font-size: 1.55rem; }
.panel-head .he { font-size: 1.15rem; }
.panel-tabs { display: flex; gap: .1rem; padding: 0 .8rem; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.panel-body { overflow: auto; padding: 1.1rem 1.2rem calc(2rem + env(safe-area-inset-bottom)); display: grid; gap: 1.2rem; align-content: start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
.facts dt { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: .25rem; }
.facts dd { margin: 0; min-width: 0; }
.section-title { font-family: var(--display); font-size: 1.15rem; margin: 0 0 .5rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rel-list { display: grid; gap: .35rem; }
.rel { display: flex; align-items: center; gap: .7rem; padding: .4rem .5rem; border-radius: .5rem; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.rel:hover { background: var(--accent-soft); }
.rel .av { width: 2.5rem; height: 2.5rem; font-size: .85rem; }
.rel small { color: var(--muted); display: block; font-size: .82rem; }
.addgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.relation-badge { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .1rem .65rem; font-size: .85rem; font-weight: 600; }
.bio { white-space: pre-wrap; }
.formgrid { display: grid; gap: .9rem; }
.formgrid .two { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.formgrid .three { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: .6rem; }
fieldset { border: 1px solid var(--line-soft); border-radius: .6rem; padding: .8rem 1rem 1rem; margin: 0; display: grid; gap: .8rem; }
legend { font-family: var(--display); font-weight: 700; padding: 0 .3rem; font-size: 1.05rem; }
.stickybar { position: sticky; bottom: calc(-2rem - env(safe-area-inset-bottom)); background: var(--sheet); padding: .8rem 0 calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); display: flex; gap: .6rem; justify-content: flex-end; margin-top: .5rem; }
.scrim { position: fixed; inset: 0; background: rgba(12,18,26,.38); z-index: 49; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }

/* ---------- modal ---------- */
.modal { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 1rem; }
.modal > .box { background: var(--sheet); border-radius: .8rem; width: min(34rem, 100%); max-height: calc(100dvh - 2rem); overflow: auto; box-shadow: var(--shadow); padding: 1.3rem 1.3rem 1.1rem; display: grid; gap: 1rem; animation: pop .18s ease-out; }
.modal > .box.wide { width: min(56rem, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal h3 { font-size: 1.4rem; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 560px) { .modal { padding: 0; place-items: end stretch; } .modal > .box { border-radius: .9rem .9rem 0 0; max-height: 94dvh; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); } }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  border-radius: .6rem; padding: .7rem .8rem .7rem 1.1rem; display: flex; gap: .9rem; align-items: center; box-shadow: var(--shadow); max-width: calc(100% - 2rem); animation: pop .2s; }
.toast .btn { min-height: 2.2rem; background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.toast.error { background: var(--danger); color: #fff; }
@media (max-width: 760px) { .toast { bottom: calc(5.2rem + env(safe-area-inset-bottom)); } }
/* phones: a bottom-sheet dialog is open, so show messages at the top instead of over its buttons */
@media (max-width: 560px) { body:has(.modal) .toast { bottom: auto; top: calc(1rem + env(safe-area-inset-top)); } }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.login .card { width: min(30rem, 100%); padding: 2rem 1.8rem; display: grid; gap: 1.1rem; box-shadow: var(--shadow); }
.login h1 { font-size: clamp(2rem, 7vw, 2.6rem); }
.tree-mark { width: 3.2rem; height: 3.2rem; color: var(--accent); }

/* ---------- activity ---------- */
.feed { display: grid; gap: .7rem; }
.day { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .9rem 0 .1rem; }
.chg { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .85rem 1rem; }
.chg .who { font-weight: 600; }
.chg .when { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.diff { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; font-size: .92rem; margin-top: .4rem; }
.diff dt { color: var(--muted); }
.diff dd { margin: 0; }
.diff del { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff ins { color: var(--ok); text-decoration: none; font-weight: 500; }
.chg.reverted { opacity: .6; }
@media (max-width: 560px) { .chg { grid-template-columns: 1fr; } .chg .av { display: none; } }

/* ---------- photos ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.thumb { position: relative; aspect-ratio: 1; border-radius: .5rem; overflow: hidden; background: var(--unknown); border: 1px solid var(--line-soft); cursor: pointer; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.thumb:hover img { transform: scale(1.04); }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem .5rem .35rem; font-size: .78rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); text-align: left; }
.thumb.doc { display: grid; place-items: center; gap: .2rem; color: var(--muted); font-size: .8rem; padding: .6rem; text-align: center; }
.thumb.doc svg { width: 2.2rem; height: 2.2rem; }
.drop { border: 2px dashed var(--line-soft); border-radius: .7rem; padding: 1.2rem; text-align: center; color: var(--muted); display: grid; gap: .6rem; justify-items: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(8,12,18,.94); display: grid; grid-template-columns: 1fr minmax(0, 22rem); color: #e6ebf1; }
.lightbox .stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 3.5rem 1rem 1rem; }
.lightbox .stage .imgwrap { position: relative; max-width: 100%; max-height: 100%; }
.lightbox .stage img { max-width: 100%; max-height: calc(100dvh - 5rem); display: block; border-radius: .3rem; }
.lightbox .side { background: var(--sheet); color: var(--ink); overflow: auto; padding: 1.2rem; display: grid; gap: 1rem; align-content: start; }
.lightbox .close { position: absolute; top: .8rem; left: .8rem; z-index: 2; }
.lightbox .navb { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lightbox .navb.prev { left: .6rem; } .lightbox .navb.next { right: .6rem; }
.pin { position: absolute; transform: translate(-50%, -50%); background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: 999px; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.tagging img { cursor: crosshair; }
@media (max-width: 860px) { .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .lightbox .side { max-height: 45dvh; } }

/* ---------- stories ---------- */
.story { display: grid; gap: .5rem; }
.story h3 { font-size: 1.35rem; }
.story .body { white-space: pre-wrap; font-family: var(--display); font-size: 1.08rem; line-height: 1.65; }

/* ---------- views ---------- */
.cal-month { display: grid; gap: .45rem; }
.cal-month h3 { font-size: 1.25rem; margin-top: .6rem; }
.ev { display: grid; grid-template-columns: 4.2rem 1fr auto; gap: .9rem; align-items: center; padding: .75rem .9rem; cursor: pointer; }
.ev .date { text-align: center; font-family: var(--mono); line-height: 1.1; }
.ev .date b { display: block; font-family: var(--display); font-size: 1.6rem; }
.ev.yahrzeit { border-left: 3px solid var(--accent); }
.fan svg { width: 100%; height: auto; max-height: calc(100dvh - 12rem); display: block; margin: 0 auto; }
.fan .seg { stroke: var(--sheet); stroke-width: 2; cursor: pointer; transition: filter .15s; }
.fan .seg:hover { filter: brightness(.95); }
.fan .seg.empty { fill: var(--unknown); stroke-dasharray: 4 3; stroke: var(--line-soft); }
.fan text { font-family: var(--display); fill: var(--ink); pointer-events: none; }
.fan text.y { font-family: var(--mono); fill: var(--muted); }
.tl { overflow-x: auto; }
.tl svg text { font-family: var(--body); fill: var(--ink); }
.tl .axis text { font-family: var(--mono); fill: var(--muted); font-size: 11px; }
.tl .grid line { stroke: var(--line-soft); }
.tl .bar { cursor: pointer; }
.mapbox { position: relative; isolation: isolate; z-index: 0; height: calc(100dvh - 15rem); min-height: 22rem; border-radius: .7rem; overflow: hidden; border: 1px solid var(--line-soft); }
.progress { height: .6rem; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.path .arrow { color: var(--muted); font-size: .85rem; font-family: var(--mono); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; padding: .5rem .6rem; border-bottom: 1px solid var(--line-soft); }
.table td { padding: .6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.scrollx { overflow-x: auto; }
.linkbox { display: flex; gap: .5rem; align-items: center; background: var(--accent-soft); border-radius: .5rem; padding: .5rem .5rem .5rem .8rem; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.copy-field { font-family: var(--mono); font-size: .9rem; background: var(--accent-soft); }
.spinner { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid var(--line-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 60vh; gap: 1rem; }
.leaflet-container { font: inherit; background: var(--unknown); }
.leaflet-popup-content { font-family: var(--body); }
@media print { .topbar, .tabs, .bottomnav, .ctrls, .legend { display: none !important; } .treewrap { position: static; height: 90vh; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* add (+) on tree cards */
.addbtn { cursor: pointer; }
.addbtn .hit { fill: transparent; }
.addbtn .dot { fill: var(--accent); stroke: var(--sheet); stroke-width: 2.5; transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.addbtn .plus { stroke: var(--accent-ink); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.addbtn:hover .dot { transform: scale(1.15); }
.pc.dim .addbtn { display: none; }

/* add-relative wizard */
.steps { display: flex; gap: .3rem; margin-top: -.4rem; }
.steps i { flex: 1; height: .3rem; border-radius: 999px; background: var(--line-soft); }
.steps i.on { background: var(--accent); }
.choices { display: grid; gap: .55rem; }
.choices .q { font-family: var(--display); font-size: 1.35rem; margin: 0 0 .3rem; line-height: 1.25; }
.choice { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: .9rem 1rem; min-height: 3.6rem; border-radius: .6rem;
  border: 1px solid var(--line-soft); background: var(--sheet); cursor: pointer; font-size: 1.05rem; }
.choice:hover, .choice:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.choice > svg { width: 1.4rem; height: 1.4rem; color: var(--accent); flex: none; }
.choice > span { flex: 1; display: grid; }
.choice small { color: var(--muted); font-size: .88rem; }
.choice .chev { width: 1.1rem; height: 1.1rem; color: var(--muted); }

@media (max-width: 760px) { .mapbox { height: calc(100dvh - 17rem - env(safe-area-inset-bottom)); } }

/* local demo controls */
.demo-panel { position: fixed; z-index: 45; left: max(.8rem, env(safe-area-inset-left)); bottom: 3.6rem; width: min(19rem, calc(100vw - 1.6rem));
  background: var(--sheet); border: 2px solid var(--accent); border-radius: .7rem; box-shadow: var(--shadow); font-size: .9rem; }
.demo-panel.closed { width: auto; }
.demo-tab { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; border: 0; background: var(--accent-soft); color: var(--accent);
  padding: .45rem .8rem; border-radius: .5rem .5rem 0 0; cursor: pointer; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.demo-panel.closed .demo-tab { border-radius: .5rem; }
.demo-tab svg { width: 1rem; height: 1rem; }
.demo-body { padding: .7rem .8rem .8rem; display: grid; gap: .5rem; }
.demo-body p { margin: 0; color: var(--muted); }
.demo-label { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: .2rem; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.demo-panel .seg button { padding: .35rem .55rem; min-height: 2.2rem; font-size: .85rem; }
@media (max-width: 760px) { .demo-panel { bottom: calc(4.6rem + env(safe-area-inset-bottom)); } }

/* floating action button */
.fab { position: fixed; z-index: 34; right: max(1.2rem, env(safe-area-inset-right)); bottom: calc(1.2rem + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: .5rem;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); padding: .85rem 1.25rem; font-weight: 600; font-size: 1rem; cursor: pointer;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow); transition: transform .15s, box-shadow .15s; }
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: scale(.97); }
.fab svg { width: 1.25rem; height: 1.25rem; }
.fab.on-tree { right: calc(max(1rem, env(safe-area-inset-right)) + 3.6rem); }
@media (max-width: 760px) { .fab { bottom: calc(5.2rem + env(safe-area-inset-bottom)); } .fab.on-tree { right: max(1rem, env(safe-area-inset-right)); bottom: calc(5.2rem + env(safe-area-inset-bottom)); left: auto; }
  .ctrls { bottom: calc(9.4rem + env(safe-area-inset-bottom)); } }
.page { padding-bottom: 7rem; }

/* person panel action bar stays visible */
.panel-actions { position: sticky; bottom: calc(-2rem - env(safe-area-inset-bottom)); background: var(--sheet); margin: 0 -1.2rem; padding: .8rem 1.2rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft); z-index: 2; }

/* tree motion */
.pc { transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.pc .lift { transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.pc:hover .lift { transform: translateY(-2px); }
.pc:hover .bg { filter: drop-shadow(0 6px 10px rgba(24,34,46,.16)); }
.links { animation: linksin .6s ease-out; }
@keyframes linksin { 0%, 45% { opacity: 0; } }
.pc.flash .bg { animation: flash 1.1s ease-in-out 2; stroke: var(--accent); stroke-width: 3; }
@keyframes flash { 50% { fill: var(--accent-soft); stroke-width: 6; } }
.treewrap > svg.dragging .pc { transition: opacity .25s; }

/* hover card */
.hovercard { position: absolute; z-index: 8; width: 17rem; transform: translate(-50%, -100%); background: var(--sheet); border: 1px solid var(--line-soft); border-radius: .7rem;
  box-shadow: var(--shadow); padding: .8rem .9rem; pointer-events: none; animation: pop .15s ease-out; }
.hovercard.below { transform: translate(-50%, 0); }
.hovercard .hc-name { font-family: var(--display); font-size: 1.1rem; display: block; line-height: 1.2; }
.hovercard .relation-badge { margin-top: .25rem; font-size: .78rem; }
.hc-meta { margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--line-soft); font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
@media (hover: none) { .hovercard { display: none; } }

/* minimap */
.minimap { position: absolute; z-index: 5; top: .9rem; right: max(1rem, env(safe-area-inset-right)); background: color-mix(in srgb, var(--sheet) 92%, transparent);
  border: 1px solid var(--line-soft); border-radius: .5rem; padding: .3rem; cursor: pointer; box-shadow: var(--shadow); }
.minimap svg { display: block; }
.minimap .mm-n { fill: var(--line); opacity: .45; } .minimap .mm-me { fill: var(--accent); } .minimap .mm-sel { fill: var(--accent); opacity: .6; }
.minimap .mm-view { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 1.5; }
@media (max-width: 900px) { .minimap { display: none; } }
kbd { font-family: var(--mono); font-size: .8rem; border: 1px solid var(--line-soft); border-bottom-width: 2px; border-radius: .3rem; padding: .05rem .4rem; background: var(--bg); }

/* ---------- Face ID / fingerprint sign-in (and the old code screen) ---------- */
.btn.big { min-height: 3.2rem; font-size: 1.05rem; padding: .6rem 1.3rem; }
.btn.primary.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.code-input { font-family: var(--mono); font-size: 1.9rem; letter-spacing: .4em; text-align: center; min-height: 3.8rem; padding: .4rem .6rem .4rem 1rem; max-width: 17rem; }
.code-input::placeholder { font-family: var(--body); font-size: 1.05rem; letter-spacing: 0; color: var(--muted); opacity: .8; }
.mfa-gate .code-input { max-width: none; width: 100%; }
.code-label { font-size: 1.15rem; line-height: 1.4; }
.code-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: stretch; margin-top: .3rem; }
.code-row .code-input { flex: 1 1 12rem; }
.form-error { margin: 0; color: var(--danger); font-weight: 500; background: color-mix(in srgb, var(--danger) 9%, transparent); border-radius: .4rem; padding: .5rem .7rem; }
.demo-hint { margin: 0; font-size: .85rem; color: var(--accent); background: var(--accent-soft); border-radius: .4rem; padding: .35rem .6rem; justify-self: start; }
.twostep.needs { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.twostep .section-title svg, .locked-card svg { width: 1.2em; height: 1.2em; }
.flash-card { animation: cardflash 1.6s ease-out 1; }
@keyframes cardflash { 0%, 40% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { box-shadow: none; } }
.ok-line { margin: 0; display: flex; align-items: center; gap: .55rem; font-size: 1.08rem; }
.okdot { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); flex: none; }
.okdot svg { width: 1.05rem; height: 1.05rem; stroke-width: 2.6; }
.note { margin: 0; display: flex; gap: .5rem; align-items: flex-start; background: var(--accent-soft); border-radius: .5rem; padding: .6rem .8rem; }
.note svg { width: 1.15rem; height: 1.15rem; flex: none; margin-top: .15rem; color: var(--accent); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 1.1rem; }
.steps > li { counter-increment: st; display: grid; gap: .3rem; padding-left: 2.6rem; position: relative; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: -.1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; }
.steps > li > b { font-size: 1.05rem; }
.qr-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; margin-top: .4rem; }
.qr { width: 184px; height: 184px; background: #fff; border: 1px solid var(--line-soft); border-radius: .5rem; padding: 6px; image-rendering: pixelated; flex: none; }
.secret { font-family: var(--mono); font-size: 1.1rem; letter-spacing: .06em; background: var(--bg); border: 1px solid var(--line-soft); border-radius: .4rem; padding: .5rem .7rem; word-break: break-all; color: var(--ink); text-transform: none; }
.divider { height: 1px; background: var(--line-soft); margin: .2rem 0; }
.everywhere { align-items: center; justify-content: space-between; }
.pk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pk-list li { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line-soft); border-radius: .6rem; padding: .6rem .7rem; flex-wrap: wrap; }
.pk-list li .grow { min-width: 10rem; }
.pk-list li .btn { margin-left: auto; }
.pk-when { font-size: .9rem; }
.login .pk-or { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .9rem; margin: 0; }
.login .pk-or::before, .login .pk-or::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.login .pk-btn { min-height: 3.2rem; font-size: 1.05rem; }
.login .pk-btn svg { width: 1.4em; height: 1.4em; }
.locked-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; border: 1.5px solid var(--accent); background: linear-gradient(0deg, var(--sheet), var(--sheet)) padding-box; }
.locked-card h3 { font-family: var(--display); font-size: 1.3rem; margin: 0; line-height: 1.25; }
.lock-ic { width: 3rem; height: 3rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.lock-ic svg { width: 1.5rem !important; height: 1.5rem !important; }
@media (max-width: 560px) { .locked-card { grid-template-columns: 1fr; } }
.nowrap-actions { gap: .25rem; flex-wrap: nowrap; justify-content: flex-end; }
.nowrap-actions .btn { white-space: nowrap; }

/* ---------- system health ---------- */
.hdot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; flex: none; background: var(--line); }
.hdot.ok { background: #2f9e5b; box-shadow: 0 0 0 3px color-mix(in srgb, #2f9e5b 22%, transparent); }
.hdot.warn { background: #d99a1e; box-shadow: 0 0 0 3px color-mix(in srgb, #d99a1e 22%, transparent); }
.hdot.bad { background: #c8382c; box-shadow: 0 0 0 3px color-mix(in srgb, #c8382c 22%, transparent); }
.hdot.none { background: var(--line-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--line) 15%, transparent); }
.section-title .hdot { margin-left: auto; width: 1rem; height: 1rem; }
.health-sum { margin: 0 0 .6rem; }
.health-sum.ok b { color: var(--ok); } .health-sum.bad b { color: var(--danger); } .health-sum.warn b { color: #9a6b1f; }
:root[data-theme="dark"] .health-sum.warn b { color: #e3b35a; }
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.health-list li { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: baseline; padding: .55rem 0; border-top: 1px solid var(--line-soft); }
.health-list li:first-child { border-top: 0; }
.health-list .hdot { transform: translateY(.05rem); }
.health-detail { font-size: .92rem; color: var(--muted); }
.health-more { margin-top: .6rem; } .health-more summary { cursor: pointer; color: var(--muted); font-size: .9rem; min-height: 2.2rem; display: flex; align-items: center; }

/* ---------- close-family view ---------- */
.focusbar, .treehint { position: absolute; top: .8rem; left: max(1rem, env(safe-area-inset-left)); z-index: 6; background: var(--sheet); border: 1px solid var(--accent);
  border-radius: .7rem; box-shadow: var(--shadow); padding: .5rem .6rem .5rem .8rem; max-width: calc(100% - 2rem); }
.focusbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.fb-title, .treehint { display: flex; align-items: center; gap: .5rem; }
.fb-title svg, .treehint > svg { width: 1.3rem; height: 1.3rem; color: var(--accent); flex: none; }
.fb-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.stepper { display: inline-flex; align-items: center; gap: .3rem; }
.stepper > span { font-size: .85rem; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.stepper > b { min-width: 1.2rem; text-align: center; font-size: 1.05rem; }
.stepper .btn.icon { width: 2.4rem; min-height: 2.4rem; font-size: 1.2rem; font-weight: 600; }
.treehint { gap: .7rem; max-width: min(40rem, calc(100% - 2rem)); }
.inline-sel .input { width: auto; min-width: 12rem; }
@media (max-width: 760px) {
  .focusbar, .treehint { left: .5rem; right: .5rem; max-width: none; top: .5rem; }
  .focusbar { gap: .3rem .6rem; padding: .45rem .5rem .45rem .7rem; }
  .fb-ctrls { width: 100%; justify-content: space-between; }
  .treehint { flex-wrap: wrap; }
  .treehint .grow { flex: 1 1 14rem; font-size: .92rem; }
}
.ts-title { flex-wrap: wrap; justify-content: flex-start; gap: .3rem .7rem; }
.ts-name { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.ts-title .tag { white-space: nowrap; }

/* ---- sign-in: ask to join ---- */
.ask-join { justify-self: center; text-decoration: underline; }
/* ---- members: revoke link, requests to join ---- */
.revoke-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: .8rem; font-size: .92rem; }
.requests-card { border: 1.5px solid var(--accent); }
.request-row .nowrap-actions { flex-wrap: wrap; justify-content: flex-start; }
.request-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: .8rem; }
/* ---- person panel: social profiles (text badges, no brand logos) ---- */
.social { display: grid; gap: .6rem; }
.soc-list { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.soc-item { display: inline-flex; align-items: center; gap: .1rem; }
.soc { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem; padding: .25rem .8rem .25rem .3rem; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--sheet); color: var(--ink); text-decoration: none; font-size: .95rem; }
.soc:hover { border-color: var(--accent); }
.soc:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.soc-mark { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 .78rem var(--mono); }
.soc-find { background: var(--accent-soft); border-color: transparent; padding: .9rem 1rem; }
/* ---- quick add ---- */
.bulk-text { min-height: 12rem; font-size: 1.02rem; line-height: 1.5; }
.bulk-row { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; border-top: 1px solid var(--line-soft); padding-top: .9rem; }
.bulk-row.off > .formgrid, .bulk-rel.off { opacity: .45; }
.bulk-row.undecided, .bulk-rel.undecided { background: color-mix(in srgb, var(--accent) 9%, transparent); border-radius: .5rem; padding: .7rem; border-top-color: transparent; }
.bulk-fields { display: grid; grid-template-columns: 1.2fr 1.2fr .7fr .7fr auto; gap: .5rem; align-items: end; }
.bulk-fields .seg button { padding: .45rem .7rem; }
.bulk-match { display: grid; gap: .4rem; justify-items: start; }
.bulk-flag { color: var(--accent); margin: 0; font-weight: 600; }
.bulk-flag svg { width: 1.05em; height: 1.05em; vertical-align: -.15em; }
.bulk-rel { align-items: flex-start; }
.bulk-rel input { margin-top: .15rem; flex: none; }
.bulk-q { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.bulk-bar { bottom: 0; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; z-index: 5; }
@media (max-width: 760px) {
  .bulk-fields { grid-template-columns: 1fr 1fr; }
  .bulk-fields .field:nth-child(5) { grid-column: 1 / -1; }
  .bulk-bar { bottom: calc(4.2rem + env(safe-area-inset-bottom)); }
}

/* ---- map in dark mode (the map pictures only come in light) ---- */
.map-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
/* ---- footer: version and numbers ---- */
.sitefoot { grid-row: 3; display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; align-items: center; justify-content: center; padding: .35rem 1rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line-soft); background: var(--sheet); }
.sitefoot b { color: var(--ink); font-weight: 600; }
.sitefoot .on-now i { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
@media (max-width: 760px) {
  .sitefoot { padding-bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
  .app[data-view="tree"] .sitefoot { display: none; }
}
