/* Главная для гостя: не карточка над схемой, а полноценная страница с преимуществами.
   Показывается только когда показывать нечего - см. index.php. */
.welcome-block {
    position: relative;
    z-index: 100;              /* выше overlay и families-container */
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 20px 60px;
    background: none;
    border: 0;
    text-align: left;
    font-size: 16px;
}

.welcome-block a {
    color: #5693f8;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.welcome-block a:hover {
    text-decoration: underline;
}

/* УДАЛЕНИЕ ЧЕЛОВЕКА */

.btn-edit, .btn-delete {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}

.btn-edit {
    background-color: #4CAF50;
    color: white;
}

.btn-edit:hover {
    background-color: #45a049;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-delete:hover {
    background-color: #da190b;
}


/* КНОПКА ВЫХОД и ЕМАИЛ ПОЛЬЗОВАТЕЛЯ */

.user-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

#user-email {
    white-space: nowrap;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.logout-btn:hover {
    text-decoration: underline;
}


/* АВТОРИЗАЦИЯ */

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.auth-form .form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.auth-form label {
	font-weight: 500;
	color: #333;
}

.auth-form input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.auth-form button {
	padding: 10px 16px;
	background-color: #007bff;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
}

.auth-form button:hover {
	background-color: #0056b3;
}

.auth-error {
	color: #dc3545;
	font-size: 14px;
	padding: 10px;
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	display: none;
}


/* svg */

/* Плавный переход для всех элементов */
svg [data-family-index] {
  transition: opacity 1s ease, stroke 1s ease;
}

/* Когда наводим на элемент с фамилией */
svg.family-tree-active [data-family-index]:not(.active),
svg.family-tree-active line[data-family-index]:not(.active) {
  opacity: 0.1 !important;
}

svg.family-tree-active line[data-family-index]:not(.active) {
  stroke: #ccc !important;
}

/* Активная фамилия остаётся яркой */
svg.family-tree-active [data-family-index].active,
svg.family-tree-active line[data-family-index].active {
  opacity: 1 !important;
}

/* person карточка */


/* Изменяем: убираем stroke: black и fill: white, так как они перебивают JS */
.person-img {
  /* fill оставляем, если хотим фон по умолчанию, но stroke убираем */
  fill: #f0f0f0; 
  stroke-width: 1;
  /* stroke: black; <--- УДАЛИТЬ ЭТУ СТРОКУ */
}

.person-info {
  /*fill: white;*/
  stroke-width: 1;
  /* stroke: black; <--- УДАЛИТЬ ЭТУ СТРОКУ */
}

.person-info-photo {
	width: 220px;
	height: 280px;
	overflow: hidden;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f2f2f2;
}

.person-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* Для неизвестных людей тоже убираем жесткий цвет, 
   чтобы работал JS, но оставляем пунктир */
.unknown-person {
  fill: none;
  stroke: #cccccc;
  stroke-width: 1;
  stroke-dasharray: 5, 5;
}

.person-clickable {
  transition: stroke 0.2s ease, stroke-width 0.2s ease, fill 0.2s ease;
}

.person-info-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  word-break: break-word;
  text-align: center;
  box-sizing: border-box;
}

.person-name {
  /*font-weight: bold;*/
  margin-bottom: 2px;
}

.person-card:has(.person-img:hover) .person-img,
.person-card:has(.person-clickable:hover) .person-img {
	fill: #999;
	transition: fill 0.5s ease;
}
/*новое*/


* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	height: 100%;
	width: 100%;
	overflow: hidden;
	font-family: Arial Narrow, system-ui, -apple-system, sans-serif;
}

/* Страница - колонка: шапка, строка tree-info, дерево на всё оставшееся место. Отступы вручную не нужны. */
body {
	display: flex;
	flex-direction: column;
}

/* Ширина боковой панели - одна переменная и для панели, и для сдвига дерева, чтобы не было щели */
:root {
	--sidebar-w: min(46vw, 460px);   /* карточка человека стала в одну колонку - половина экрана ей больше не нужна */
}

#header {
	position: relative;
	flex-shrink: 0;
	background-color: #fff;
	border-bottom: 2px solid #ccc;
	padding: 20px;
	z-index: 1000;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	display: flex;
	align-items: center;
	gap: 20px;
}

#header h1 {
	font-size: 24px;
	color: #333;
	margin: 0;
}

.site-title {
	display: flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

/* ========== ИКОНКИ ========== */
.icon {
	width: 24px;
	height: 24px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.icon-title { fill: none; stroke: currentColor; }
.icon-title { width: 28px; height: 28px; color: #333; }
.icon-orientation rect { fill: currentColor; stroke: none; }
.icon-gear { width: 26px; height: 26px; }
.settings-btn { margin-left: 8px; }

/* Переворот дерева: плавающая кнопка в правом нижнем углу поля.
   Рамка и полосы непрозрачные, промежутки прозрачные - дерево просвечивает. */
/* Смена ориентации - кнопка поверх схемы, в правом верхнем углу поля, сразу под строкой
   сводки. Внизу справа её не находили. Положение по вертикали считает placeOrientBtn():
   строка сводки меняет высоту, когда её раскрывают. */
.tree-orient-btn {
	position: fixed; right: 14px; top: 120px; z-index: 40;
	width: 42px; height: 42px; padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid rgba(60,70,85,.14); border-radius: 10px;
	background: rgba(255,255,255,.92); color: rgba(45,52,58,.78); cursor: pointer;
	box-shadow: 0 1px 4px rgba(20,35,60,.12);
	-webkit-tap-highlight-color: transparent;
}
.tree-orient-btn svg { width: 26px; height: 26px; }
.tree-orient-btn:hover { color: var(--ui-accent); border-color: rgba(31,79,176,.35); }
.tree-orient-btn:active svg { transform: scale(.92); }
body.map-mode .tree-orient-btn { display: none; }
@media (max-width: 768px) { .tree-orient-btn { width: 38px; height: 38px; right: 10px; } }

.icon-orientation rect.frame { fill: none; stroke: currentColor; opacity: 1; }

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 8px;
	background: none;
	color: #333;
	cursor: pointer;
	flex-shrink: 0;
}
.icon-btn:hover { background: #f0f0f0; border-color: #ddd; }

/* ========== БОКОВАЯ ПАНЕЛЬ ========== */
.sidebar {
	position: fixed;
	left: 0;
	top: var(--header-h, 80px);   /* панель начинается под шапкой - полоса прокрутки не уходит под header */
	width: var(--sidebar-w);
	height: calc(100vh - var(--header-h, 80px));
	/* матовое стекло: сквозь панель просвечивает дерево, внутренние блоки остаются белыми */
	background-color: rgba(246, 247, 249, 0.72);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
	border-right: 1px solid rgba(190, 198, 206, 0.55);
	box-shadow: 2px 0 16px rgba(20, 35, 60, 0.10);
	z-index: 999;
	padding-top: 0;
	padding-left: 20px;
	padding-right: 20px;
	overflow-y: auto;
	
	/* Анимация выезжания */
	transform: translateX(-100%);
	transition: transform 0.3s ease;
}

.sidebar.active {
	transform: translateX(0);
}

#sidebar-content {
	padding: 20px 0;
}

/* ========== ТАБЫ ========== */
.tabs-container {
	display: flex;
	gap: 4px;
	margin-bottom: 0;
	border-bottom: 1px solid var(--ui-border, #dfe3e6);
	align-items: flex-end;
	/* вкладки всегда видны сверху панели, контент прокручивается под ними */
	position: sticky;
	top: 0; /* отсчёт от внутреннего края панели, т.е. сразу под шапкой */
	z-index: 5;
	background: rgba(246, 247, 249, 0.80);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	margin-left: -20px;
	margin-right: -20px;
	padding: 0 20px;
	/* на узком экране - одна строка с горизонтальной прокруткой вместо переноса */
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
}
.tabs-container::-webkit-scrollbar { display: none; }
.tab-button { white-space: nowrap; flex-shrink: 0; }

.tab-button {
	padding: 10px 15px;
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #666;
	border-bottom: 3px solid transparent;
	transition: all 0.3s ease;
	position: relative;
	z-index: 1;
}

.tab-button:hover {
	color: #333;
}

.tab-button.active {
	color: #2c3e50;
	border-bottom-color: #3498db;
	background: rgba(52, 152, 219, 0.05);
}

/* ========== ФОРМЫ ========== */
.add-person-form,
.upload-form {
	padding: 20px;
}

.form-group {
	margin-bottom: 20px;
	display: flex;
	flex-direction: column;
}

.form-group label {
	font-weight: 600;
	margin-bottom: 8px;
	color: #2c3e50;
	font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select {
	padding: 10px;
	border: 1px solid #bdc3c7;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="file"]:focus,
.form-group select:focus {
	outline: none;
	border-color: #3498db;
	box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* ========== ГЕНДЕР ПЕРЕКЛЮЧАТЕЛЬ ========== */
.gender-toggle {
	display: flex;
	gap: 20px;
}

.gender-toggle label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	margin-bottom: 0;
	cursor: pointer;
}

.gender-toggle input[type="radio"] {
	cursor: pointer;
	accent-color: #3498db;
}

/* ========== ЗАГРУЗКА ФОТО ========== */
.photo-upload {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}

.photo-upload input[type="file"] {
	flex: 1;
	padding: 8px;
	border: 1px solid #bdc3c7;
	border-radius: 4px;
	font-size: 13px;
}

.photo-upload span {
	font-size: 13px;
	color: #7f8c8d;
}

#photo-preview {
	margin-top: 10px;
}

/* вставка фото из буфера обмена */
.photo-paste {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 12px;
	border: 1px dashed #bdc3c7;
	border-radius: 4px;
	font-size: 13px;
	color: #7f8c8d;
	background: #fafafa;
}
.photo-paste.pasted {
	border-color: #27ae60;
	color: #27ae60;
}
.photo-paste button {
	padding: 4px 10px;
	border: 1px solid #bdc3c7;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	font-size: 13px;
}
.photo-paste button:hover {
	background: #f0f0f0;
}

#photo-preview img {
	max-width: 150px;
	max-height: 150px;
	border-radius: 4px;
	border: 1px solid #ecf0f1;
	padding: 5px;
}

/* ========== КНОПКИ ========== */
.btn-submit {
	padding: 12px 24px;
	background: linear-gradient(135deg, #3498db, #2980b9);
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-top: 10px;
}

.btn-submit:hover {
	background: linear-gradient(135deg, #2980b9, #1f618d);
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-submit:active {
	transform: translateY(0);
}

/* ========== СООБЩЕНИЯ ========== */
#form-message,
#csv-message {
	margin-top: 15px;
	padding: 12px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	min-height: 20px;
}

.success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	display: block;
	padding: 10px;
	border-radius: 4px;
}

.error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	display: block;
	padding: 10px;
	border-radius: 4px;
}

.loading {
	background-color: #e7f3ff;
	color: #0c5460;
	border: 1px solid #b8daff;
	display: block;
	padding: 10px;
	border-radius: 4px;
}

/* ========== ТАБЛИЦА ========== */
.sidebar-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	margin-top: 10px;
}

.sidebar-table thead {
	background-color: #ecf0f1;
	position: sticky;
	top: 0;
	z-index: 10;
}

.sidebar-table th {
	padding: 12px 8px;
	text-align: left;
	font-weight: 600;
	color: #2c3e50;
	border-bottom: 2px solid #bdc3c7;
}

.sidebar-table td {
	padding: 10px 8px;
	border-bottom: 1px solid #ecf0f1;
}

.sidebar-table tbody tr:hover {
	background-color: #f9f9f9;
}

.table-thumb {
	max-width: 50px;
	max-height: 50px;
	border-radius: 4px;
	border: 1px solid #ddd;
}

.sidebar-table a {
	color: #3498db;
	text-decoration: none;
	font-weight: 500;
}

.sidebar-table a:hover {
	text-decoration: underline;
}

/* ========== CSV ФОРМАТ ========== */
.csv-format {
	background-color: #f5f5f5;
	padding: 12px;
	border-radius: 4px;
	font-size: 12px;
	color: #555;
	margin-bottom: 20px;
	border-left: 3px solid #3498db;
	word-break: break-all;
}

/* ========== ПОЛУПРОЗРАЧНЫЙ ОВЕРЛЕЙ ========== */
.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 998;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

/* Затемнение отключено: на широком экране панель отодвигает схему вбок и ничего не закрывает,
   а на телефоне панель шириной во весь экран и сама накрывает затемнение. Пользы никакой, а после
   выбора человека оно не давало работать по дереву, пока панель не закроешь. */
.overlay.active {
	opacity: 0;
	pointer-events: none;
}

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */
#families-container {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 20px;
	background-color: #f9f9f9;
	transition: margin-left 0.3s ease;
}

/* схема занимает всю ширину: карточки уходят под панель и видны сквозь матовое стекло.
   Инфопанель родов по-прежнему отступает - её левый край должен оставаться читаемым. */
#tree-info-bar.sidebar-open {
	margin-left: var(--sidebar-w);
	max-width: calc(100% - var(--sidebar-w));
}

#families-container svg {
	display: block;
	background-color: white;
}

/* ========== МОБИЛЬНЫЕ УСТРОЙСТВА ========== */
@media (max-width: 768px) {
	#header {
		padding: 8px 10px;
		gap: 8px;
	}

	#header h1 {
		font-size: 18px;
	}

	/* на телефоне шапку занимает поиск: ни названия, ни значка */
	.site-title,
	#user-email {
		display: none;
	}

	.user-section {
		gap: 4px;
	}

	:root {
		--sidebar-w: 100vw;
	}

	/* панель во весь экран: стекло плотнее, иначе текст читается поверх дерева */
	.sidebar { background-color: rgba(246, 247, 249, 0.94); }
	.panel-head, .tabs-container { background: rgba(246, 247, 249, 0.96); }

	.sidebar {
		padding-left: 15px;
		padding-right: 15px;
	}


	.sidebar-table {
		font-size: 12px;
	}

	.sidebar-table th,
	.sidebar-table td {
		padding: 6px 3px;
	}

	#families-container {
		padding: 10px;
	}

}

/* ========== ИНФОРМАЦИОННАЯ СТРОКА НАД ДЕРЕВОМ ========== */
#tree-info-bar {
	flex-shrink: 0;
	position: relative;
	z-index: 10;
	transition: margin-left 0.3s ease;
}
/* Вся панель - одна поверхность: строка не выделяется цветом, потому что переключателем
   служит и она, и всё пустое место под блоками. Подробности лежат поверх схемы матовым стеклом. */
.tree-info {
	position: relative;
	padding: 0;
	background: none;
	border-bottom: 1px solid #d3d8de;
	font-size: 14px;
	color: #333;
	cursor: pointer;
}
.tree-info-line {
	padding: 8px 20px;
	background: rgba(233, 238, 244, 0.78);
	-webkit-backdrop-filter: blur(9px) saturate(1.15);
	backdrop-filter: blur(9px) saturate(1.15);
	/* «вдавленная» полоса: внутренняя тень у нижнего края отделяет её от поля схемы */
	box-shadow: inset 0 -4px 5px -3px rgba(0, 0, 0, 0.13);
}
.tree-info.open .tree-info-line { box-shadow: none; }
.tree-info-caret { margin-right: 12px; color: #6b7480; transition: color .15s ease; }
/* Полосу сводки можно раскрыть, но по виду это было незаметно. При наведении она
   светлеет, а уголок синеет - видно, что на неё нажимают. */
.tree-info-line { transition: background-color .15s ease; }
.tree-info-line:hover { background: rgba(219, 229, 241, 0.92); }
.tree-info-line:hover .tree-info-caret { color: var(--ui-accent); }
.tree-info-line:hover .tree-info-part b { color: #1b2a44; }
.tree-info-orient { margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(60,70,85,.16);
	color: var(--ui-accent); white-space: nowrap; align-self: center; }
@media (max-width: 768px) { .tree-info-orient { margin-left: 10px; padding-left: 10px; } }
.tree-info-line { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 2px; }
/* на широком экране обёртка данных прозрачна и они переносятся, как раньше;
   на телефоне она превращается в строку, которую двигают пальцем - иначе данные скачут по строкам */
.tree-info-scroll { display: contents; }
.tree-info-part { flex: none; }
.tree-info-share { white-space: nowrap; text-decoration: none; }
.tree-info-part + .tree-info-part::before { content: '·'; margin: 0 6px; color: #999; }
.tree-info .short { display: none; }
.tree-info a { color: #3a6fd8; text-decoration: none; cursor: pointer; }
.tree-info a:hover { text-decoration: underline; }
.tree-info-warn { color: #b26a00; }
.tree-info-toggle { margin-right: 14px; white-space: nowrap; }
.tree-info-details {
	display: none; gap: 30px; flex-wrap: wrap; padding: 10px 20px 16px;
	/* поверх схемы, а не раздвигая её: дерево остаётся на месте и просвечивает сквозь стекло */
	position: absolute; left: 0; right: 0; top: 100%; z-index: 1;
	max-height: 50vh; overflow: auto;   /* панель занимает не больше половины экрана - остальное остаётся схеме */
	background: rgba(233, 238, 244, 0.78);
	-webkit-backdrop-filter: blur(9px) saturate(1.15);
	backdrop-filter: blur(9px) saturate(1.15);
	border-bottom: 1px solid #d3d8de;
	box-shadow: 0 12px 20px -12px rgba(20, 30, 50, 0.35);
}
.tree-info.open .tree-info-details { display: flex; }
.tree-info-block { cursor: default; }
.tree-info-block h4 { margin: 6px 0 4px; font-size: 13px; color: #666; }
.tree-info-block table { border-collapse: collapse; font-size: 13px; }
.tree-info-block th, .tree-info-block td { padding: 2px 10px 2px 0; text-align: left; }
.tree-info-block td:not(:first-child), .tree-info-block th:not(:first-child) { text-align: right; }

@media (max-width: 768px) {
	.tree-info { padding: 0; font-size: 15px; }
	.tree-info-line { padding: 7px 10px; }
	.tree-info-details { padding: 8px 10px; }
	.tree-info .full { display: none; }
	.tree-info .short { display: inline; }
	.tree-info-part:has(> .desktop-only) { display: none; }
	.tree-info-part:not(:has(> .desktop-only)) ~ .tree-info-part:not(:has(> .desktop-only))::before { content: '·'; }
	.tree-info-toggle { margin-right: 10px; }
	.tree-info-line { flex-wrap: nowrap; }
	.tree-info-scroll { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; white-space: nowrap;
		overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
		scrollbar-width: none; -ms-overflow-style: none;
		-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent 100%);
		mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent 100%); }
	.tree-info-scroll::-webkit-scrollbar { display: none; }
	/* подробности лежат поверх схемы и занимают почти весь экран, но схема остаётся на месте */
	.tree-info-details { flex-direction: column; flex-wrap: nowrap; gap: 6px;
		height: var(--info-h, 70vh); max-height: none; }
	.tree-info-block table { font-size: 14px; width: 100%; }
	.tree-info-block th, .tree-info-block td { padding: 3px 0 3px 8px; }
	.tree-info-block th:first-child, .tree-info-block td:first-child { padding-left: 0; }
}

/* ========== ОБЩИЕ ЭЛЕМЕНТЫ ИНТЕРФЕЙСА (будем переводить на них все вкладки) ========== */
:root {
	--pcard-row-h: 52px;   /* одна высота для строк родни и для пустых блоков медиа */
	--ui-text: #2c3e50;
	--ui-muted: #7f8c8d;
	--ui-border: #dfe3e6;
	--ui-bg: #ffffff;
	--ui-accent: #3a6fd8;
	--ui-danger: #c0392b;
	--ui-radius: 8px;
}

.ui-btn {
	display: inline-flex;
	margin: 0;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1px solid var(--ui-border);
	border-radius: var(--ui-radius);
	background: var(--ui-bg);
	color: var(--ui-text);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.ui-btn:hover { background: #f3f5f7; }
.ui-btn-primary { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.ui-btn-primary:hover { background: #2f5fc0; }
.ui-btn-danger-quiet { color: var(--ui-danger); border-color: transparent; background: none; }
.ui-btn-danger-quiet:hover { background: #fbeceb; }

/* ========== КАРТОЧКА ЧЕЛОВЕКА ========== */
/* сброс глобального * { padding: 20px 0 } внутри карточки */
.pcard, .pcard * { padding: 0; }
.pcard { color: var(--ui-text); padding-bottom: 30px; }
.pcard-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
/* шапка карточки: фото слева, даты и кнопки справа от него - иначе это место пустует.
   Имя человека сюда не входит, оно в заголовке панели */
.pcard > .pcard-head { align-items: stretch; gap: 16px; }
.pcard > .pcard-head .pcard-main { flex: 1 1 auto; min-width: 0; }
/* фото тянется по высоте правой колонки, поэтому нижняя кнопка встаёт вровень с ним */
.pcard-photo { width: 160px; height: 200px; object-fit: cover; border-radius: var(--ui-radius); background: #e6e6e6; flex-shrink: 0; }
.pcard > .pcard-head > .pcard-photo-box { align-self: stretch; display: flex; }
.pcard > .pcard-head > .pcard-photo-box > .pcard-photo-pick,
.pcard > .pcard-head > .pcard-photo-box > .pcard-photo { flex: 1 1 auto; height: auto; min-height: 200px; }
.pcard > .pcard-head > .pcard-photo-box > .pcard-photo-pick { display: flex; }
.pcard > .pcard-head > .pcard-photo-box > .pcard-photo-pick > .pcard-photo { flex: 1 1 auto; height: auto; min-height: 200px; }
.pcard-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pcard-name { margin: 0; font-size: 22px; line-height: 1.25; }
.pcard-dates { font-size: 15px; }
.pcard-meta { font-size: 14px; color: var(--ui-muted); }
.pcard-link { font-size: 14px; color: var(--ui-accent); text-decoration: none; }
.pcard-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pcard .ui-btn { padding: 7px 14px; }
/* Кнопки шапки прижаты к нижней грани фото и тянутся на всю ширину колонки -
   так их края совпадают с фото и с блоками ниже. */
.pcard-head-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.pcard-head-actions .ui-btn { width: 100%; box-sizing: border-box; justify-content: center; margin: 0; }
/* «Ссылка на человека» - действие второго плана: тише кнопки рода */
.pcard .ui-btn.pcard-share { padding: 6px 10px; font-size: 13px; color: var(--ui-muted); }

.pcard-section { margin-top: 16px; }
.pcard-section h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-muted); }
.pcard-list { list-style: none; margin: 0; padding: 0; background: var(--ui-bg); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); overflow: hidden; }
.pcard-list li + li { border-top: 1px solid var(--ui-border); }
.pcard-subhead { padding: 6px 12px; font-size: 12px; color: var(--ui-muted); background: #fafbfc; }
.pcard-rel { display: flex; align-items: center; gap: 10px; padding: 6px 12px; color: var(--ui-text); text-decoration: none; }
.pcard-rel:hover { background: #f3f6fb; }
.pcard-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e6e6e6; flex-shrink: 0; }
.pcard-rel-name { flex: 1; min-width: 0; font-size: 14px; }
.pcard-note { font-size: 12px; color: var(--ui-muted); }
.pcard-rel-years { font-size: 13px; color: var(--ui-muted); white-space: nowrap; }

@media (max-width: 768px) {
	.tabs-container { margin-left: -15px; margin-right: -15px; padding: 0 15px; }
	.pcard-head { gap: 12px; }
	.pcard-photo { width: 110px; height: 140px; }
	.pcard-name { font-size: 19px; }
	/* на телефоне две колонки сжимают текст в столбик из одного слова: фото сверху по центру */
	.pcard > .pcard-head { flex-direction: column; align-items: center; }
	.pcard > .pcard-head .pcard-photo { width: 150px; height: 190px; }
	.pcard > .pcard-head .pcard-main { width: 100%; }
}

/* ========== КАРТОЧКА РЕДАКТИРОВАНИЯ ========== */
.pform .pcard-head { margin-bottom: 14px; }
.pform-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.pform-photo { position: relative; display: block; cursor: pointer; border-radius: var(--ui-radius); overflow: hidden; }
.pform-photo.pasted { outline: 3px solid #27ae60; }
.pform-photo-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 4px; font-size: 12px; text-align: center; color: #fff; background: rgba(0,0,0,.45); }
.pform-photo:hover .pform-photo-hint { background: rgba(0,0,0,.65); }
.pform-photo-note { font-size: 12px; color: var(--ui-muted); }
.pform-main { flex: 1; }
.pform-caption { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-muted); }

.pform .pform-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--ui-border);
	border-radius: var(--ui-radius);
	background: var(--ui-bg);
	font: inherit;
	font-size: 14px;
	color: var(--ui-text);
}
.pform .pform-input:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px rgba(58,111,216,.15); }
.pform .pform-input::placeholder { color: #b0b8bf; font-style: italic; }
.pform .pform-name { font-size: 20px; font-weight: 600; padding: 8px 10px; }

.pform-gender { display: flex; gap: 6px; }
.pform-gender label { cursor: pointer; }
.pform-gender input { position: absolute; opacity: 0; pointer-events: none; }
.pform .pform-gender span { display: inline-block; padding: 5px 12px; border: 1px solid var(--ui-border); border-radius: 999px; font-size: 13px; background: var(--ui-bg); }
.pform-gender input:checked + span { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }

/* поля: на компьютере по 2-3 в строку, на телефоне автоматически по одному */
.pform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 12px; margin-bottom: 10px; }
.pform-grid-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pform-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin-bottom: 10px; }
.pform-grid .pform-field { margin-bottom: 0; }
.pform-field > span { font-size: 12px; color: var(--ui-muted); }
.pform-field select { width: 100%; }

.pform-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.pform .ui-btn { padding: 7px 14px; }
.pform .ui-btn-small { padding: 4px 10px; font-size: 12px; }
#form-message:empty { display: none; }

/* ========== TOAST ========== */
#toast-box { padding: 0; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { margin: 0; padding: 10px 18px; border-radius: var(--ui-radius); background: #2c3e50; color: #fff; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); transition: opacity .4s, transform .4s; }
.toast-error { background: var(--ui-danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }

@media (max-width: 768px) {
	/* на телефоне ФИО и пол - на всю ширину под фото */
	.pform .pcard-head { flex-wrap: wrap; }
	.pform-main { flex-basis: 100%; }
	.pform-photo-wrap { flex-direction: row; flex-wrap: wrap; align-items: flex-end; flex-basis: 100%; }
	.pform .pform-name { font-size: 16px; }
}

/* ========== ВКЛАДКИ: активная срастается с полем, неактивные - за тенью ========== */
.tabs-container { padding-top: 10px !important; }
.tab-button {
	margin-bottom: -1px;
	padding: 9px 16px !important;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: 6px 6px 0 0;
	background: #e9ecef;
	color: #6b7680;
	box-shadow: inset 0 -6px 6px -6px rgba(0, 0, 0, 0.25);
}
.tab-button:hover { background: #f1f3f5; color: var(--ui-text); }
.tab-button.active {
	background: var(--ui-bg);
	color: var(--ui-text);
	border-color: var(--ui-border);
	border-bottom: 1px solid var(--ui-bg);
	box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.06);
	z-index: 2;
}
/* белое поле вкладки - от края до края панели и до низа экрана */
#tab-content {
	background: transparent;   /* фон даёт матовое стекло панели, белые - только блоки внутри */
	border: none;
	padding: 16px 20px 30px !important;
	margin: 0 -20px;
	border-radius: 0;
	min-height: calc(100vh - var(--header-h, 80px) - 46px);
}
.sidebar { padding-bottom: 0 !important; }

/* ========== КАРТОЧКА РЕДАКТИРОВАНИЯ v2 ========== */
/* поля - в стиле селектов Choices.js: светлый фон, тонкая рамка, малое скругление, высота 44px */
.pform .pform-input,
.pform-gender-opt span {
	height: 44px;
	padding: 0 11px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 2.5px;
	font-size: 14px;
	color: #333;
}
.pform .pform-input::placeholder { color: #999; font-style: normal; }
.pform .pform-input:focus { background: #fff; border-color: #b7b7b7; box-shadow: none; }
.pform .pform-name { font-size: 17px; font-weight: 600; }

.pform-head { gap: 16px; align-items: stretch; }
.pform-photo-wrap { width: 160px; align-items: stretch; }
.pform-photo-wrap .pcard-photo { width: 160px; height: 200px; }
.pform-photo-note { text-align: center; }
.pform-btn-secondary {
	width: 100%;
	height: 34px;
	margin: 0;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 2.5px;
	font: inherit;
	font-size: 13px;
	color: #333;
	cursor: pointer;
}
.pform-btn-secondary:hover { background: #f0f0f0; }
.pform-btn-danger { color: var(--ui-danger); }

/* справа от фото - сетка из 2 колонок; пол, даты, род деятельности встают в одни колонки */
.pform-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-content: start; }
.pform-span2 { grid-column: 1 / -1; }
.pform-grid2 .pform-field { margin-bottom: 0; }
.pform-gender-opt { cursor: pointer; display: block; }
.pform-gender-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pform .pform-gender-opt span { display: flex; align-items: center; justify-content: center; }
.pform-gender-opt input:checked + span { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.pform-gender-opt input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

.pform .pform-submit {
	display: block;
	width: 100%;
	height: 44px;
	margin: 14px 0 0;
	border: none;
	border-radius: 2.5px;
	background: var(--ui-accent);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.pform .pform-submit:hover { background: #2f5fc0; }
.pform-actions { justify-content: space-between; margin-top: 10px; }

@media (max-width: 768px) {
	#tab-content { padding: 12px 15px 30px !important; margin: 0 -15px; }
	.pform-photo-wrap { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
	.pform-photo-wrap .pcard-photo { width: 110px; height: 140px; }
	.pform-photo-wrap .pform-btn-secondary { width: auto; padding: 0 12px; }
	.pform-grid2 { grid-template-columns: 1fr 1fr; }
	.pform-grid2 .pform-field:not(.pform-span2) { grid-column: 1 / -1; }
}

/* ========== КАРТОЧКА РЕДАКТИРОВАНИЯ v3: единая сетка ========== */
/* колонки: фото | поле | поле. Каждая строка = подпись + элемент 44px, поэтому всё встаёт в одни линии */
.pform-head {
	display: grid;
	grid-template-columns: 160px 1fr 1fr;
	gap: 10px 12px;
	margin-bottom: 10px;
}
.pform-head .pform-field { margin-bottom: 0; }
.pform-head .pform-span2 { grid-column: span 2; }
.pform-photo { grid-column: 1; grid-row: 1 / 4; position: relative; display: block; min-height: 0; border-radius: 2.5px; overflow: hidden; cursor: pointer; background: #e6e6e6; }
.pform .pform-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pform-photo-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 13px; cursor: pointer; }
.pform-photo-del:hover { background: var(--ui-danger); }
.pform-paste { grid-column: 1; }
.pform .pform-paste .pform-btn-secondary { height: 44px; font-size: 14px; }
.pform-gender { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 768px) {
	.pform-head { grid-template-columns: 1fr 1fr; }
	.pform-photo { grid-column: 1; grid-row: 1 / 3; aspect-ratio: 3 / 4; }
	.pform-paste { grid-column: 2; grid-row: 2; align-self: end; }
	.pform-head .pform-span2 { grid-column: 1 / -1; }
	.pform-head .pform-field:not(.pform-span2):not(.pform-paste) { grid-column: 1 / -1; }
}

.pform .pform-gender .pform-gender-opt span { border-radius: 2.5px; padding: 0 11px; height: 44px; font-size: 14px; }
.pform .pform-gender .pform-gender-opt input:checked + span { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.pform .pform-paste .pform-btn-secondary { font-size: 13px; padding: 0 4px; white-space: nowrap; }

/* ========== СПИСОК ЛЮДЕЙ ========== */
.plist, .plist * { padding: 0; }
.plist-toolbar {
	position: sticky;
	top: var(--tabs-h, 46px);          /* сразу под вкладками */
	/* и по горизонтали: широкую таблицу двигают ползунком внизу, а условия отбора остаются на месте.
	   Значение left повторяет отрицательное поле ниже - иначе полоса сразу съедет вправо */
	left: -20px;
	width: var(--plist-w, auto);
	box-sizing: border-box;
	z-index: 4;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin: -16px -20px 10px;
	padding: 12px 20px 10px;
	background: var(--ui-bg);
	border-bottom: 1px solid var(--ui-border);
}
.plist .plist-input { height: 40px; padding: 0 10px; background: #f9f9f9; border: 1px solid #ddd; border-radius: 2.5px; font: inherit; font-size: 14px; color: #333; }
.plist #plist-search { flex: 1 1 220px; min-width: 0; }
.plist .plist-sort { flex: 0 0 auto; }
.plist-detail { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ui-muted); cursor: pointer; }
.plist-count { margin-left: auto; font-size: 13px; color: var(--ui-muted); white-space: nowrap; }
.plist-empty { color: var(--ui-muted); padding: 20px 0 !important; text-align: center; }

.plist-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plist-table thead th {
	position: sticky;
	top: calc(var(--tabs-h, 46px) + var(--toolbar-h, 62px));   /* под вкладками и панелью поиска */
	z-index: 3;
	background: #f3f5f7;
	text-align: left;
	padding: 8px 6px !important;
	border-bottom: 1px solid var(--ui-border);
	white-space: nowrap;
}
.plist-table td { padding: 6px !important; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.plist-table a { color: var(--ui-accent); text-decoration: none; }
.plist-table tr:hover td { background: #f7f9fc; }
.plist-id { color: var(--ui-muted); }

@media (max-width: 768px) {
	.plist-toolbar { margin: -12px -15px 10px; padding: 10px 15px; left: -15px; }
	.plist-detail { display: none; }
	.plist .plist-sort { flex: 1 1 auto; }
}

.plist-table td:nth-child(2) { white-space: nowrap; }

/* таблица шире панели: она и едет под закреплённой полосой условий */
.plist:has(.plist-table) { min-width: max-content; }

/* место рождения правится двойным щелчком прямо в списке */
.plist-place { min-width: 120px; cursor: text; }
.plist-place:hover { background: rgba(58, 111, 216, 0.06); }
.plist-place-empty { color: var(--ui-muted); }
.plist-place.saved { background: rgba(46, 125, 50, 0.12); }
.plist-place.failed { background: rgba(192, 57, 43, 0.12); }
.plist-place-input { width: 100%; min-width: 110px; height: 26px; padding: 0 6px !important; border: 1px solid var(--ui-accent); border-radius: 3px; font: inherit; font-size: 13px; }

/* ========== СТРОКИ РОДСТВЕННИКОВ / СПИСКА: портрет во всю высоту строки ========== */
.pcard-list .pcard-rel { display: flex; align-items: stretch; gap: 0; padding: 0;
	height: var(--pcard-row-h); overflow: hidden; }   /* высота одна у всех строк, длинное имя подрезается */
.pcard-list .pcard-avatar { width: 44px; height: var(--pcard-row-h); min-height: 0; border-radius: 0; flex-shrink: 0; align-self: stretch; object-fit: cover; }
.pcard-list .pcard-rel-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; padding: 5px 10px; min-width: 0; overflow: hidden; line-height: 1.25; }
.pcard-list .pcard-rel-years { display: flex; align-items: center; padding: 5px 12px 5px 4px; }
.pcard-list .pcard-subhead { padding: 6px 12px; }

/* список людей - от края до края панели, без боковых полей */
.plist .plist-list { margin: 0 -20px; border-left: none; border-right: none; border-radius: 0; }
@media (max-width: 768px) {
	.plist .plist-list { margin: 0 -15px; }
}

/* ========== ПОЛОСА ПРОКРУТКИ БОКОВОЙ ПАНЕЛИ: «ложбинка» ========== */
.sidebar::-webkit-scrollbar { width: 14px; }
.sidebar::-webkit-scrollbar-track {
	background: #e6e9ec;
	/* тень с обеих сторон одинаковая - бегунок визуально по центру */
	box-shadow: inset 2px 0 3px -1px rgba(0, 0, 0, 0.14), inset -2px 0 3px -1px rgba(0, 0, 0, 0.14);
}
.sidebar::-webkit-scrollbar-thumb {
	background: #b8c0c7;
	background-clip: padding-box;
	border: 4px solid transparent;
	border-radius: 7px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: #99a3ab; background-clip: padding-box; }
/* Firefox не умеет тени у полосы - только цвета */
@supports (-moz-appearance: none) {
	.sidebar { scrollbar-color: #b8c0c7 #e6e9ec; }
}

/* панель поиска списка людей - отделена светлым фоном и тенью снизу */
.plist-toolbar { background: #f7f8fa; border-bottom: 1px solid #e3e6e9; box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.16); }
.plist .plist-input { background: #fff; }

/* ========== ЗАГРУЗИТЬ / УДАЛИТЬ, УНИКАЛЬНЫЙ КОД ========== */
.ucard, .ucard * { padding: 0; }
.ucard { color: var(--ui-text); }
.usection { margin-bottom: 22px; }
.usection h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-muted); }
.ublock { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px !important; margin-bottom: 10px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; }
.ublock-head { display: flex; flex-direction: column; gap: 3px; }
.ublock-head b { font-size: 15px; }
.ublock-head span { font-size: 13px; color: var(--ui-muted); }

/* кнопка-выбор файла в стиле полей (Choices): после выбора файла - синяя «Загрузить …» */
.ufile { display: flex; gap: 8px; }
.ucard .ufile-btn {
	flex: 1;
	display: flex; align-items: center; justify-content: center;
	height: 44px; padding: 0 12px !important;
	background: #f9f9f9; border: 1px dashed #c8c8c8; border-radius: 2.5px;
	font: inherit; font-size: 14px; color: #333; text-decoration: none; cursor: pointer;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ucard .ufile-btn:hover { background: #f0f0f0; }
.ucard .ufile-btn-ready, .umodal .ufile-btn-ready { background: var(--ui-accent); border: 1px solid var(--ui-accent); color: #fff; font-weight: 600; }
.ucard .ufile-btn-ready:hover { background: #2f5fc0; }
.ucard .ufile-reset { width: 44px; height: 44px; border: 1px solid #ddd; border-radius: 2.5px; background: #f9f9f9; cursor: pointer; }
.ushare-actions { display: flex; gap: 8px; }
.ucard .ulink { height: 44px; padding: 0 11px !important; width: 100%; background: #f9f9f9; border: 1px solid #ddd; border-radius: 2.5px; font: inherit; font-size: 13px; color: #333; }

.umessage:empty { display: none; }
.umessage { font-size: 13px; }
.umessage-ok { color: #2e7d32; }
.umessage-error { color: #c0392b; }
.uformat summary { cursor: pointer; font-size: 13px; color: var(--ui-accent); }
.uformat pre { margin-top: 8px; padding: 10px !important; background: #f6f8fa; border-radius: 4px; font-size: 12px; white-space: pre-wrap; overflow: auto; }
.uformat p { margin-top: 6px; font-size: 13px; color: var(--ui-muted); }

.udanger h3 { color: var(--ui-danger); }
.udanger .ublock { border-color: #efc5c1; background: #fdf6f5; }
.ubtn-danger {
	height: 44px; padding: 0 16px !important;
	background: var(--ui-danger); border: 1px solid var(--ui-danger); border-radius: 2.5px;
	color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.ubtn-danger:hover { background: #a93226; }
.ubtn-danger:disabled { background: #e3a9a3; border-color: #e3a9a3; cursor: not-allowed; }

/* ========== ОКНО ПОДТВЕРЖДЕНИЯ ========== */
.umodal { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 16px !important; background: rgba(0, 0, 0, 0.45); }
.umodal * { padding: 0; }
.umodal-box { width: 100%; max-width: 420px; padding: 20px !important; background: #fff; border-radius: var(--ui-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); color: var(--ui-text); }
.umodal-box h3 { margin: 0 0 8px; font-size: 18px; }
.umodal-box p { margin: 0 0 14px; font-size: 14px; color: #555; }
.umodal-require { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.umodal-require input { height: 44px; padding: 0 11px !important; border: 1px solid #ddd; border-radius: 2.5px; font: inherit; }
.umodal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.umodal .ui-btn { height: 44px; padding: 0 16px !important; }
.umodal .ufile-btn { height: 44px; padding: 0 16px !important; border-radius: 2.5px; font: inherit; cursor: pointer; }
.ucard .ublock > .ufile-btn { flex: none; }
.ucard .ushare-actions .ufile-btn { flex: 1; }

/* ========== ВЫСОТА ПАНЕЛИ БЕЗ ЛИШНЕЙ ПРОКРУТКИ ==========
   Раньше белое поле имело min-height «на экран», а глобальное * { padding: 20px 0 } добавляло
   #sidebar-content ещё 40px сверху/снизу - панель всегда была на 40px выше экрана и прокручивалась.
   Теперь: панель - колонка, белое поле просто занимает остаток высоты. */
.sidebar { display: flex; flex-direction: column; }
#sidebar-content { flex: 1 0 auto; display: flex; flex-direction: column; padding: 0 !important; }
#tab-content { flex: 1 0 auto; min-height: 0 !important; }

/* панель фильтров прилегает к вкладкам без щели: заходит под них на 1px и закрашивает возможный зазор сверху */
.plist-toolbar { top: calc(var(--tabs-h, 46px) - 1px); }
/* условия расширенного поиска */
.plist-fields { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; align-items: center; }
.plist-fields .plist-input { margin: 0; }
/* условия занимают строку целиком и переносятся сами: у списков длинные пункты, поэтому им
   разрешено сжиматься (min-width: 0), иначе каждый уезжал бы на отдельную строку */
.plist-fields > .plist-input { flex: 1 1 150px; min-width: 0; }
.plist-fields-reset { flex: 0 0 auto; }
.plist-years { display: flex; gap: 6px; flex: 1 1 170px; min-width: 0; }
.plist-year { flex: 1 1 0; width: auto; min-width: 0; }
.plist-fields-reset { border: 0; background: none; padding: 4px 2px; color: #3a6fd8; font-size: 13px; cursor: pointer; font-family: inherit; }
.plist-fields-reset:hover { text-decoration: underline; }
@media (max-width: 768px) { .plist-fields > .plist-input, .plist-years { flex: 1 1 100%; } .plist-year { width: 50%; flex: 1 1 auto; } }
.plist-toolbar::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; background: #f7f8fa; }

/* линия под вкладками - тенью контейнера: она рисуется ПОД кнопками, и белая активная вкладка её перекрывает.
   (обычная border-bottom не перекрывалась: контейнер с overflow-x обрезал заход вкладки на -1px) */
.tabs-container { border-bottom: none !important; box-shadow: inset 0 -1px 0 var(--ui-border); }
.tab-button { margin-bottom: 0 !important; }
.tab-button.active { border-bottom: none !important; box-shadow: none; }

/* панель фильтров белая - продолжение активной вкладки; список людей чуть серее, между ними мягкая тень */
.plist-toolbar { background: #fff; border-bottom: none; box-shadow: 0 5px 8px -5px rgba(0, 0, 0, 0.18); }
.plist-toolbar::before { background: #fff; }
.plist .plist-input { background: #f9f9f9; }
.plist .plist-list { background: #f4f6f8; }
.plist .plist-list li + li { border-top-color: #e4e8ec; }
.plist .plist-list .pcard-rel:hover { background: #e9eef5; }
#tab-content:has(.plist) { background: transparent; }

/* ========== КАРТОЧКА РЕДАКТИРОВАНИЯ v4: сетка из 3 равных колонок ==========
   колонка 1 - фото на 5 строк (ФИО, Пол, Рождение, Род деятельности, Ссылка), над ним строка «Ctrl+V или [Вставить]»;
   колонки 2-3 - поля; последняя строка - Отец | Мать | Супруг(а) во все 3 колонки */
.pform-head { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pform-photo-field { grid-column: 1; grid-row: 1 / 6; }
.pform-photo-field .pform-photo { grid-row: auto; flex: 1; min-height: 180px; }
.pform-paste-line { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pform .pform-pill {
	height: 20px;
	padding: 0 9px !important;
	margin: 0;
	border: 1px solid #d5d9dd;
	border-radius: 999px;
	background: #eef0f2;
	color: #555;
	font: inherit;
	font-size: 11px;
	line-height: 18px;
	cursor: pointer;
}
.pform .pform-pill:hover { background: #e2e5e8; color: #333; }
.pform-head .pform-field > span { min-height: 20px; display: flex; align-items: center; }

@media (max-width: 768px) {
	.pform-head { grid-template-columns: 1fr 1fr; }
	.pform-photo-field { grid-column: 1 / -1; grid-row: auto; }
	.pform-photo-field .pform-photo { flex: none; width: 150px; height: 190px; min-height: 0; }
	.pform-head .pform-field { grid-column: 1 / -1 !important; }
	.pform-paste { display: none; }
}

/* отступ до кнопки «Добавить/Сохранить» = как между полями: зазор строк 10px + подпись 20px + 4px до поля */
.pform .pform-head { margin-bottom: 0; }
.pform .pform-submit { margin-top: 34px; }

/* ========== ДЕРЕВО v2: масштаб и перетаскивание ========== */
#families-container { padding: 0 !important; overflow: hidden !important; cursor: grab; touch-action: none; user-select: none; background: #fff; }
#families-container.dragging { cursor: grabbing; }
#families-container svg.tree-svg { width: 100%; height: 100%; display: block; zoom: 1 !important; background: #fff; }
.tree-band { fill: #f4f5f7; }

/* ЛИНЕЙКА ПОКОЛЕНИЙ - слой HTML поверх схемы: матовое стекло, сквозь которое видно заезжающие карточки.
   Сделана не в SVG именно поэтому: backdrop-filter работает только на html-элементах. */
#tree-ruler {
	position: absolute; left: 0; top: 0; z-index: 2; overflow: hidden; pointer-events: none;
	background: rgba(247, 248, 250, 0.6);
	-webkit-backdrop-filter: blur(7px) saturate(1.2);
	backdrop-filter: blur(7px) saturate(1.2);
	font-family: Arial, sans-serif; color: #9aa3ad;
}
#tree-ruler.horizontal { width: 100%; border-bottom: 1px solid rgba(60, 70, 85, 0.10); }
#tree-ruler.vertical { height: 100%; border-right: 1px solid rgba(60, 70, 85, 0.10); }
/* без поддержки размытия остаётся прежняя непрозрачная полоса */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	#tree-ruler { background: #f8f9fa; }
	.tree-info-line, .tree-info-details { background: #e9eef4; }
}
/* полоса поколения кликабельна: нажатие подсвечивает всех людей этого поколения */
.tree-ruler-band { position: absolute; background: none; pointer-events: auto; cursor: pointer; }
.tree-ruler-band.alt { background: rgba(60, 70, 85, 0.05); }
.tree-ruler-band:hover { background: rgba(58, 111, 216, 0.10); }
.tree-gen { pointer-events: none; }
#tree-ruler.horizontal .tree-ruler-band { top: 0; height: 100%; }
#tree-ruler.vertical .tree-ruler-band { left: 0; width: 100%; }
.tree-gen { position: absolute; display: flex; align-items: baseline; gap: 6px; line-height: 1.15; }
.tree-gen b { font-size: 16px; font-weight: bold; }
#tree-ruler.horizontal .tree-gen { top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
#tree-ruler.vertical .tree-gen { left: 50%; transform: translate(-50%, -50%); flex-direction: column; align-items: center; gap: 1px; width: 100%; text-align: center; }
/* крайние годы рождения поколения */
.tree-gen-range { font-size: 10px; color: #b3bac2; }
#tree-ruler.tight .tree-gen-range { display: none; }
#families-container svg.tree-svg { border-top: 1px solid #d5d9de; }
.tree-frame { fill: none; stroke: #c9ced3; stroke-width: 1; stroke-dasharray: 2 3; }

/* год брака в зазоре между карточками пары */
.tree-marr { pointer-events: none; }
.tree-ring circle { fill: none; stroke: #8d94a0; stroke-width: 1.1; }
.tree-marr-year { font-size: 9px; fill: #6f7681; font-family: Arial, sans-serif; }
svg.tree-lod-on .tree-marr { display: none; }
svg.tree-people-filter .tree-marr { opacity: 0.15; }

/* точки правки у выделенной карточки: супруг, ребёнок, родитель, дата брака */
.tt-dot { cursor: pointer; }
.tt-dot .tt-bg { fill: #7f8c8d; stroke: #fff; stroke-width: 1.5; }
.tt-spouse .tt-bg { fill: #d9534f; }
.tt-child .tt-bg { fill: #4a86c8; }
.tt-parent .tt-bg { fill: #56a06a; }
.tt-marr .tt-bg { fill: #8d7fb8; }
.tt-plus { stroke: #fff; stroke-width: 1.9; stroke-linecap: round; fill: none; }
.tt-mark circle { fill: none; stroke: #fff; stroke-width: 1.2; }
svg.tree-edit .tree-marr { pointer-events: auto; cursor: pointer; }
.tree-marr-hit { fill: transparent; }
svg:not(.tree-edit) .tree-marr-hit { display: none; }
@media (hover: hover) and (pointer: fine) {
	.tt-dot:hover .tt-bg { stroke: #2d343a; }
	svg.tree-edit .tree-marr:hover .tree-ring circle { stroke: #2d343a; }
}

/* окошко добавления человека прямо на схеме */
.tt-pop { position: fixed; z-index: 1200; width: 268px; max-width: calc(100vw - 16px); box-sizing: border-box;
	background: #fff; border: 1px solid #d8dde2; border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	padding: 12px; font-size: 13px; color: #2d343a; }
.tt-pop[hidden] { display: none; }
.tt-role { color: #5d666f; margin-bottom: 8px; line-height: 1.35; }
.tt-role b { color: #2d343a; font-weight: 600; }
.tt-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tt-tab { flex: 1; padding: 5px 6px; border: 1px solid #d8dde2; background: #f6f8f9; border-radius: 7px; cursor: pointer; font-size: 12px; color: #5d666f; }
.tt-tab.is-on { background: #fff; border-color: #9aa3ad; color: #2d343a; }
.tt-inp { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid #d8dde2; border-radius: 7px; font-size: 13px; margin-bottom: 6px; font-family: inherit; }
.tt-inp:focus { outline: none; border-color: #9aa3ad; }
.tt-two { display: flex; gap: 6px; }
.tt-gender { display: flex; gap: 12px; margin: 2px 0 8px; color: #5d666f; }
.tt-gender label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.tt-gender input[disabled] + span { color: #9aa3ad; }
.tt-foot { display: flex; gap: 6px; margin-top: 2px; }
.tt-ok, .tt-cancel { padding: 6px 12px; border-radius: 7px; border: 1px solid #d8dde2; background: #f6f8f9; cursor: pointer; font-size: 13px; font-family: inherit; }
.tt-ok { background: #2d343a; color: #fff; border-color: #2d343a; }
.tt-msg { margin-top: 6px; font-size: 12px; min-height: 14px; }
.tt-msg .error { color: #c0392b; }
.tt-msg .loading { color: #7f8c8d; }
.tree-line { fill: none; stroke-width: 1.6; }
.tree-card { cursor: pointer; }
.tree-card-bg { fill: #fff; }
/* обводка - отдельным слоем поверх фото и цветной полоски (они обрезаны по скруглённой карточке) */
.tree-card-border { fill: none; stroke: var(--clan, #bcc3ca); stroke-width: 1.2; pointer-events: none; }   /* цвет обводки = цвет рода (атрибут stroke), наведение и выделение перекрывают его */
@media (hover: hover) and (pointer: fine) { .tree-card:hover .tree-card-border { stroke: #3a6fd8; stroke-width: 2; } }
.tree-card.hl .tree-card-border { stroke: #e4572e; stroke-width: 3; }
.tree-name { font-size: 11.5px; fill: #2c3e50; font-family: Arial, sans-serif; }
.tree-years { font-size: 11px; fill: #7f8c8d; font-family: Arial, sans-serif; }
.tree-link { cursor: pointer; }
.tree-link-bg { fill: #fafbfc; stroke: #b8c0c7; stroke-dasharray: 4 3; }
@media (hover: hover) and (pointer: fine) { .tree-link:hover .tree-link-bg { stroke: #3a6fd8; fill: #eef3fb; } }
.tree-link-text { font-size: 10.5px; fill: #3a6fd8; font-family: Arial, sans-serif; }

/* обратная ссылка на карточке: переход в род родителей */
.tree-backlink { font-size: 10.5px; fill: #3a6fd8; font-family: Arial, sans-serif; cursor: pointer; }
.tree-backlink:hover { text-decoration: underline; fill: #1f4fb0; }
.tree-link.hl .tree-link-bg { stroke: #e4572e; stroke-width: 3; stroke-dasharray: none; }

/* Поиск человека в информационной строке */
.tree-info-line { align-items: baseline; }   /* все слова строки - по одной базовой линии */
.tree-info-line > .tree-search { align-self: center; }
.tree-search { position: relative; margin-left: auto; padding-left: 14px; }
.tree-search input { width: 230px; box-sizing: border-box; padding: 4px 10px; margin: 0; border: 1px solid #cfd5dc; border-radius: 14px; font-size: 13px; outline: none; background: #fff; }
.tree-search input:focus { border-color: #3a6fd8; background: #fff; }
.tree-search-list { display: none; position: absolute; right: 0; top: calc(100% + 4px); width: 320px; max-height: 360px; overflow: auto; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); z-index: 50; }
.tree-search-list.open { display: block; }
.tree-search-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.tree-search-item small { color: #888; white-space: nowrap; }
.tree-search-item.active, .tree-search-item:hover { background: #eef3fd; }
.tree-search-empty { padding: 8px 10px; color: #888; font-size: 13px; }
@media (max-width: 768px) {
	.tree-search { flex: 1 1 100%; margin: 6px 0 2px; padding-left: 0; }
	.tree-search input { width: 100%; font-size: 16px; }
	.tree-search-list { left: 0; right: 0; width: auto; }
}

/* Цветная засечка рода в инфопанели - как полоска на карточке */
.clan-mark { display: inline-block; width: 4px; height: 14px; border-radius: 2px; margin-right: 7px; vertical-align: -2px; }
.tree-info-block td:nth-child(2), .tree-info-block th:nth-child(2) { text-align: left; }
/* Подробности инфопанели: имена, десятилетия, связи, рекорды */
.info-names { display: flex; gap: 24px; }
.info-clans { max-width: 340px; line-height: 1.6; }
.info-clans .clan-mark { margin-left: 2px; }
.info-sub { margin-top: 4px; color: #666; }
.info-muted { color: #999; font-size: 12px; }
/* Блок только для редактора - цветом предупреждения */
.tree-info-editor, .tree-info-editor h4 { color: #b26a00; }

/* ========== ПРОКРУТКА ТОЛЬКО ПОЛЯ ВКЛАДКИ ==========
   Прокручивается не вся панель, а белое поле под вкладками: полоса прокрутки начинается от границы поля
   и не заходит на кнопки вкладок. */
.sidebar { overflow: hidden; }
#sidebar-content { flex: 1 1 auto; min-height: 0; }
#tab-content { flex: 1 1 auto; min-height: 0 !important; overflow-y: auto; }
/* список людей: поиск прилипает к верху поля, шапка таблицы - под поиском */
#tab-content:has(.plist) { padding-top: 0 !important; }
.plist-toolbar { top: 0; margin-top: 0; }
.plist-toolbar::before { display: none; }
.plist-table thead th { top: var(--toolbar-h, 62px); }
/* та же «ложбинка», что была у панели */
#tab-content::-webkit-scrollbar { width: 14px; }
#tab-content::-webkit-scrollbar-track { background: #e6e9ec; box-shadow: inset 2px 0 3px -1px rgba(0, 0, 0, 0.14), inset -2px 0 3px -1px rgba(0, 0, 0, 0.14); }
#tab-content::-webkit-scrollbar-thumb { background: #b8c0c7; background-clip: padding-box; border: 4px solid transparent; border-radius: 7px; }
#tab-content::-webkit-scrollbar-thumb:hover { background: #99a3ab; background-clip: padding-box; }
@supports (-moz-appearance: none) { #tab-content { scrollbar-color: #b8c0c7 #e6e9ec; } }
.tabs-container { flex-shrink: 0; }   /* иначе при длинном списке вкладки сжимаются по высоте */
/* проверка связей: под формой человека и в блоке «Качество данных» */
.pform-relcheck { margin: 14px 0 0; font-size: 13px; line-height: 1.45; }
.pform-relcheck:empty { display: none; }
.relcheck-error { color: #c62828; }
.relcheck-warn { color: #b26a00; }
.info-issues summary { cursor: pointer; }
/* Раскрытый список связей не должен вылезать за блок: строки длинные, а блок узкий. */
.info-issues { max-width: 100%; min-width: 0; }
.info-issues summary, .info-issue { overflow-wrap: anywhere; word-break: break-word; }
.info-issue { font-size: 12.5px; margin: 3px 0 0 14px; }
.info-issue.error { color: #c62828; }
/* мужья дочерей рода: при подсветке рода и в фильтре рода - наполовину */
svg.family-tree-active .tree-guest.active, svg.tree-filtered:not(.family-tree-active) .tree-guest { opacity: 0.45 !important; }
.info-records { max-width: 520px; }   /* длинные строки рекордов переносятся, чтобы блоки помещались в одну строку */
.tree-info-back { margin-right: 14px; white-space: nowrap; }
.info-decades td { padding: 0 6px 0 0 !important; line-height: 15px; font-size: 12px; }
.info-decades td:nth-child(2) { width: 140px; text-align: left !important; }
.info-decades i { display: block; height: 9px; background: #9db6e6; border-radius: 2px; min-width: 2px; }
/* кнопка правки на портрете в карточке просмотра (только у редактора) */
.pcard-photo-box { position: relative; flex-shrink: 0; line-height: 0; }
.pcard-edit { position: absolute; left: 6px; bottom: 6px; padding: 4px 9px !important; margin: 0; border: none; border-radius: 12px; background: rgba(255,255,255,.92); color: #2f5fc4; font-size: 12px; line-height: 1.3; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pcard-edit:hover { background: #fff; color: #1f4fb0; }
/* ========== КАРТОЧКИ: тень снизу и приподнимание при наведении ==========
   Три полупрозрачных слоя без размытия: тонкий контур 1px вокруг + плотная тень вниз. Зазоры между карточками остаются чистыми. */
.tree-card-shadows { pointer-events: none; }
.tree-card-shadows rect { transition: transform .18s ease, fill .18s ease; }
.tree-sh1 { fill: rgba(20, 35, 60, 0.06); }
.tree-sh2 { fill: rgba(20, 35, 60, 0.10); }
.tree-sh3 { fill: rgba(20, 35, 60, 0.05); }
.tree-card-body { transition: transform .18s ease; }
/* подъём карточки под курсором - только там, где есть мышь */
@media (hover: hover) and (pointer: fine) {
	.tree-card:hover .tree-card-body { transform: translateY(-1.5px); }
	.tree-card:hover .tree-sh2 { fill: rgba(20, 35, 60, 0.13); transform: translateY(1px); }
	.tree-card:hover .tree-sh3 { fill: rgba(20, 35, 60, 0.07); transform: translateY(2.5px); }
}
/* выбор рода на схеме: цветная полоска карточки и широкая невидимая зона у линий */
.tree-clan-hit { fill: transparent; cursor: pointer; }
/* наведение на полоску: она расширяется и светлеет - видно, что это отдельная кнопка «род» */
.tree-clan-stripe { transition: width .15s ease, filter .15s ease; }
@media (hover: hover) and (pointer: fine) {
	.tree-card:has(.tree-clan-hit:hover) .tree-clan-stripe { width: 11px; filter: brightness(1.15); }
	.tree-card:has(.tree-clan-hit:hover) .tree-card-border { stroke: var(--clan); stroke-width: 2; }   /* при наведении на полоску рамка цвета рода, а не синяя */
}
.tree-line-hit { fill: none; stroke: transparent !important; stroke-width: 10; cursor: pointer; opacity: 1 !important; }
.tree-line { pointer-events: none; }
.pcard-clan { display: inline-flex; align-items: center; }
/* ========== ФОТО РОДА ========== */
.clan-photo { width: 240px; }
.clan-photo-img { display: block; width: 240px; max-height: 170px; object-fit: cover; border-radius: 8px; cursor: zoom-in; box-shadow: 0 2px 6px rgba(20,35,60,.18); }
.clan-photo-cap { margin-top: 6px; font-size: 13px; color: #555; }
.clan-photo-caption { width: 100%; box-sizing: border-box; margin: 8px 0 0; padding: 5px 8px; border: 1px solid #cfd5dc; border-radius: 6px; font-size: 13px; background: #fff; }
.clan-photo-actions { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
.clan-photo-actions .danger { color: #c62828; }
.clan-photo-add { width: 240px; height: 140px; margin: 0; padding: 0; border: 2px dashed #c3cad2; border-radius: 8px; background: transparent; color: #3a6fd8; font-size: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.clan-photo-add small { color: #999; font-size: 12px; }
.clan-photo-add:hover { border-color: #3a6fd8; background: rgba(238, 243, 253, .55); }
.clan-viewer { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 14, 20, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: zoom-out; padding: 20px; box-sizing: border-box; }
.clan-viewer img { max-width: 95vw; max-height: 85vh; object-fit: contain; border-radius: 6px; }
.clan-viewer-cap { color: #eee; font-size: 16px; }
@media (max-width: 768px) { .clan-photo, .clan-photo-img, .clan-photo-add { width: 100%; } }
/* портретные карточки (вертикальная ориентация) - текст чуть мельче */
.tree-portrait .tree-name { font-size: 10.5px; }
.tree-portrait .tree-years, .tree-portrait .tree-backlink, .tree-portrait .tree-link-text { font-size: 10px; }
@media (max-width: 768px) {
	.tree-info-block table.info-decades { width: auto; }   /* график рождений прижат влево, как на компьютере */
}
.plist .plist-new { height: 40px; padding: 0 14px !important; border: 1px solid #3a6fd8; border-radius: 2.5px; background: #fff; color: #3a6fd8; font-size: 14px; cursor: pointer; white-space: nowrap; }
.plist .plist-new:hover { background: #eef3fd; }
/* ========== ПОДРОБНОСТИ ИНФОПАНЕЛИ: блоки-карточки ========== */
.tree-info-details { gap: 12px; padding: 12px 20px 16px; }
.tree-info-block { background: #fff; border: 1px solid #e1e5ea; border-radius: 10px; padding: 10px 14px 12px; box-shadow: 0 1px 2px rgba(20, 35, 60, 0.05); align-self: stretch; }   /* блоки в строке одной высоты - по самому высокому */
.tree-info-block h4 { margin: 10px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a94a0; }
.tree-info-block h4:first-child { margin-top: 0; }
.tree-info-editor { background: #fffaf1; border-color: #f1dfbf; }
.tree-info-editor h4 { color: #b26a00; }
/* фото рода - без обрезки: целиком, в своих пропорциях */
.clan-photo { padding: 8px; }
.clan-photo-img { width: 240px; height: auto; max-height: 260px; object-fit: contain; background: #f2f4f7; box-shadow: none; }
@media (max-width: 768px) {
	.tree-info-details { gap: 10px; }
	.tree-info-block { align-self: stretch; }
	.clan-photo-img { width: 100%; max-height: 70vh; }
}
@media (max-width: 768px) {
	/* таблица родов на телефоне: род, родоначальник и число людей; поколения и всех потомков прячем */
	.info-clans-table th:nth-child(3), .info-clans-table td:nth-child(3), .info-clans-table th:nth-child(5), .info-clans-table td:nth-child(5) { display: none; }
	.info-clans-table td:first-child { white-space: nowrap; }
	.info-clans-table td { vertical-align: top; }
}
/* ========== О ЖИЗНИ И ФОТОГРАФИИ ЧЕЛОВЕКА ========== */
#pmedia:empty { display: none; }
.pmedia-edit { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 8px; color: #3a6fd8; text-decoration: none; }
.pmedia-text { font-size: 14px; line-height: 1.55; color: #2c3e50; }
.pmedia-text p { margin: 0 0 8px; }
.pmedia-text.collapsed { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.pmedia-more { font-size: 13px; color: #3a6fd8; }
.pmedia-textarea { width: 100%; box-sizing: border-box; min-height: 160px; padding: 10px !important; font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.pmedia-actions { display: flex; gap: 8px; margin-top: 8px; }
.pmedia-add { width: 100%; padding: 14px !important; border: 2px dashed #c3cad2; border-radius: 8px; background: transparent; color: #3a6fd8; font-size: 14px; cursor: pointer; }
.pmedia-add:hover { border-color: #3a6fd8; background: rgba(238, 243, 253, .55); }
.pmedia-count { display: inline-block; min-width: 18px; padding: 0 6px !important; border-radius: 9px; background: #e6ebf1; color: #5b6570; font-size: 11px; text-align: center; }
.pmedia-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.pmedia-thumb { position: relative; aspect-ratio: 1; padding: 0 !important; margin: 0; border: none; border-radius: 6px; overflow: hidden; background: #e9edf1; cursor: zoom-in; }
.pmedia-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.pmedia-thumb:hover img { transform: scale(1.05); }
.pmedia-thumb-add { border: 2px dashed #c3cad2; background: transparent; color: #3a6fd8; font-size: 26px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.pmedia-thumb-add small { font-size: 11px; margin-top: 4px; }
.pmedia-thumb-add:hover { border-color: #3a6fd8; background: rgba(238, 243, 253, .55); }
/* пустой раздел - строка во всю ширину вместо большого квадрата: пустая карточка не растягивается,
   а зона остаётся достаточной, чтобы перетащить в неё файлы мышью */
.pmedia-grid-empty { display: block; }
.pmedia-grid-empty .pmedia-thumb-add { width: 100%; height: 46px; aspect-ratio: auto; flex-direction: row; gap: 8px; font-size: 16px; }
.pmedia-grid-empty .pmedia-thumb-add small { margin-top: 0; font-size: 14px; color: #3a6fd8; }
.pmedia-grid-empty .pmedia-drop-hint { margin-top: 0 !important; font-size: 12px !important; }
/* просмотр фото */
.pviewer { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 14, 20, .94); display: flex; flex-direction: column; }
.pviewer * { box-sizing: border-box; }
.pviewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 56px 8px; cursor: zoom-out; }
.pviewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; cursor: default; }
.pviewer-info { flex-shrink: 0; max-height: 40vh; overflow: auto; padding: 8px 16px 16px; color: #eee; text-align: center; }
.pviewer-counter { font-size: 12px; color: #9aa3ad; margin-bottom: 6px; }
.pviewer-caption { max-width: 720px; margin: 0 auto; font-size: 15px; line-height: 1.5; text-align: left; white-space: normal; }
.pviewer-caption-input { display: block; width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 10px; border: 1px solid #3b4450; border-radius: 6px; background: #1b2128; color: #eee; font: inherit; font-size: 14px; line-height: 1.45; resize: vertical; }
.pviewer-actions { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.pviewer-actions button { padding: 6px 14px; border: 1px solid #4a5563; border-radius: 16px; background: transparent; color: #dfe6ee; font-size: 13px; cursor: pointer; }
.pviewer-actions button:hover { background: #2a323c; }
.pviewer-actions .danger { color: #ff8a80; border-color: #6b3b3b; }
.pviewer-close, .pviewer-nav { position: absolute; z-index: 2; border: none; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; border-radius: 50%; }
.pviewer-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 18px; }
.pviewer-nav { top: 40%; width: 44px; height: 44px; font-size: 30px; line-height: 40px; }
.pviewer-nav.prev { left: 8px; } .pviewer-nav.next { right: 8px; }
.pviewer-close:hover, .pviewer-nav:hover { background: rgba(255,255,255,.2); }
@media (max-width: 768px) { .pviewer-stage { padding: 56px 8px 8px; } .pviewer-nav { top: auto; bottom: 45vh; } }
/* полоса прокрутки левой панели без серой «ложбинки»: поле белое, только тонкий бегунок */
#tab-content::-webkit-scrollbar, .sidebar::-webkit-scrollbar, .tree-info-details::-webkit-scrollbar { width: 8px; height: 8px; }
#tab-content::-webkit-scrollbar-track, .sidebar::-webkit-scrollbar-track, .tree-info-details::-webkit-scrollbar-track { background: transparent; box-shadow: none; }
#tab-content::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb, .tree-info-details::-webkit-scrollbar-thumb { background: #cfd5db; border: 2px solid transparent; background-clip: padding-box; border-radius: 4px; }
#tab-content::-webkit-scrollbar-thumb:hover, .tree-info-details::-webkit-scrollbar-thumb:hover { background: #aeb6be; background-clip: padding-box; }
@supports (-moz-appearance: none) { #tab-content, .sidebar, .tree-info-details { scrollbar-color: #cfd5db transparent; scrollbar-width: thin; } }
@media (max-width: 768px) {
	#tab-content { scrollbar-width: none; }
	#tab-content::-webkit-scrollbar { display: none; }   /* на телефоне полосы нет вовсе - листается пальцем */
}
.info-places { max-width: 260px; }
.info-places div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* сенсорные экраны: палец неточный - полоска рода не перехватывает нажатие, вся карточка открывает человека */
@media (pointer: coarse) { .tree-clan-hit { pointer-events: none; } }
/* перекрёстные ссылки инфопанели */
.info-decades tr.pf-link { cursor: pointer; }
.info-decades tr.pf-link:hover td { color: #3a6fd8; }
.info-decades tr.pf-link:hover i { background: #3a6fd8; }
.tree-info .info-names a, .tree-info .info-places a { color: #3a6fd8; text-decoration: none; border: none; }   /* ссылки - синие, как остальные в инфопанели */
.tree-info .info-names a:hover, .tree-info .info-places a:hover { text-decoration: underline; }
/* плашка фильтра в «Списке» */
.plist .plist-chip-row { flex: 1 1 100%; }
.plist .plist-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 6px 5px 12px !important; border-radius: 16px; background: #e8f0fd; color: #1f4fb0; font-size: 13px; font-weight: 600; }
.plist .plist-chip button { width: 22px; height: 22px; padding: 0 !important; border: none; border-radius: 50%; background: #c9d9f7; color: #1f4fb0; cursor: pointer; font-size: 12px; line-height: 22px; }
.plist .plist-chip button:hover { background: #3a6fd8; color: #fff; }
/* найденные люди на схеме */
svg.tree-people-filter .tree-card:not(.pmatch), svg.tree-people-filter .tree-link, svg.tree-people-filter .tree-line, svg.tree-people-filter .tree-frame { opacity: 0.15; }
svg.tree-people-filter .tree-card.pmatch .tree-card-border { stroke: #e4572e; stroke-width: 2.5; }
.auth-switch { margin: 12px 0 0; font-size: 14px; color: #666; text-align: center; }
/* ========== КАРТА МЕСТ РОЖДЕНИЯ ========== */
/* z-index: 0 запирает слои Leaflet (у них свои 400-700) внутри карты,
   иначе они всплывают над родовой панелью и она открывается под картой */
#tree-map { display: none; position: relative; z-index: 0; flex: 1; min-height: 0; transition: margin-left .3s ease; }
body.map-mode #families-container { display: none; }
body.map-mode #tree-map { display: block; }
@media (min-width: 769px) { body.map-mode:has(.sidebar.active) #tree-map { margin-left: var(--sidebar-w); } }
#tree-map-canvas { position: absolute; inset: 0; background: #e8ecef; }
#tree-map-status { position: absolute; left: 10px; bottom: 22px; z-index: 500; max-width: min(360px, calc(100% - 20px)); max-height: 40%; overflow: auto; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(0,0,0,.18); font-size: 13px; color: #333; }
#tree-map-status details summary { cursor: pointer; }
#tree-map-status .map-pick { color: #b26a00; font-weight: 600; }
.tree-map-close { position: absolute; top: 10px; right: 10px; z-index: 500; padding: 7px 12px; border: none; border-radius: 16px; background: #fff; color: #1f4fb0; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.2); cursor: pointer; }
/* Карта: место показывает лицо, а не одинаковый кружок. В пине портрет самого заметного человека,
   в уголке - сколько людей родилось в этом месте. Попап раскрывает их сеткой миниатюр. */
.map-pin-wrap { background: none; border: none; }
.map-pin { position: relative; display: block; box-sizing: border-box; width: 52px; height: 52px; border: 3px solid #fff; border-radius: 50%; background-color: #e9edf2; background-size: cover; background-position: center 42%; background-repeat: no-repeat; box-shadow: 0 2px 7px rgba(0,0,0,.35); cursor: pointer; }
.map-pin-big { width: 68px; height: 68px; }
.map-pin::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid #fff; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.map-pin b { position: absolute; right: -6px; top: -5px; box-sizing: border-box; min-width: 21px; height: 21px; padding: 0 5px; border: 2px solid #fff; border-radius: 11px; background: var(--pin, #3a6fd8); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 17px; text-align: center; }
.map-pin:hover { border-color: #3a6fd8; }
.map-pin-hit { border-color: #e4572e; }
.map-pin-hit::after { border-top-color: #e4572e; }
.map-pin-hit b { background: #e4572e; }
.map-pin-off { opacity: .3; }
.map-dot-off { pointer-events: none; }

.map-popup b { display: block; }
.map-popup-sub { display: block; margin: 1px 0 8px; color: #8a9099; font-size: 12px; }
.map-grid { display: grid; grid-template-columns: repeat(4, 56px); gap: 9px 6px; }
.map-cell, .leaflet-container a.map-cell { display: block; text-align: center; text-decoration: none; color: #3b4148;
	-webkit-tap-highlight-color: transparent; }
.map-cell:hover, .leaflet-container a.map-cell:hover { color: #1f4fb0; }
.map-cell-ava { display: block; width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; object-fit: cover; background: #e9edf2; }
/* Колечко вокруг миниатюры - box-shadow, а не outline: тень всегда повторяет скругление,
   а outline в части браузеров рисуется прямоугольным вокруг круглого снимка.
   Белый промежуток отделяет колечко от лица. */
.map-cell:hover .map-cell-ava { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3a6fd8; }
/* Ячейка - ссылка, и по нажатию браузер обводил прямоугольником всю клетку вместе с подписью.
   Свою рамку показываем только при ходьбе с клавиатуры и опять же вокруг круга. */
.map-cell:focus { outline: none; }
.map-cell:focus-visible .map-cell-ava { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1f4fb0; }
.map-cell-name { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.2; }
.map-cell-name i { display: block; color: #9aa0a8; font-style: normal; font-size: 9.5px; }
.map-cell-off { opacity: .3; }
.map-popup-all { display: inline-block; margin-top: 9px; color: #3a6fd8; font-size: 12px; }
.map-years { color: #999; font-size: 11px; }
@media (max-width: 600px) { .map-grid { grid-template-columns: repeat(3, 56px); } }
.tree-info-map { margin-left: auto; padding-left: 14px; white-space: nowrap; }
/* глобус: контур в цвет текста, поэтому значок одинаков в любой теме и системе */
.ico-globe { width: 18px; height: 18px; vertical-align: -4px; fill: none; stroke: currentColor;
	stroke-width: 1.4; stroke-linecap: round; }
.tree-info-line > .tree-info-map + .tree-search { margin-left: 0; }
.pcard-place { color: #3a6fd8; text-decoration: none; }
/* на телефоне рядом нет подписи - значок крупнее, и увеличена область нажатия */
@media (max-width: 768px) { .tree-info-map { margin-left: 0; padding: 0 6px 0 10px; }
	.ico-globe { width: 22px; height: 22px; vertical-align: -6px; stroke-width: 1.3; } }
/* фото рода: картинка сама по своим пропорциям (без серых полей), скругление по краю самого фото, одинаковые отступы */
.clan-photo { width: 264px; box-sizing: border-box; padding: 12px !important; }
.clan-photo-img { display: block; width: auto !important; height: auto; max-width: 240px; max-height: 300px; margin: 0 auto; object-fit: initial; background: none; border-radius: 8px; box-shadow: 0 1px 4px rgba(20,35,60,.18); }
.clan-photo-caption { margin-top: 10px; }
@media (max-width: 768px) {
	.clan-photo { width: 100%; }
	.clan-photo-img { max-width: 100%; max-height: 70vh; }
}
/* перестановка фото перетаскиванием (у редактора) */
.pmedia-grid .pmedia-thumb[data-photo-id] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pmedia-grid .pmedia-thumb img { pointer-events: none; -webkit-user-drag: none; }
.pmedia-grid.sorting .pmedia-thumb { cursor: grabbing; }
.pmedia-thumb.dragging { opacity: .55; outline: 2px dashed #3a6fd8; outline-offset: 2px; transform: scale(.96); }
/* раздел, в который сейчас можно бросить файл */
.pmedia-grid.drop-target { outline: 2px dashed var(--ui-accent); outline-offset: 6px; border-radius: 6px; background: rgba(238, 243, 253, .5); }
.info-show-all { display: inline-block; margin-top: 6px; font-size: 13px; }
.info-places .info-muted { font-weight: 400; letter-spacing: 0; }
/* перетаскивание файлов фото в «Информацию» */
.pmedia-drop-hint { color: #9aa3ad; font-size: 10px !important; margin-top: 2px !important; }
#tab-content.pmedia-dropping { position: relative; }
#tab-content.pmedia-dropping::after { content: 'Отпустите, чтобы добавить фото'; position: absolute; inset: 8px; z-index: 50; display: flex; align-items: center; justify-content: center; border: 3px dashed #3a6fd8; border-radius: 12px; background: rgba(238, 243, 253, .9); color: #1f4fb0; font-size: 18px; font-weight: 600; pointer-events: none; }
@media (pointer: coarse) { .pmedia-drop-hint { display: none; } }
.pcard-date-warn { color: #b26a00; }

/* добавление ветки из JSON */
.bprev { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.bprev-sum { font-size: 14px; }
.bprev-h { font-size: 13px; font-weight: 600; color: var(--ui-muted); }
.bprev-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.bprev-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px !important; border: 1px solid var(--ui-border); border-radius: 4px; background: #fafafa; }
.bprev-row-on { border-color: #b9cdf3; background: #f3f7fe; }
.bprev-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; font-size: 14px; }
.bprev-who span { font-size: 13px; color: var(--ui-muted); }
.bprev-who small { flex-basis: 100%; font-size: 12px; color: var(--ui-muted); }
.ucard .bprev select, .ucard .bprev input[type="text"], .ucard .bprev input:not([type]) { width: 100%; height: 40px; padding: 0 8px !important; border: 1px solid #ddd; border-radius: 2.5px; background: #fff; font: inherit; font-size: 13px; color: #333; }
.bprev-note { font-size: 12px; color: var(--ui-muted); }
.bprev-manual-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ucard .bprev-manual-body .ufile-btn { flex: none; }
.bprev-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.bprev-check input { margin-top: 2px; }
.bbatches { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.bbatch { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px !important; border: 1px solid var(--ui-border); border-radius: 4px; }
.bbatch span { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.bbatch b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbatch small { color: var(--ui-muted); }
.ucard .bbatch .ui-btn { flex: none; padding: 6px 10px !important; }

/* мелкий масштаб: карточка - прямоугольник цвета рода (виртуализация схемы) */
.tree-lod { fill: var(--clan, #aeb6be); opacity: .55; stroke: none; }
.tree-card.tree-lod:hover { opacity: .85; }
.tree-card.tree-lod.hl { stroke: #e4572e; stroke-width: 4; opacity: .9; }
.tree-lod-link { fill: #fff; stroke: #c9ced3; stroke-width: 1; stroke-dasharray: 3 3; }
.tree-link.tree-lod-link.hl { stroke: #e4572e; stroke-width: 3; stroke-dasharray: none; }
svg.tree-people-filter .tree-card.tree-lod.pmatch { opacity: 1; stroke: #e4572e; stroke-width: 3; }

/* карточка, у которой есть фотографии в галерее */
.tree-photo-dot { fill: var(--clan, #7f8c8d); stroke: #fff; stroke-width: 1.2; pointer-events: none; }

/* вкладка «+»: новый человек, когда первая вкладка занята «Информацией» */
.tab-add { padding: 9px 13px !important; font-size: 18px; line-height: 1; color: var(--ui-accent); font-weight: 600; }

/* перетаскивание файлов: подсвечивается тот раздел, в который они попадут */
.pmedia-drop-here .pmedia-grid { outline: 2px dashed var(--ui-accent); outline-offset: 6px; border-radius: 6px; }
.pmedia-drop-here h3 { color: var(--ui-accent); }

/* просмотрщик: кто на фото */
.pviewer-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; color: #ddd; }
.pviewer-person { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px !important; background: rgba(255,255,255,.14); border-radius: 12px; }
.pviewer-person a { color: #fff; text-decoration: none; }
.pviewer-person a:hover { text-decoration: underline; }
.pviewer-person button { padding: 0 2px !important; border: none; background: none; color: #ffb3a7; font-size: 12px; line-height: 1; cursor: pointer; }
.pviewer-tag-input { min-width: 160px; flex: 1; height: 28px; padding: 0 8px !important; border: 1px solid rgba(255,255,255,.3); border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 13px; }
.pviewer-tag-input::placeholder { color: #bbb; }

/* лента фотографий рода в подробностях */
.clan-photo h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ui-muted); }
.clan-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.clan-grid .pmedia-thumb { width: 62px; height: 62px; }
.clan-grid .pmedia-thumb-add { font-size: 16px; overflow: hidden; }
/* в клетку 62px подсказка про перетаскивание не влезает и торчала наружу; само перетаскивание работает */
.clan-grid .pmedia-thumb-add .pmedia-drop-hint { display: none; }
.clan-grid .pmedia-thumb-add small { font-size: 10px; line-height: 1.15; padding: 0 2px; }

/* пустые пунктирные блоки - той же высоты, что строки родителей/супругов/детей */
.pmedia-add,
.pmedia-grid-empty .pmedia-thumb-add {
	height: var(--pcard-row-h); box-sizing: border-box; padding: 0 12px !important;
	display: flex; align-items: center; justify-content: center; gap: 8px;
}
.clan-grid .pmedia-thumb-add { height: auto; }
.clan-grid .pmedia-thumb-add small { font-size: 9px; }
.clan-thumb-person { outline: 1px solid var(--ui-border); }
.clan-photo-more { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--ui-accent); }
.clan-photo.pmedia-drop-here { outline: 2px dashed var(--ui-accent); outline-offset: 4px; border-radius: 6px; }
.pviewer-hint { font-size: 12px; color: #bbb; align-self: center; }

/* блоки складываются столбцами: первый задаёт высоту, следующие копятся вниз,
   а когда очередной не помещается в остаток - уходит в новый столбец (высота ставится в packInfoBlocks) */
.tree-info-rest { flex: 1 1 320px; min-width: 0; display: flex; flex-flow: column wrap; align-content: flex-start; gap: 12px; }
/* на время замера естественных ширин растяжение по столбцу отключается */
.tree-info-rest.measuring > .tree-info-block { align-self: flex-start; }
/* на телефоне блок фото такой же ширины, как остальные */
@media (max-width: 768px) { .tree-info-rest > .clan-photo { max-width: none; } }
@media (max-width: 768px) {
	.tree-info-rest { flex-flow: column nowrap; align-content: stretch; height: auto !important; gap: 10px; }
	.tree-info-rest > .tree-info-block { align-self: stretch; }
	.info-places { max-width: none; }   /* в столбик блоки одной ширины */
}

/* блок фотографий рода стоит в общем потоке столбцов: ширину берёт по содержимому,
   но не шире 400px, чтобы не забирать пол-экрана */
.tree-info-rest > .clan-photo { width: auto; max-width: 400px; box-sizing: border-box; }
.clan-photo-body { display: flex; gap: 12px; align-items: flex-start; }
.clan-photo-side { flex: 1 1 auto; min-width: 0; }
.clan-photo.wide .clan-photo-body { flex-direction: column; gap: 8px; }
.clan-photo.wide .clan-photo-side { width: 100%; }
.clan-photo.wide .clan-photo-img { width: 100%; max-width: 100%; max-height: 300px; object-fit: contain; margin: 0; }
.clan-photo.tall .clan-photo-img { flex: 0 0 auto; max-width: 210px; max-height: 300px; margin: 0; }
.clan-photo .clan-photo-cap { margin: 8px 0 0; width: 100%; line-height: 1.4; }
.clan-photo .clan-grid { margin-top: 6px; }
@media (max-width: 768px) {
	.clan-photo-body, .clan-photo.tall .clan-photo-body { flex-direction: column; }
	.clan-photo.tall .clan-photo-img, .clan-photo.wide .clan-photo-img { max-width: 100%; max-height: 60vh; }
	.clan-photo-side { width: 100%; }
}

/* Превью рода идут одним потоком: свои, кнопка «добавить», затем пришедшие от людей.
   Строка заполняется до правого края и переносится на следующую. Раньше здесь были
   колонки по высоте обложки, да ещё двумя отдельными сетками - оставались пустоты. */
.clan-photo.tall .clan-photo-side { display: flex; flex-direction: column; min-width: 0; }
.clan-photo.tall .clan-grid { display: flex; flex-flow: row wrap; align-content: flex-start; gap: 6px; margin: 0; }
.clan-photo.tall .clan-photo-grids { flex: 1 1 auto; min-height: 0; min-width: 0; }
/* превью, которым не хватило места рядом с обложкой: их показывает «Показать все» */
.clan-thumb-over { display: none !important; }
/* развёрнутый список растёт вниз строками, иначе колонки уехали бы за край карточки.
   Обложка при этом встаёт сверху, чтобы превью шли во всю ширину, а не в узкий столбец */
.clan-photo.tall.all .clan-photo-body { flex-direction: column; gap: 8px; }
.clan-photo.tall.all .clan-photo-side { width: 100%; }
.clan-photo.tall.all .clan-photo-grids { display: block; }
.clan-photo.tall.all .clan-grid { flex-flow: row wrap; }
@media (max-width: 768px) { .clan-photo.tall .clan-photo-grids { display: block; } }

/* приветственный блок: заголовок и список возможностей (он же текст для поисковиков) */
/* ---------- разметка главной ---------- */
.wb-hero { padding: 32px 0 30px; text-align: center; }
.wb-hero h1 { margin: 0 0 14px; font-size: 34px; line-height: 1.2; color: #2c3e50; font-weight: 700; }
.wb-lead { max-width: 620px; margin: 0 auto; font-size: 17px; line-height: 1.55; color: #4a5a6a; }
.wb-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 24px 0 10px; }
.welcome-block .wb-btn { display: inline-block; padding: 11px 22px; border: 1px solid var(--ui-border); border-radius: 8px;
	background: #fff; color: var(--ui-accent); font-size: 15px; font-weight: 600; cursor: pointer;
	text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.welcome-block .wb-btn:hover { border-color: var(--ui-accent); box-shadow: 0 2px 10px rgba(20,35,60,.10); text-decoration: none; }
.welcome-block .wb-btn-main { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.welcome-block .wb-btn-main:hover { background: #2f5fc0; color: #fff; }
.wb-note { margin: 0; font-size: 13px; color: var(--ui-muted); text-align: center; }

/* ряд «текст и снимок»; у чётных снимок слева */
.wb-row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 36px; align-items: center; padding: 34px 0; }
.wb-row-flip .wb-text { order: 2; }
.wb-text h2 { margin: 0 0 12px; font-size: 23px; line-height: 1.25; color: #2c3e50; }
.wb-text p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: #4a5a6a; }
.wb-shot { margin: 0; }
/* узкий снимок (столбик, а не полоса) не растягиваем на всю колонку - он бы расплылся */
.wb-shot-narrow { display: flex; justify-content: center; }
.wb-shot-narrow img { max-width: 420px; }
.wb-demo-note { margin: 10px 0 0; padding-top: 22px; border-top: 1px solid rgba(60,70,85,.10);
	font-size: 13px; line-height: 1.5; color: var(--ui-muted); text-align: center; }
.wb-shot img { display: block; width: 100%; height: auto; border-radius: 10px;
	border: 1px solid var(--ui-border); box-shadow: 0 6px 24px rgba(20,35,60,.10); }

/* два коротких блока без снимков */
.wb-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px 0 8px; }
.wb-card { padding: 20px 22px; background: #f7f9fc; border: 1px solid var(--ui-border); border-radius: 10px; }
.wb-card h3 { margin: 0 0 8px; font-size: 17px; color: #2c3e50; }
.wb-card p { margin: 0; font-size: 14px; line-height: 1.55; color: #4a5a6a; }

.wb-end { padding: 40px 0 10px; text-align: center; }
.wb-end h2 { margin: 0 0 10px; font-size: 24px; color: #2c3e50; }
.wb-end p { max-width: 560px; margin: 0 auto; font-size: 15px; line-height: 1.6; color: #4a5a6a; }

@media (max-width: 820px) {
	.welcome-block { padding: 0 16px 44px; }
	.wb-hero { padding: 32px 0 26px; }
	.wb-hero h1 { font-size: 26px; }
	.wb-lead { font-size: 16px; }
	.wb-row { grid-template-columns: 1fr; gap: 18px; padding: 26px 0; }
	.wb-row-flip .wb-text { order: 0; }
	.wb-text h2 { font-size: 20px; }
	.wb-cards { grid-template-columns: 1fr; }
	.welcome-block .wb-btn { width: 100%; text-align: center; box-sizing: border-box; }
}

/* ========== ШАПКА: ПОИСК ========== */
/* строка поиска стоит в шапке - на телефоне это самое заметное место */
#header-search { flex: 1 1 auto; min-width: 0; max-width: 460px; margin: 0 auto; padding-left: 0; }
#header-search input { height: 40px; padding: 0 56px 0 14px; border-radius: 0; font-size: 15px; }
/* выпадающий список строго в створе со строкой поиска */
#header-search .tree-search-list { left: 0; right: 0; width: auto; top: 100%; margin-top: -1px; border-radius: 0; border-color: #cfd5dc; }
#header-search input { width: 100%; }
#header-search input::-webkit-search-cancel-button { display: none; }
.tree-search-clear { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0; background: none; color: #8d959e; font-size: 13px; line-height: 1; cursor: pointer; }
.tree-search-clear:hover { color: #2d343a; }
#header-search.has-text .tree-search-clear { display: block; }
.tree-search-count { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #8d959e; pointer-events: none; }
.tree-search-count.none { color: #c0392b; }
.tree-search-more { padding: 7px 10px; font-size: 13px; color: #3a6fd8; cursor: pointer; border-top: 1px solid #eee; }
.tree-search-more:hover { background: #eef3fd; }

/* ========== ЗАГОЛОВОК БОКОВОЙ ПАНЕЛИ ========== */
/* у каждого окна панели свой заголовок и свой крест - он не оторван от содержимого */
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 0 10px; position: sticky; top: 0; z-index: 5;
	background: rgba(246, 247, 249, 0.80); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.panel-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }   /* имя человека пишется только здесь, поэтому длинное переносится, а не обрезается */
/* стрелка возврата по цепочке переходов между карточками */
.panel-back { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: -7px; padding: 0; border: 0; border-radius: 8px; background: none; color: #6b7480; cursor: pointer; transition: color .15s, background .15s; }
.panel-back:hover { color: #2d343a; background: rgba(60, 70, 85, 0.07); }
.panel-back[hidden] { display: none; }
.panel-close { flex: none; width: 32px; height: 32px; padding: 0; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #8d959e; transition: color .15s; }
.panel-close:hover { color: #2d343a; background: none; }

/* ========== РУЧНАЯ ПРАВКА В КАРТОЧКЕ ========== */
.pcard-manual { margin-top: 22px; border-top: 1px solid var(--ui-border); padding-top: 12px; }
/* предупреждение тем же цветом, что «⚠ N без дат» в инфопанели */
.pcard-manual > summary { cursor: pointer; font-size: 13px; color: #b26a00; list-style: none; display: flex; align-items: center; gap: 6px; }
.pcard-manual > summary:hover { color: #8c5300; }
.pcard-manual > summary::-webkit-details-marker { display: none; }
.pcard-manual > summary::before { content: '⚠'; }
.pcard-manual > summary::after { content: '▾'; margin-left: auto; }
.pcard-manual[open] > summary::after { content: '▴'; }
.pcard-manual-warn { font-size: 13px; color: #b26a00; line-height: 1.45; margin: 10px 0; }
/* удаление - единственное действие в блоке: во всю ширину, текст по центру */
.pcard-manual-row { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pcard-manual-row .ui-btn { width: 100%; justify-content: center; text-align: center; }

/* ========== ПРАВКА ПРЯМО В КАРТОЧКЕ ==========
   Поля тихие: выглядят как текст, пунктирная рамка появляется при наведении,
   сохраняются сами при уходе из поля. Гость видит те же значения, но без полей. */
/* строки правой колонки: даты одной читаемой строкой, профессия и место - каждое на своей */
.pcard-line { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pcard-line + .pcard-line { margin-top: 2px; }
.pcard-line > .pfield { flex: 1 1 auto; min-width: 0; }
/* даты - первая строка правой колонки: два поля делят её поровну */

.pcard-dates-row { gap: 6px; }
.pcard-dates-row > .pfield-date { flex: 1 1 0; min-width: 0; }
.pcard-fx { flex: none; font-size: 14px; color: var(--ui-muted); padding: 0 2px; }
.pcard-pin { flex: none; width: 24px; height: 34px; padding: 0; border: 0; background: none;
	font-size: 14px; line-height: 1; cursor: pointer; opacity: .85; }
.pcard-pin:hover { opacity: 1; }
.pfield { display: block; margin: 0; min-width: 0; }
.pfield-wide { grid-column: 1 / -1; }
.pcard-main > .pfield { margin-top: 6px; }

.pfield-input {
	width: 100%; box-sizing: border-box; height: 34px; margin: 0;
	padding: 0 8px; border: 1px dashed #d3d9df; border-radius: 6px;
	background: transparent; color: var(--ui-text); font: inherit; font-size: 14px;
	outline: none; transition: border-color .15s, background .15s;
}
.pfield-input::placeholder { color: #aab2ba; }
.pfield-input:hover { border-color: var(--ui-accent); }
.pfield-input:focus { border-style: solid; border-color: var(--ui-accent); background: rgba(255,255,255,.75); }
.pfield-input.saved { border-color: #2e9e5b; }
.pfield-input.failed { border-color: #c0392b; }
.pfield-ro { padding: 0 8px; height: 34px; line-height: 34px; font-size: 14px; color: var(--ui-text);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfield-ro a { white-space: nowrap; }

/* ФИО правится прямо в заголовке: contenteditable, чтобы длинное имя переносилось */
.panel-title .pfield-title { height: auto; min-height: 28px; padding: 2px 8px; margin-left: -8px;
	font-size: 18px; font-weight: 600; line-height: 1.3; white-space: pre-wrap; word-break: break-word; }
.panel-title .pfield-title:empty::before { content: attr(data-ph); color: #aab2ba; font-weight: 400; }

.pcard-age { flex: 0 0 auto; min-width: 58px; font-size: 13px; color: var(--ui-muted); white-space: nowrap; padding-left: 4px; }

/* фотография: тот же пунктир, что у блоков «Добавить фото/документ» */
.pcard-photo-pick { display: block; position: relative; cursor: pointer; line-height: 0; }
.pcard-photo-pick .pcard-photo { display: block; }
.pcard-photo-over {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 0;
	background: rgba(20,28,38,.62); color: #fff; font-size: 12px; text-align: center;
	line-height: 1.2; opacity: 0; transition: opacity .15s; border-radius: 0 0 var(--ui-radius) var(--ui-radius);
}
.pcard-photo-pick:hover .pcard-photo-over { opacity: 1; }
.pcard-photo-box.empty .pcard-photo-pick { display: flex; align-items: center; justify-content: center;
	width: 160px; min-height: 200px; border: 2px dashed #c3cad2; border-radius: var(--ui-radius); }
.pcard-photo-box.empty .pcard-photo-pick:hover { border-color: var(--ui-accent); background: rgba(238,243,253,.55); }
.pcard-photo-add { color: var(--ui-accent); font-size: 14px; line-height: 1.3; text-align: center; padding: 0 10px; }
.pcard-photo-del {
	position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(20,28,38,.55); color: #fff;
	font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.pcard-photo-box:hover .pcard-photo-del { opacity: 1; }
.pcard-photo-del:hover { background: #c0392b; }

/* связи - под спойлером */
.prel-field { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; margin: 0 0 8px; }
.prel-field > span { font-size: 13px; color: var(--ui-muted); }
.prel-input { width: 100%; box-sizing: border-box; height: 36px; margin: 0; padding: 0 8px;
	border: 1px solid var(--ui-border); border-radius: 6px; background: #fff; font-size: 14px; }
.prel-input:focus { border-color: var(--ui-accent); outline: none; }
.prel-msg { min-height: 18px; font-size: 13px; margin-bottom: 6px; }
.prel-msg .error { color: #c0392b; }
.prel-msg .loading { color: var(--ui-muted); }

@media (max-width: 768px) {
	.pcard-photo-box.empty .pcard-photo-pick { width: 150px; height: 190px; }
	.prel-field { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 768px) {
	#header-search { flex: 1 1 auto; margin: 0; }
	#header { gap: 6px; }
}

/* повторяющиеся файлы: плитки групп в настройках */
.dupe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.dupe-actions .ufile-btn { flex: 1 1 auto; min-width: 0; }
.dupe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.dupe-card { display: block; position: relative; padding: 0; border: 1px solid #e0e4e9; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.dupe-card img { display: block; width: 100%; height: 100px; object-fit: cover; background: #eef1f4; }
.dupe-card .dupe-pick { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; accent-color: #3a6fd8; }
.dupe-card:has(.dupe-pick:not(:checked)) { opacity: .45; }
.dupe-note { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 8px; font-size: 12px; line-height: 1.25; }
.dupe-note span { color: #6b7480; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* самые интересные люди рода: портрет, имя и короткое «чем интересен» */
.info-bright { max-width: 320px; }
.bright-list { display: flex; flex-direction: column; gap: 2px; }
.bright-row { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 0; border-radius: 6px; text-decoration: none; color: inherit; }
.bright-row:hover { background: rgba(58, 111, 216, 0.08); text-decoration: none; }
.bright-ava { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #e9edf2; }
.bright-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.bright-text b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bright-why { font-size: 11.5px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) { .info-bright { max-width: none; } }

/* ---------- Список выданных гостевых ссылок (настройки → Доступ) ---------- */
/* Панель узкая, а столбцов пять: заголовки мелкие, действия - столбиком,
   иначе «Отозвать» уезжало за край блока */
.share-table { width: 100%; table-layout: auto; border-collapse: collapse; font-size: 13px; }
.share-table th { text-align: left; font-weight: 600; color: var(--ui-muted); font-size: 10px;
	text-transform: uppercase; letter-spacing: .02em; padding: 0 6px 5px 0; white-space: nowrap; }
.share-table td { padding: 7px 6px 7px 0; border-top: 1px solid var(--ui-border); vertical-align: top; line-height: 1.3; }
.share-table td:last-child, .share-table th:last-child { padding-right: 0; }
.share-table tr.share-dead td { color: var(--ui-muted); }
.share-seen { color: var(--ui-muted); font-size: 11px; }
.share-acts { width: 1%; white-space: nowrap; text-align: right; }
.share-acts a { display: block; font-size: 12px; line-height: 1.6; }
.share-acts a.danger { color: #c62828; }
.share-note { color: var(--ui-muted); font-size: 13px; }

/* ---------- Вкладка «Аккаунт»: пароль, почта, удаление ---------- */
.acc-form { display: flex; flex-direction: column; gap: 8px; }
.acc-form .pform-input { width: 100%; box-sizing: border-box; }
.acc-form .ufile-btn { align-self: flex-start; }
/* главная кнопка блока заметна и вне .ucard, где живёт общее правило */
.acc-form .ufile-btn-ready, .acc-danger .ufile-btn-ready { background: var(--ui-accent); border: 1px solid var(--ui-accent); color: #fff; font-weight: 600; }
.acc-form .ufile-btn-ready:hover, .acc-danger .ufile-btn-ready:hover { background: #2f5fc0; }
/* опасный блок отделён рамкой и цветом: удаление не должно теряться среди настроек */
.ublock.acc-danger { border-color: #f0c9c9; background: #fdf6f6; }
.ufile-btn-danger { border-color: #e0a9a9; color: #c62828; }
.ufile-btn-danger:hover { background: #fbeaea; border-color: #c62828; }
/* полоска занятого места во вкладке «Аккаунт» */
.acc-bar { height: 8px; border-radius: 4px; background: #e9edf1; overflow: hidden; margin-top: 4px; }
.acc-bar i { display: block; height: 100%; width: 0; background: var(--ui-accent); transition: width .3s ease; }
.acc-bar i.acc-bar-warn { background: #e8a33d; }
.acc-bar i.acc-bar-full { background: #c62828; }

/* ---------- Пустое дерево: приглашение начать ---------- */
.tree-empty { position: absolute; inset: 0; display: flex; flex-direction: column;
	align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; }
.tree-empty-card { display: flex; align-items: center; gap: 12px; width: 260px; padding: 10px 14px 10px 10px;
	background: #fff; border: 2px dashed #c3cad2; border-radius: 10px; cursor: pointer;
	box-shadow: 0 2px 8px rgba(20,35,60,.06); transition: border-color .15s, box-shadow .15s; }
.tree-empty-card:hover { border-color: var(--ui-accent); box-shadow: 0 4px 14px rgba(20,35,60,.12); }
.tree-empty-ava { flex: none; width: 46px; height: 46px; border-radius: 8px; background: #eef3fd;
	color: var(--ui-accent); font-size: 26px; line-height: 46px; font-weight: 300; }
.tree-empty-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.tree-empty-text b { font-size: 15px; color: var(--ui-text); }
.tree-empty-text small { font-size: 12px; color: var(--ui-muted); line-height: 1.3; }
.tree-empty-more { font-size: 13px; color: var(--ui-muted); }

/* ---------- Полоса над показательным деревом ---------- */
.demo-strip { position: relative; z-index: 5; margin: 0; padding: 9px 16px; font-size: 13px; line-height: 1.45;
	background: #fff6e5; border-bottom: 1px solid #f0dcb4; color: #6b5522; text-align: center; }
.demo-strip b { color: #5a4415; }
.demo-strip a { color: var(--ui-accent); white-space: nowrap; }
@media (max-width: 768px) { .demo-strip { padding: 8px 12px; font-size: 12px; } }

/* Гостю на главной схема не нужна: без неё страница не растягивается пустым полем.
   И прокрутку возвращаем: всё приложение свёрстано на высоту окна (html, body: overflow hidden),
   поэтому без этого длинная главная обрезалась по нижнему краю экрана. */
#welcome-block ~ #families-container,
#welcome-block ~ #tree-info-bar { display: none; }
body:has(#welcome-block) { overflow: auto; height: auto; min-height: 100%; }
html:has(#welcome-block) { overflow: auto; height: auto; }
body:has(#welcome-block) #header { position: sticky; top: 0; z-index: 200; }

/* Кардиограмма в шапке лендинга: всё показательное дерево одной схемой. Геометрия снята с
   настоящего движка, поэтому пропорции те же, что человек увидит внутри. Наведение подсвечивает
   род и пишет о нём в подписи, нажатие открывает пример целиком. На телефоне номера поколений
   не читались бы, поэтому линейка там скрыта. */
.kardio { position: relative; display: block; width: 100%; max-width: 920px; margin: 26px auto 0;
	border: 1px solid rgba(60,70,85,.12); border-radius: 14px; background: #fbfcfd; overflow: hidden;
	box-shadow: 0 1px 3px rgba(20,35,60,.06); cursor: pointer; text-decoration: none;
	-webkit-tap-highlight-color: transparent; }
.kardio:hover { border-color: rgba(31,79,176,.35); box-shadow: 0 2px 10px rgba(20,35,60,.10); }
.kardio-svg { display: block; width: 100%; height: auto; }
.kardio-bands rect { fill: rgba(60,70,85,.035); }
.kardio-gen { fill: #98a0a9; font-size: 62px; font-weight: 700; text-anchor: middle; }
.kardio-yrs { fill: #b4bac2; font-size: 46px; text-anchor: middle; }
.kardio-clan { --k: #b0b7bf; transition: opacity .2s ease; }
.kardio-card { fill: var(--k); opacity: .5; transition: opacity .2s ease; }
.kardio-line { fill: none; stroke: var(--k); stroke-width: 2.4; opacity: .3; }
/* Пока мышь на одном роде, остальные гаснут - видно, как он идёт через все поколения.
   Класс ставит скрипт, а не :hover: между карточками есть зазоры, и на них :hover пропадал,
   отчего при переходе от карточки к карточке схема вспыхивала и гасла. */
.kardio-svg.has-on .kardio-clan { opacity: .28; }
.kardio-svg.has-on .kardio-clan.is-on { opacity: 1; }
.kardio-svg.has-on .kardio-clan.is-on .kardio-card { opacity: .85; }
.kardio-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: baseline;
	padding: 9px 15px; background: linear-gradient(to top, rgba(251,252,253,.97), rgba(251,252,253,0));
	font-size: 13px; line-height: 1.3; color: #6b727b; pointer-events: none; }
.kardio-cap b { color: #2b313a; font-weight: 600; }
.kardio-cap .kardio-open { margin-left: auto; color: #1f4fb0; white-space: nowrap; }
.kardio-mark { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px;
	background: var(--m, #b0b7bf); }
@media (max-width: 768px) {
	.kardio { margin-top: 18px; border-radius: 10px; }
	.kardio-ruler { display: none; }
	.kardio-cap { font-size: 12px; padding: 7px 10px; white-space: nowrap; }
	.kardio-cap .kardio-open, .kardio-cap .kardio-hint { display: none; }
}

/* Полоса несохранённого дерева. Стоит там же, где плашка показательного дерева, и так же
   не перекрывает схему: человек строит дерево, а не читает предупреждения. Окошек посреди
   работы нет намеренно - именно они и есть тот барьер, которого мы избегаем. */
.draft-strip { position: relative; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 12px;
	align-items: center; justify-content: center; margin: 0; padding: 8px 16px;
	background: #eef4ff; border-bottom: 1px solid #cfdcf5; color: #3a4a63;
	font-size: 13px; line-height: 1.45; }
.draft-strip b { color: #23324a; }
.draft-days { color: #6b7b95; }
.draft-save { padding: 5px 14px; border: 1px solid var(--ui-accent); border-radius: 7px;
	background: var(--ui-accent); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.draft-save:hover { background: #2f5fc0; }
.draft-drop { padding: 5px 12px; border: 1px solid #d8c2c2; border-radius: 7px; background: #fff;
	color: #8a5a5a; font: inherit; font-size: 13px; cursor: pointer; }
.draft-drop:hover { border-color: #c98f8f; background: #fdf6f6; color: #a03d3d; }
.draft-why { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: #4a5a6a; }
.draft-list { margin: 4px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: #4a5a6a; }
@media (max-width: 768px) {
	.draft-strip { padding: 7px 10px; font-size: 12px; gap: 4px 8px; }
	.draft-days { flex-basis: 100%; text-align: center; }
}

/* Заголовок ведёт на рекламную страницу, пока дерево не сохранено: иначе, заведя черновик,
   человек больше не мог её открыть - корень сайта показывает дерево. */
.site-title-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.site-title-link:hover .site-title-text { text-decoration: underline; text-underline-offset: 3px; }

/* Сводка по разобранному файлу GEDCOM: что нашлось и что не переносится. */
.ged-sum { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(60,70,85,.14); border-radius: 10px;
	background: #f7f9fc; font-size: 14px; line-height: 1.5; color: #3a4a63; }
.ged-sum b { color: #23324a; }
.ged-notes { display: block; margin-top: 4px; color: #6b7b95; font-size: 13px; }
.ged-warn { margin: 8px 0 12px; color: #8a6a3a; font-size: 13px; line-height: 1.45; }
.ged-sum .ufile-btn { margin: 0; }

/* Ссылка-приглашение в окне после копирования: её видно целиком и можно выделить руками,
   если буфер обмена почему-то не сработал. */
.umodal-link { margin: 2px 0 12px; padding: 9px 11px; border: 1px solid rgba(60,70,85,.16); border-radius: 8px;
	background: #f6f8fb; color: #2b313a; font-size: 13px; line-height: 1.4; word-break: break-all;
	-webkit-user-select: all; user-select: all; }

/* Блок «Качество данных»: каждая строка - ссылка на список тех, кого надо дозаполнить.
   Раньше это были голые числа, и от «147 без дат» пользы не было. */
.q-hint { margin: 0 0 8px; color: var(--ui-muted); font-size: 12px; line-height: 1.4; }
.tree-info-editor .q-none { color: #a7aeb6; }
/* Строки качества данных - ссылки, но цвет остаётся оранжевым, как у всего блока:
   синий здесь выбивался из предупреждения. Пунктир показывает, что строка нажимается. */
.tree-info-editor a[data-pf] { color: #b26a00; text-decoration: none; border-bottom: 1px dotted rgba(178,106,0,.5); }
.tree-info-editor a[data-pf]:hover { color: #8a5200; border-bottom-color: #8a5200; }
.tree-info-editor .info-issue a { color: inherit; }
/* Предупреждения в строке сводки остаются оранжевыми и став ссылками:
   общее правило .tree-info a красило их в синий. */
a.tree-info-warn { color: #b26a00; text-decoration: none; }
a.tree-info-warn:hover { color: #8a5200; text-decoration: underline; }

/* Шапка таблицы родов - переключатели сортировки. Стрелка бледная, пока по столбцу
   не сортируют: так видно, что шапка нажимается, но она не рябит. */
.info-clans-table .sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
.info-clans-table .sort-th:hover { color: var(--ui-accent, #1f4fb0); }
.info-clans-table .sort-ar { font-style: normal; font-size: 8px; margin-left: 3px; opacity: .22; vertical-align: 1px; }
.info-clans-table .sort-th:hover .sort-ar { opacity: .5; }
.info-clans-table .sort-th.on { color: #2d343a; }
.info-clans-table .sort-th.on .sort-ar { opacity: 1; color: var(--ui-accent, #1f4fb0); }

/* Справка и «о сайте» - в шапке панели настроек: внизу, под «опасной зоной», их не замечали.
   Неяркие, чтобы не спорить с заголовком и вкладками. */
.panel-head-links { flex: none; display: flex; gap: 6px; font-size: 14px; white-space: nowrap; }
.panel-head-links[hidden] { display: none; }
.panel-head-links a { padding: 5px 10px; border-radius: 8px; color: var(--ui-accent, #1f4fb0); text-decoration: none; background: rgba(31,79,176,.08); }
.panel-head-links a:hover { background: rgba(31,79,176,.16); }
@media (max-width: 480px) { .panel-head-links { font-size: 13px; gap: 4px; } .panel-head-links a { padding: 5px 8px; } }

.wb-help { margin: 18px 0 0; font-size: 15px; color: #5d666f; }


/* Подсказка вместо поля даты брака в «Связях»: дата живёт на схеме, у каждой пары своя. */
.prel-hint { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; color: #8a94a0; }

/* ========== СЧЁТЧИК ПОСЕЩЕНИЙ ==========
   Панель узкая, поэтому в графике один ряд - посетители. Второй ряд (заходы)
   в полосе шириной с палец не читался бы; он показывается при наведении.
   Цвет один: рядов не два, различать нечего, и легенда не нужна.
   Полоски в таблицах - те же, что в сводке дерева, чтобы вид не расползался. */
.st-sum { font-size: 13px; color: var(--ui-muted); margin: 2px 0 8px; }
.st-sum b { color: #2d343a; font-size: 15px; }

.st-chart { margin: 0 0 4px; }
.st-bars { display: flex; align-items: flex-end; gap: 2px; height: 74px; }
.st-bar { flex: 1 1 0; min-width: 2px; height: 100%; display: flex; align-items: flex-end;
	background: none; border: 0; padding: 0; cursor: default; }
.st-bar i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0;
	background: var(--ui-accent, #1f4fb0); opacity: .82; transition: opacity .12s; }
.st-bar:hover i { opacity: 1; }
.st-axis { display: flex; justify-content: space-between; font-size: 11px; color: #9aa3ad; margin-top: 4px; }
.st-read { font-size: 12px; color: #5d666f; min-height: 16px; margin-top: 2px; }

.st-h { margin: 16px 0 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: #8a94a0; }
.st-empty { font-size: 13px; color: #9aa3ad; line-height: 1.4; }

.st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-table td { padding: 3px 0; vertical-align: middle; }
.st-table td:first-child { padding-right: 8px; color: #2d343a; }
.st-table td:nth-child(2) { width: 40%; }
.st-table td:nth-child(2) i { display: block; height: 7px; border-radius: 4px;
	background: var(--ui-accent, #1f4fb0); opacity: .35; min-width: 2px; }
.st-table td:last-child { text-align: right; padding-left: 8px; color: var(--ui-muted); white-space: nowrap; }
.st-funnel .st-pct { width: 44px; color: #2d343a; }

/* «Всего на сайте» - просто числа, полоски тут не нужны: величины разного рода
   и сравнивать их между собой нечего. */
.st-totals td:nth-child(2) { width: 0; padding: 0; }
.st-totals td:last-child { color: #2d343a; font-weight: 600; }

/* ---------- круговая схема («одуванчик») ---------- */
/* Геометрия у неё своя, поэтому и стили отдельные: ничего из .tree-card не переиспользуется. */
.tree-radial text {
	font-family: inherit;
	text-anchor: middle;
	dominant-baseline: middle;
	fill: #1b2a3d;
}
.tree-radial .rad-sur  { font-weight: 700; }
.tree-radial .rad-yrs  { fill: #5a6b80; }
.tree-radial .rad-mate { fill: #40566e; }
.rad-labels { pointer-events: none; }

.rad-cell {
	stroke: #fff; stroke-width: 1.6; stroke-linejoin: round;
	cursor: pointer;
}
.rad-cell:hover { filter: brightness(1.07); }
.rad-cell.hl    { stroke: #1f4fb0; stroke-width: 3.5; }

.rad-core { fill: #22405f; stroke: #fff; stroke-width: 3; cursor: pointer; }
.rad-core.hl { stroke: #7fb0ff; }
.rad-core-t text { fill: #fff; }
.rad-core-t .rad-yrs { fill: #dce6f5; }

/* строка под схемой: кто остался вне этой ветки и куда можно перейти */
#rad-aside {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
	padding: 8px 14px;
	font-size: 13px; color: rgba(45,52,58,.8);
	background: rgba(255,255,255,.88); backdrop-filter: blur(6px);
	border-top: 1px solid rgba(60,70,85,.12);
	pointer-events: auto;
}
#rad-aside .rad-aside-l { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#rad-aside button {
	border: 1px solid rgba(60,70,85,.16); border-radius: 999px;
	background: rgba(255,255,255,.9); color: var(--ui-accent, #1f4fb0);
	padding: 2px 10px; font: inherit; font-size: 12.5px; cursor: pointer;
}
#rad-aside button:hover { border-color: rgba(31,79,176,.4); background: #fff; }
#rad-aside .rad-back { color: rgba(45,52,58,.85); }
@media (max-width: 768px) {
	#rad-aside { font-size: 12px; padding: 7px 10px; }
	#rad-aside .rad-aside-l { width: 100%; }
}
