/* ================================================================
 MY ROOTS — CSS
 Skonsolidowany i zoptymalizowany, bez duplikatów i martwego kodu
 ================================================================ */

/* =================== ZMIENNE CSS =================== */
:root {
 --primary: #213951;
 --primary-light: #4a6a87;
 --primary-alpha: rgba(33, 57, 81, 0.1);
 --primary-soft: rgba(33, 57, 81, 0.75);
 --accent: #caa288;
 --accent-alpha: rgba(202, 162, 136, 0.3);
 --accent-soft: rgba(202, 162, 136, 0.85);
 --accent-xlight: rgba(202, 162, 136, 0.12);
 --success: #4caf50;
 --error: #f44336;
 --warning: #ff9800;
 --bg-light: #f9f9f9;
 --bg-white: #fff;
 --bg-overlay: rgba(249, 249, 249, 0.82);
 --bg-error: #fff0f0;
 --map-bg: #e8eef4;
 --border: #ddd;
 --border-light: #f0f0f0;
 --border-medium: #eee;
 --text-dark: #333;
 --text-medium: rgba(51, 51, 51, 0.65);
 --text-light: rgba(51, 51, 51, 0.42);
 --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
 --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
 --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.2);
 --radius: 8px;
 --radius-sm: 4px;
 --radius-lg: 12px;
 --transition: all 0.2s ease;
 --z-modal: 99999;
 --z-controls: 10000;
 --z-tooltip: 1000;
 --ev-birth: var(--accent);
 --ev-death: #c8c8c8;
 --ev-marriage: var(--primary);
 --ev-end: #e0c4c4;
 --ev-event: #a8d8d0;
 --ev-neutral: #d3d3d3;
 --chart-color-1: rgba(255, 99, 132, 1);
 --chart-color-2: rgba(54, 162, 235, 1);
 --chart-color-3: rgba(255, 206, 86, 1);
 --chart-color-4: rgba(75, 192, 192, 1);
 --chart-color-5: rgba(153, 102, 255, 1);
 --chart-primary: rgba(33, 57, 81, 1);
 --chart-primary-light: rgba(33, 57, 81, 0.7);
 --chart-primary-lighter: rgba(33, 57, 81, 0.2);
 --mr-primary: var(--primary);
 --mr-accent: var(--accent);
 --mr-bg: var(--bg-light);
 --mr-text: var(--text-dark);
 --mr-border: var(--border);
 --mr-font: inherit;
 --mr-font-size: 16px;
 --mr-radius: var(--radius);
 --mr-shadow: var(--shadow-sm);
 /* UWAGA: --mr-content-width / --mr-full-width celowo NIE są tu deklarowane.
    Ustawia je „Wygląd → Szerokości" (styl inline na :root). Gdyby były tu,
    ten arkusz ładowany po stylu inline nadpisywałby wybór użytkownika.
    Wartości domyślne (1200px / 1600px) są w fallbacku każdego użycia:
    np. max-width: var(--mr-content-width, 1200px). */
}
.myroots-people-list table td, .myroots-people-list table th, .myroots-events-timeline table td, .myroots-events-timeline table th, .person-content-wrapper table td, .person-content-wrapper table th, .myroots-lifeline-container table td, .myroots-lifeline-container table th, .mr-stats table td, .mr-stats table th, .my-roots-map-wrapper table td, .my-roots-map-wrapper table th {
 border: 0;
}

/* =================== LISTA OSOB =================== */
.myroots-people-list,
.person-profile,
.mr-stats,
.myroots-lifeline-container,
.myroots-events-timeline,
.myroots-kinship {
 /* Szerokość z „Wyglądu". Wyśrodkowanie względem OKNA dolicza skrypt
    (margines), bo kolumna motywu bywa niesymetryczna (np. sidebar) i samo
    CSS centrowałoby względem niej. min() chroni przed poziomym paskiem. */
 box-sizing: border-box;
 width: min(calc(100vw - 32px), var(--mr-content-width, 1200px));
 max-width: none;
 margin-left: auto;
 margin-right: auto;
 padding: 20px;
 font-family: var(--mr-font, inherit);
}

/* Panel boczny drzewa: profil/treść ładowane do panelu mają WYPEŁNIAĆ panel
   (widok „mobilny" na szerokość panelu), a NIE przejmować szerokości treści
   strony ani wyłamywać/centrować się względem okna. */
.my-roots-panel .person-profile,
.my-roots-panel .myroots-people-list,
.my-roots-panel .mr-stats,
.my-roots-panel .myroots-lifeline-container,
.my-roots-panel .myroots-events-timeline,
.my-roots-panel .myroots-kinship,
.myroots-bookgen .person-profile, .mr-bk-flow .person-profile, .mr-bk-pages .person-profile,
.myroots-bookgen .myroots-lifeline-container, .mr-bk-flow .myroots-lifeline-container, .mr-bk-pages .myroots-lifeline-container,
.myroots-bookgen .my-roots-map-wrapper, .mr-bk-flow .my-roots-map-wrapper, .mr-bk-pages .my-roots-map-wrapper {
 width: auto;
 max-width: none;
 margin-left: 0;
 margin-right: 0;
 left: auto;
 transform: none;
}
/* Księga: profil zawsze w jednej kolumnie — paginacja mierzy układ na ekranie,
   a wydruk spłaszcza grid (@media print). Bez tego pomiar ≠ wydruk → puste/ucięte
   strony. Wymuszamy jedną kolumnę także przy pomiarze, więc oba są spójne. */
.myroots-bookgen .person-content-wrapper,
.mr-bk-flow .person-content-wrapper,
.mr-bk-pages .person-content-wrapper {
 display: block;
}
.myroots-filters {
 display: flex;
 gap: 12px;
 flex-wrap: wrap;
 margin-bottom: 24px;
 background: var(--bg-white);
 padding: 20px;
 border-radius: var(--radius);
 border: 1px solid var(--border-medium);
}
.myroots-filters input, .myroots-filters select {
 padding: 9px 12px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 background: var(--bg-white);
 font-size: 14px;
 color: var(--text-dark);
 flex: 1 1 180px;
 transition: var(--transition);
}
.myroots-filters input:hover, .myroots-filters select:hover {
 border-color: var(--primary);
}
.myroots-filters input:focus, .myroots-filters select:focus,
.mr-form-row input:focus, .mr-form-row select:focus,
.myroots-person-selector:focus, .person-selector:focus,
.mr-ap-select:focus {
 border-color: var(--primary);
 box-shadow: 0 0 0 2px var(--primary-alpha);
 outline: none;
}
.myroots-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
 gap: 20px;
}
.mr-card {
 position: relative;
 width: 100%;
 overflow: hidden;
 box-sizing: border-box;
 display: flex;
 flex-direction: column;
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--mr-radius, var(--radius));
 box-shadow: var(--mr-shadow, var(--shadow-sm));
 transition: var(--transition);
}
.myroots-grid .mr-card:hover {
 transform: translatey(-4px);
 box-shadow: var(--shadow-md);
 border-color: var(--primary);
}
.mr-card__link,
.myroots-grid .mr-card__link {
 color: inherit;
 display: block;
 text-decoration: none;
}
.mr-card__avatar {
 width: 100%;
 height: 160px;
 overflow: hidden;
 background: var(--bg-light);
 border-radius: var(--radius) var(--radius) 0 0;
}
.mr-card__avatar img {
 width: 100%;
 height: 100%;
 object-fit: cover;
}
.person-hero__photo-placeholder,
.myroots-grid .mr-card-avatar-placeholder {
 align-items: center;
 background: linear-gradient(135deg, var(--bg-light) 0%, var(--border-light) 100%);
 color: var(--border);
 display: flex;
 height: 100%;
 justify-content: center;
 width: 100%;
}
.mr-card__body {
 padding: 12px;
}
.mr-card__name {
 margin: 0 0 6px;
 font-size: 0.9em;
 font-weight: 600;
 color: var(--text-dark);
}
.mr-card__dates, .mr-card__clans {
 margin: 0;
 font-size: 0.75em;
 color: var(--text-medium);
}
.mr-ap-seg-btn.is-active,
.mr-ap-ptab.is-active {
 background: var(--primary);
 border-color: var(--primary);
 color: var(--bg-white);
}

/* =================== FAMILY TREE LAYOUT =================== */
.my-roots-wrapper {
 position: relative;
 display: flex !important;
 flex-direction: row !important;
 align-items: stretch;
 /* Drzewo pod własną „Szerokość drzewa" (wyśrodkowanie liczy skrypt;
    w trybie pełnoekranowym nadpisuje to reguła :fullscreen). */
 width: min(calc(100vw - 32px), var(--mr-full-width, 1600px));
 max-width: none;
 margin: 0 auto;
 font-family: var(--mr-font, inherit);
 height: calc(100vh - 180px);
 min-height: 540px;
 max-height: 960px;
 box-sizing: border-box;
}
.my-roots-tree-container {
 flex: 5 1 0% !important;
 height: calc(100vh - 180px) !important;
 min-height: 540px;
 max-height: 960px;
 position: relative;
 background: var(--bg-light);
 border: 1px solid var(--border);
 border-top-left-radius: var(--radius);
 border-bottom-left-radius: var(--radius);
 overflow: hidden;
 touch-action: none;
 user-select: none;
 min-width: 0;
}
html.mr-map-pseudo-fs-lock {
 overflow: hidden;
}
#myRootsMapContainer.mr-map-pseudo-fs {
 position: fixed !important;
 inset: 0 !important;
 width: 100vw !important;
 height: 100dvh !important;
 max-height: none !important;
 margin: 0 !important;
 border-radius: 0 !important;
 z-index: 99999 !important;
}
#FamilyChart {
 width: 100%;
 height: 100%;
 display: block;
}

/* =================== TREE CONTROLS — okragle kolka, pionowa kapsulka =================== */
.tree-controls {
 position: absolute;
 top: 12px;
 right: 12px;
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 5px;
 z-index: var(--z-controls);
 background: rgba(255, 255, 255, 0.97);
 backdrop-filter: blur(8px);
 -webkit-backdrop-filter: blur(8px);
 border: 1px solid var(--border);
 border-radius: 40px;
 padding: 8px 6px;
 box-shadow: var(--shadow-md);
}
.mr-view-btn {
 display: flex;
 align-items: center;
 justify-content: center;
 width: 36px;
 height: 36px;
 border-radius: 50%;
 border: 1.5px solid var(--border);
 background: transparent;
 color: var(--text-medium);
 cursor: pointer;
 transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
 padding: 0;
 flex-shrink: 0;
 font-size: 0;
 white-space: nowrap;
}
.mr-view-btn svg {
 flex-shrink: 0;
 display: block;
}
.mr-view-btn:hover {
 background: var(--primary-alpha);
 color: var(--primary);
 border-color: var(--primary);
 transform: scale(1.08);
}
.mr-view-btn.is-active,
.mr-btn-primary {
 background: var(--primary);
 border-color: var(--primary);
 color: #fff;
}
.mr-view-btn.is-active:hover,
.mr-btn-primary:hover {
 background: var(--primary-light);
 border-color: var(--primary-light);
}
.tree-controls-separator {
 width: 20px;
 height: 1px;
 background: var(--border);
 margin: 1px 0;
 flex-shrink: 0;
}

/* =================== PANEL BOCZNY DRZEWA =================== */
.my-roots-panel {
 flex: 1 0 200px !important;
 max-width: 300px !important;
 width: auto !important;
 height: 100%;
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-left: none;
 border-top-right-radius: var(--radius);
 border-bottom-right-radius: var(--radius);
 overflow-y: auto;
 display: flex !important;
 flex-direction: column;
 flex-shrink: 0;
 position: static !important;
 transform: none !important;
}
.panel-content {
 padding: 16px;
 flex: 1;
 overflow-y: auto;
}
.panel-placeholder {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 height: 100%;
 min-height: 200px;
 text-align: center;
 padding: 20px;
 color: var(--text-light);
 gap: 10px;
}
.panel-placeholder svg {
 opacity: 0.3;
}
.panel-placeholder p {
 margin: 0;
 font-size: 0.85em;
 line-height: 1.5;
}
.panel-loading {
 display: flex;
 justify-content: center;
 padding: 30px;
}
.panel-error {
 color: var(--error);
 font-size: 0.9em;
 padding: 8px 0;
}

/* =================== KARTY OSOBY W DRZEWIE =================== */
.mr-card-avatar {
 position: relative;
 overflow: hidden;
 border-radius: var(--radius) var(--radius) 0 0;
}
.mr-card-avatar img,
.person-hero__photo img,
.myroots-grid .mr-card-avatar img {
 display: block;
 height: 100%;
 object-fit: cover;
 width: 100%;
}
.mr-card-avatar-placeholder {
 width: 100%;
 height: 100%;
 display: flex;
 align-items: center;
 justify-content: center;
 background: var(--primary-alpha, rgba(33, 57, 81, 0.08));
 color: var(--primary, #213951);
 opacity: 0.55;
}
.mr-card-date {
 font-size: 0.7em;
 line-height: 1.4;
 display: flex;
 align-items: center;
 gap: 3px;
}
.mr-card-date svg {
 flex-shrink: 0;
 vertical-align: middle;
}
.mr-birth {
 color: var(--ev-birth, #c8814a);
}
.mr-death {
 color: var(--text-medium, #777);
}
.mr-card-actions {
 position: absolute;
 top: 5px;
 right: 5px;
 display: flex;
 flex-direction: column;
 gap: 3px;
 z-index: 20;
}
.mr-card-btn {
 display: flex;
 align-items: center;
 justify-content: center;
 width: 24px;
 height: 24px;
 border-radius: 50%;
 border: 1.5px solid rgba(255, 255, 255, 0.9);
 background: var(--primary-soft);
 color: #fff;
 cursor: pointer;
 transition: background 0.15s, transform 0.12s;
 padding: 0;
 box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
 flex-shrink: 0;
}
.mr-card-btn:hover {
 background: var(--primary);
 transform: scale(1.15);
 border-color: #fff;
}
.mr-card-btn svg {
 pointer-events: none;
 display: block;
}
.mr-card-add {
 background: var(--accent-soft);
}
.mr-card-add:hover {
 background: var(--accent);
}
.mr-card-body {
 padding: 8px 10px;
 flex: 1;
 min-height: 0;
 overflow: hidden;
}
.mr-card-name {
 margin: 0 0 3px;
 font-size: 0.8em;
 font-weight: 600;
 color: var(--text-dark);
 line-height: 1.3;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.mr-card-dates,
.myroots-grid .mr-card-dates {
 display: flex;
 flex-direction: column;
 gap: 2px;
}

/* =================== SPINNER =================== */
.tree-loading {
 position: absolute;
 inset: 0;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 background: var(--bg-overlay);
}
.tree-loading .spinner, .panel-loading .spinner {
 width: 40px;
 height: 40px;
 border: 3px solid var(--border);
 border-top-color: var(--primary);
 border-radius: 50%;
 animation: spin 0.8s linear infinite;
}

/* =================== MODALE — wspólna baza =================== */

/* .mr-modal-overlay  = modal z JS (dodaj relację)              */

/* .myroots-modal     = modal z HTML (dodaj osobę z drzewa)     */
.mr-modal-overlay, .myroots-modal {
 position: fixed !important;
 inset: 0;
 background: rgba(0, 0, 0, 0.65);
 backdrop-filter: blur(4px);
 -webkit-backdrop-filter: blur(4px);
 display: flex;
 align-items: center;
 justify-content: center;
 z-index: var(--z-modal);
}
.mr-modal-overlay {
 opacity: 0;
 transition: opacity 0.22s ease;
 pointer-events: none;
}
.mr-modal-overlay.show {
 opacity: 1;
 pointer-events: auto;
}
.myroots-modal {
 display: none;
 animation: fadeIn 0.25s ease;
}
.myroots-modal.show {
 display: flex;
}
.mr-modal, .myroots-modal-content {
 background: var(--bg-white);
 border-radius: var(--radius-lg);
 width: 90vw;
 max-width: 520px;
 max-height: 88vh;
 overflow-y: auto;
 box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
 position: relative;
 transform: translatey(-16px);
 transition: transform 0.22s ease;
 animation: slideIn 0.25s ease forwards;
}
.mr-modal-overlay.show .mr-modal {
 transform: translatey(0);
}
.mr-modal-header, .myroots-modal-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 20px 24px 16px;
 border-bottom: 1px solid var(--border);
 position: sticky;
 top: 0;
 background: var(--bg-white);
 z-index: 1;
 border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.mr-modal-header h2, .myroots-modal-header h2 {
 margin: 0;
 font-size: 1.1em;
 color: var(--primary);
}
.mr-modal-close, .myroots-modal-close {
 background: none;
 border: none;
 font-size: 22px;
 cursor: pointer;
 color: var(--text-medium);
 line-height: 1;
 padding: 4px 8px;
 border-radius: var(--radius-sm);
 transition: var(--transition);
 display: flex;
 align-items: center;
 justify-content: center;
}
.mr-modal-close:hover, .myroots-modal-close:hover {
 background: var(--bg-light);
 color: var(--text-dark);
}
.mr-modal-body, .myroots-modal-body {
 padding: 20px 24px;
}
.mr-modal-footer {
 display: flex;
 gap: 10px;
 justify-content: flex-end;
 padding-top: 16px;
 border-top: 1px solid var(--border);
}

/* ── Modal pełnej edycji osoby (front-end, w panelu drzewa) ── */
.mr-modal--wide {
 max-width: 920px;
}
.mr-edit-modal-overlay .mr-modal-footer {
 position: sticky;
 bottom: 0;
 padding: 14px 24px;
 margin-top: 0;
 background: var(--bg-white);
 z-index: 2;
 border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.mr-edit-modal-overlay #mrEditPersonForm {
 padding: 18px 24px;
}
.mr-edit-modal-overlay .panel-loading {
 display: flex;
 justify-content: center;
 padding: 40px 0;
}
.mr-main-photo-field {
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 12px 14px;
 margin: 0 0 16px;
 background: var(--bg-light);
}
.mr-main-photo-label {
 margin: 0 0 8px;
}
.mr-main-photo-preview {
 margin: 0 0 8px;
}
.mr-main-photo-preview img {
 max-width: 120px;
 height: auto;
 border-radius: var(--radius-sm);
 border: 1px solid var(--border);
 display: block;
}

/* Przyciski metaboksu (klasa WP .button) w modalu → wygląd spójny z .mr-btn. */
.mr-edit-modal-overlay .button,
.mr-edit-modal-overlay .button-secondary {
 display: inline-block;
 padding: 8px 16px;
 border-radius: var(--radius-sm);
 font-size: 13px;
 font-weight: 500;
 line-height: 1.4;
 cursor: pointer;
 border: 1px solid var(--border);
 background: var(--bg-white);
 color: var(--text-dark);
 text-decoration: none;
 box-shadow: none;
 transition: var(--transition);
 margin: 2px 0;
}
.mr-edit-modal-overlay .button:hover,
.mr-edit-modal-overlay .button-secondary:hover {
 background: var(--bg-light);
 border-color: var(--primary);
 color: var(--text-dark);
}
.mr-edit-modal-overlay .button-primary {
 background: var(--primary);
 border-color: var(--primary);
 color: #fff;
}
.mr-edit-modal-overlay .button-primary:hover {
 background: var(--primary-light);
 border-color: var(--primary-light);
 color: #fff;
}
/* Przyciski „Usuń" — subtelnie destrukcyjne. */
.mr-edit-modal-overlay .myroots-remove-item,
.mr-edit-modal-overlay .mr-main-photo-remove,
.mr-edit-modal-overlay .mr-event-image-remove {
 color: #b32d2e;
 border-color: #e6b3b3;
}
.mr-edit-modal-overlay .myroots-remove-item:hover,
.mr-edit-modal-overlay .mr-main-photo-remove:hover,
.mr-edit-modal-overlay .mr-event-image-remove:hover {
 background: #fbeaea;
 border-color: #b32d2e;
 color: #b32d2e;
}

/* Etykiety i nagłówki w modalu — mniejsze i spójne (nadpisuje style motywu). */
.mr-edit-modal-overlay #mrEditPersonForm label,
.mr-edit-modal-overlay #mrEditPersonForm .mr-main-photo-label {
 font-size: 13px;
 font-weight: 500;
 line-height: 1.45;
 color: var(--text-medium);
}
.mr-edit-modal-overlay #mrEditPersonForm h2,
.mr-edit-modal-overlay #mrEditPersonForm h3,
.mr-edit-modal-overlay #mrEditPersonForm h4 {
 font-size: 14px;
 font-weight: 600;
 line-height: 1.3;
 margin: 14px 0 8px;
 color: var(--primary);
}
.mr-edit-modal-overlay #mrEditPersonForm legend {
 font-size: 13px;
 font-weight: 600;
 color: var(--text-medium);
}
.mr-edit-modal-overlay .myroots-tab-btn {
 font-size: 13px;
}

/* Tabele pól (.form-table) — etykiety do lewej (domyślny <th> centruje). */
.mr-edit-modal-overlay #mrEditPersonForm .form-table th,
.mr-edit-modal-overlay #mrEditPersonForm .form-table td {
 text-align: left;
 vertical-align: top;
}
.mr-edit-modal-overlay #mrEditPersonForm .form-table th {
 width: 170px;
 padding: 10px 14px 10px 0;
 font-weight: 600;
}
.mr-edit-modal-overlay #mrEditPersonForm .form-table td {
 padding: 8px 0;
}
.mr-form-row {
 margin-bottom: 14px;
}
.mr-form-row label {
 display: block;
 font-size: 0.85em;
 font-weight: 500;
 color: var(--text-medium);
 margin-bottom: 5px;
}
.mr-form-row input, .mr-form-row select {
 width: 100%;
 padding: 9px 12px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 font-size: 14px;
 transition: var(--transition);
 box-sizing: border-box;
 background: var(--bg-white);
 color: var(--text-dark);
}
.mr-checkboxes,
.person-hero__pills,
.mr-ap-shadow-grid {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
}
.mr-checkbox-label {
 display: flex;
 align-items: center;
 gap: 6px;
 font-size: 13px;
 cursor: pointer;
}
.mr-no-options {
 font-size: 13px;
 color: var(--text-light);
 margin: 0;
}
.mr-btn {
 padding: 9px 20px;
 border-radius: var(--radius-sm);
 font-size: 14px;
 font-weight: 500;
 cursor: pointer;
 border: 1px solid var(--border);
 background: var(--bg-white);
 color: var(--text-dark);
 transition: var(--transition);
}
.mr-btn:hover {
 background: var(--bg-light);
}

/* =================== POWIADOMIENIA =================== */
.mr-notification {
 position: fixed;
 bottom: 24px;
 right: 24px;
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 14px 20px;
 box-shadow: var(--shadow-lg);
 display: flex;
 align-items: center;
 gap: 12px;
 z-index: var(--z-modal);
 transform: translatey(20px);
 opacity: 0;
 transition: transform 0.25s ease, opacity 0.25s ease;
 max-width: 380px;
}
.mr-notification.show {
 transform: translatey(0);
 opacity: 1;
}
.mr-notification--success {
 border-left: 4px solid var(--success);
}
.mr-notification--error {
 border-left: 4px solid var(--error);
}
.mr-notification--info {
 border-left: 4px solid #3498db;
}
.mr-notification-close {
 background: none;
 border: none;
 cursor: pointer;
 color: var(--text-light);
 font-size: 18px;
 padding: 0;
 line-height: 1;
 flex-shrink: 0;
}

/* =================== PROFIL OSOBY =================== */
.single-person .entry-meta, .single-person .post-meta, .single-person .byline, .single-person .posted-on, .single-person .updated:not(.published), .single-person .author.vcard, .single-person .post-author, .single-person .entry-footer, .single-person .cat-links, .single-person .tags-links, .single-person .post-categories, .single-person .post-tags, .single-person .post-thumbnail, .single-person .featured-image, .single-person .wp-post-image, .single-person figure.post-thumbnail, .single-person .ast-single-post-order .featured-section, .single-person .post-header .post-meta {
 display: none !important;
}
.single-person .entry-title, .single-person .page-title, .single-person h1.entry-title, .single-person .post-title, .single-person header.entry-header h1, .single-person header.entry-header h2 {
 display: none !important;
}
.person-toolbar {
 display: flex;
 justify-content: space-between;
 align-items: center;
 flex-wrap: wrap;
 gap: 10px;
 margin-bottom: 20px;
}
.mr-toolbar-btn {
 display: inline-flex !important;
 align-items: center !important;
 gap: 7px !important;
 height: 36px !important;
 padding: 0 20px !important;
 border-radius: var(--radius-sm, 6px) !important;
 font-size: 13px !important;
 font-weight: 500 !important;
 line-height: 1 !important;
 cursor: pointer !important;
 border: 1px solid var(--border, #d0d5dc) !important;
 background: var(--bg-white, #fff) !important;
 color: var(--text-dark, #374151) !important;
 text-decoration: none !important;
 font-family: inherit !important;
 box-sizing: border-box !important;
 white-space: nowrap !important;
 -webkit-appearance: none !important;
 appearance: none !important;
}
.mr-toolbar-btn:hover {
 border-color: var(--primary, #213951) !important;
 color: var(--primary, #213951) !important;
 background: var(--bg-light, #f6f8fa) !important;
 text-decoration: none !important;
}
.person-hero {
 display: flex;
 align-items: flex-start;
 gap: 28px;
 background: var(--bg-white);
 border: 1px solid var(--border-light);
 border-radius: var(--radius-lg);
 padding: 28px;
 margin-bottom: 28px;
}
.person-hero__photo {
 flex-shrink: 0;
 width: 160px;
 height: 200px;
 border-radius: var(--radius);
 overflow: hidden;
 background: var(--bg-light);
 box-shadow: none;
 border: 1px solid var(--border);
}
.person-hero__photo-link {
 display: block;
 width: 100%;
 height: 100%;
 cursor: zoom-in;
}
.person-hero__photo-link img {
 width: 100%;
 height: 100%;
 object-fit: cover;
}
.person-hero__info {
 flex: 1;
 min-width: 0;
 display: flex;
 flex-direction: column;
 justify-content: center;
 gap: 14px;
}
.person-hero__name {
 font-size: 2.2em;
 font-weight: var(--heading-weight, 300);
 color: var(--primary);
 margin: 0;
 line-height: 1.2;
 word-break: break-word;
}
.person-hero__pill {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 font-size: 0.7em;
 color: var(--text-medium);
 background: var(--bg-light);
 border: 1px solid var(--border);
 border-radius: 20px;
 padding: 4px 12px;
 white-space: nowrap;
}
.person-hero__pill--birth {
 background: var(--accent-xlight);
 border-color: var(--accent);
 color: var(--primary);
}
.person-hero__pill--death {
 background: rgba(0, 0, 0, 0.05);
 border-color: var(--ev-death);
 color: var(--text-medium);
}
.person-hero__pill--clan {
 background: var(--primary-alpha);
 border-color: var(--primary);
 color: var(--primary);
 font-weight: 500;
}
.person-hero__panel-link {
 display: none;
 align-items: center;
 gap: 6px;
 font-size: 0.9em;
 color: var(--primary);
 text-decoration: none;
 font-weight: 500;
 transition: var(--transition);
 margin-top: 4px;
}
.person-hero__panel-link:hover,
.person-table td a:hover,
.event-person a:hover {
 color: var(--primary-light);
 text-decoration: underline;
}
.person-description {
 margin-bottom: 40px;
 line-height: 1.6;
 color: var(--text-medium);
 font-size: 14px;
}
.person-section {
 background: var(--bg-white);
 border: 1px solid var(--border-light);
 border-radius: var(--radius);
 padding: 25px;
 margin-bottom: 24px;
}
.section-title {
 margin: 0 0 16px;
 color: var(--primary);
 font-family: var(--mr-font, inherit);
 font-size: 16px;
 font-weight: 600;
 border-bottom: 1px solid var(--primary-alpha);
 padding-bottom: 10px;
}
.person-table {
 width: 100%;
 border-collapse: collapse;
 margin-bottom: 20px;
 font-size: 14px;
}
.person-table th, .person-table td {
 padding: 12px;
 text-align: left;
 font-size: 14px;
}
.person-table th {
 width: 38%;
 color: var(--text-medium);
 font-weight: 600;
 background: var(--bg-light);
}
.person-table td {
 color: var(--text-dark);
}
.person-table td a {
 color: var(--primary);
 text-decoration: none;
 transition: var(--transition);
}
.person-table tr:hover {
 background: var(--bg-light);
}
.person-content-wrapper {
 display: grid;
 grid-template-columns: 3fr 2fr;
 gap: 30px;
 align-items: start;
 max-width: var(--mr-content-width, 1200px);
 margin: 0 auto;
}

/* =================== STATYSTYKI =================== */

/* =================== STATYSTYKI (redesign) =================== */
.mr-stats-filters {
 align-items: center;
}
.mr-stats-filter-label {
 font-size: 14px;
 color: var(--text-medium);
 font-weight: 500;
}
.mr-stats-filters select {
 flex: 0 0 auto;
 min-width: 200px;
}
.mr-stats-cards {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
 gap: 16px;
 margin-bottom: 28px;
}
.mr-stat-card {
 position: relative;
 display: flex;
 flex-direction: column;
 align-items: flex-start;
 gap: 4px;
 background: var(--bg-white);
 border: 1px solid var(--border-light);
 border-radius: var(--radius-lg);
 padding: 20px;
 box-shadow: var(--shadow-sm);
 transition: var(--transition);
 overflow: hidden;
}
.mr-stat-card::before {
 content: "";
 position: absolute;
 left: 0;
 top: 0;
 bottom: 0;
 width: 4px;
 background: var(--accent);
 opacity: 0.9;
}
.mr-stat-card:hover {
 box-shadow: var(--shadow-md);
 transform: translatey(-3px);
 border-color: var(--accent);
}
.mr-stat-card--wide {
 grid-column: span 2;
}
.mr-stat-card__icon {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 38px;
 height: 38px;
 border-radius: 50%;
 background: var(--accent-xlight);
 color: var(--accent);
 margin-bottom: 6px;
}
.mr-stat-card__value {
 font-size: 1.8em;
 font-weight: 600;
 color: var(--primary);
 line-height: 1.1;
 word-break: break-word;
}
.mr-stat-card__value small {
 font-size: 0.5em;
 color: var(--text-light);
 font-weight: 500;
}
.mr-stat-card__label {
 font-size: 0.78em;
 color: var(--text-medium);
 font-weight: 500;
}
.mr-stat-card--wide .mr-stat-card__value {
 font-size: 1.15em;
}
.mr-stats-lists {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
 gap: 20px;
 margin-bottom: 24px;
}
.mr-stats-panel {
 background: var(--bg-white);
 border: 1px solid var(--border-light);
 border-radius: var(--radius-lg);
 box-shadow: var(--shadow-sm);
 overflow: hidden;
 display: flex;
 flex-direction: column;
}
.mr-stats-panel__head {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 16px 20px;
 border-bottom: 1px solid var(--border-light);
 color: var(--primary);
}
.mr-stats-panel__head h3 {
 margin: 0;
 font-size: 1em;
 font-weight: 600;
 border: none;
 padding: 0;
}
.mr-stats-panel__head .mr-stats-icon {
 color: var(--accent);
 flex-shrink: 0;
}
.mr-stats-panel__body {
 padding: 20px;
}
.mr-stats-rank {
 list-style: none;
 margin: 0;
 padding: 0;
 display: flex;
 flex-direction: column;
 gap: 12px;
}
.mr-stats-rank__row {
 display: grid;
 grid-template-columns: minmax(80px, 30%) 1fr auto;
 align-items: center;
 gap: 12px;
}
.mr-stats-rank__label {
 font-size: 0.86em;
 color: var(--text-dark);
 font-weight: 500;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.mr-stats-rank__track {
 height: 8px;
 background: var(--bg-light);
 border-radius: 20px;
 overflow: hidden;
}
.mr-stats-rank__bar {
 display: block;
 height: 100%;
 background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
 border-radius: 20px;
 transition: width 0.4s ease;
}
.mr-stats-rank__bar--death,
.mr-stats-rank__bar--age {
 background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
}
.mr-stats-rank__bar--birth,
.mr-stats-rank__bar--name {
 background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
}
.mr-stats-rank__count {
 font-size: 0.86em;
 font-weight: 600;
 color: var(--primary);
 min-width: 24px;
 text-align: right;
}
.mr-stats-empty {
 color: var(--text-light);
 font-size: 0.9em;
 text-align: center;
 padding: 30px 0;
}

/* =================== MAPA =================== */
[id^="myRootsMap"] {
 width: 100%;
 height: 500px;
 border-radius: var(--radius);
 border: 1px solid var(--border);
 box-shadow: var(--shadow-sm);
 background: var(--map-bg);
}
.mr-inline-map {
 width: 100%;
 height: 300px;
 border-radius: var(--radius);
 border: 1px solid var(--border);
 background: var(--map-bg);
 overflow: hidden;
}
.leaflet-tile-pane {
 filter: var(--map-tile-filter, grayscale(100%) contrast(0.9) brightness(1.05));
}
.leaflet-overlay-pane {
 position: relative;
}
.leaflet-overlay-pane::after {
 content: "";
 position: absolute;
 left: -3000px;
 top: -3000px;
 width: 8000px;
 height: 8000px;
 background: var(--map-overlay-color, transparent);
 opacity: 0.4;
 pointer-events: none;
}
.leaflet-container {
 cursor: default !important;
}
.leaflet-grab {
 cursor: grab !important;
}
.leaflet-dragging .leaflet-grab, .leaflet-dragging .leaflet-grab * {
 cursor: grabbing !important;
}
.leaflet-marker-icon, .leaflet-marker-shadow {
 cursor: pointer !important;
}
.mr-tree-search {
 position: absolute;
 top: 12px;
 left: 50%;
 transform: translatex(-50%);
 z-index: 20;
 display: flex;
 align-items: center;
 gap: 6px;
 background: var(--bg-white, #fff);
 border: 1px solid var(--border, #dde1e7);
 border-radius: 24px;
 padding: 6px 10px 6px 12px;
 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
 transition: box-shadow 0.15s, border-color 0.15s;
 width: min(300px, 42%);
}
.mr-tree-search:focus-within {
 box-shadow: 0 2px 14px rgba(0, 0, 0, 0.15);
 border-color: var(--accent, #6b8cba);
}
.mr-tree-search > svg {
 flex-shrink: 0;
 opacity: 0.4;
}
.mr-tree-search input {
 border: none;
 outline: none;
 background: transparent;
 font-size: 0.85rem;
 width: 100%;
 color: var(--text, #1a1a2e);
 min-width: 0;
}
.mr-tree-search input::placeholder {
 opacity: 0.5;
}
.mr-tree-search-clear {
 background: none;
 border: none;
 cursor: pointer;
 font-size: 1.1rem;
 line-height: 1;
 padding: 0 2px;
 color: var(--text-muted, #999);
 flex-shrink: 0;
}
.mr-tree-search-clear:hover {
 color: var(--text, #1a1a2e);
}
.mr-tree-search-results {
 display: none;
 position: absolute;
 top: calc(100% + 6px);
 left: 0;
 right: 0;
 background: var(--bg-white, #fff);
 border: 1px solid var(--border, #dde1e7);
 border-radius: 12px;
 box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
 list-style: none;
 margin: 0;
 padding: 4px 0;
 max-height: 320px;
 overflow-y: auto;
 z-index: 100;
}
.mr-search-item {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
 padding: 8px 14px;
 cursor: pointer;
 font-size: 0.85rem;
 transition: background 0.1s;
 border-radius: 8px;
 margin: 2px 4px;
}
.mr-search-item:hover, .mr-search-item.is-active {
 background: var(--bg-hover, #f0f4f9);
}
.mr-search-name {
 flex: 1;
 min-width: 0;
 font-weight: 500;
}
.mr-search-name mark {
 background: none;
 color: var(--accent, #6b8cba);
 font-weight: 700;
}
.mr-search-meta {
 font-size: 0.78rem;
 color: var(--text-muted, #888);
 flex-shrink: 0;
}
.mr-search-empty {
 padding: 10px 14px;
 font-size: 0.85rem;
 color: var(--text-muted, #888);
 text-align: center;
}
.my-roots-map-wrapper {
 /* Mapa pod globalną „Szerokość treści" (wyśrodkowanie liczy skrypt). */
 width: min(calc(100vw - 32px), var(--mr-content-width, 1200px));
 max-width: none;
 margin: 20px auto;
}
.leaflet-popup-content-wrapper {
 border-radius: var(--radius) !important;
 box-shadow: var(--shadow-md) !important;
 border: 1px solid var(--border);
 font-family: var(--mr-font, inherit);
}
.leaflet-popup-content {
 margin: 12px 15px;
 font-size: 13px;
 line-height: 1.5;
 color: var(--text-dark);
 font-family: inherit;
}
.leaflet-popup-content h3, .leaflet-popup-content h4 {
 margin: 0 0 8px;
 color: var(--primary);
 font-size: 1em;
 font-weight: 600;
 border-bottom: 1px solid var(--border-light);
 padding-bottom: 5px;
}
.leaflet-popup-content strong {
 color: var(--primary);
}
.leaflet-popup-tip {
 background: #fff !important;
}
.leaflet-control-zoom a {
 color: var(--primary) !important;
}
.leaflet-control-zoom a:hover {
 background: var(--primary-alpha) !important;
}
.event-header-body,
.mr-map-popup__meta,
.mr-ap-color-meta {
 flex: 1;
 min-width: 0;
}

/* ===== Mapa globalna — pasek filtrów (ród + osoba) ===== */
.mr-map-filters {
 align-items: center;
}
.mr-map-filters[hidden] {
 display: none;
}
.mr-map-filter-label {
 font-size: 14px;
 color: var(--text-medium);
 font-weight: 500;
}
.mr-map-filters .mr-map-filter-select {
 flex: 0 1 220px;
 min-width: 160px;
}
.mr-map-filter-reset {
 flex: 0 0 auto;
 padding: 9px 14px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 background: var(--bg-white);
 font-size: 14px;
 color: var(--text-medium);
 cursor: pointer;
 transition: var(--transition);
}
.mr-map-filter-reset:hover {
 border-color: var(--primary);
 color: var(--primary);
}
.mr-map-filter-reset:focus {
 border-color: var(--primary);
 box-shadow: 0 0 0 2px var(--primary-alpha);
 outline: none;
}
.mr-map-filter-empty {
 flex: 1 1 100%;
 font-size: 13px;
 color: var(--text-medium);
 font-style: italic;
}
.mr-map-filter-empty[hidden] {
 display: none;
}

/* =================== LIFELINE =================== */
.myroots-person-selector, .person-selector {
 width: 100%;
 padding: 10px 14px;
 border: 1px solid var(--border);
 border-radius: var(--radius);
 background: var(--bg-white);
 color: var(--text-dark);
 font-size: 1em;
 font-family: var(--mr-font, inherit);
 margin-bottom: 28px;
 cursor: pointer;
 transition: var(--transition);
 appearance: none;
 -webkit-appearance: none;
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
 background-repeat: no-repeat;
 background-position: right 14px center;
 padding-right: 36px;
}
.myroots-person-selector:hover, .person-selector:hover {
 border-color: var(--primary);
}
input.myroots-person-selector {
 background-image: none;
 padding-right: 14px;
 cursor: text;
}
.myroots-lifeline-search {
 position: relative;
 margin-bottom: 28px;
}
.myroots-lifeline-search-box {
 position: relative;
 display: flex;
 align-items: center;
 gap: 8px;
 border: 1px solid var(--border);
 border-radius: var(--radius);
 background: var(--bg-white);
 padding: 0 12px;
 transition: var(--transition);
}
.myroots-lifeline-search-box:focus-within {
 border-color: var(--primary);
 box-shadow: 0 0 0 2px var(--primary-alpha);
}
.myroots-lifeline-search-icon {
 flex-shrink: 0;
 color: var(--text-medium);
}
.myroots-lifeline-search input.myroots-person-selector {
 flex: 1;
 min-width: 0;
 width: auto;
 border: none;
 background: transparent;
 background-image: none;
 box-shadow: none;
 margin: 0;
 padding: 11px 0;
 padding-right: 0;
 cursor: text;
 font-size: 1em;
}
.myroots-lifeline-search input.myroots-person-selector:focus {
 outline: none;
 box-shadow: none;
 border: none;
}
.myroots-lifeline-search-clear {
 flex-shrink: 0;
 background: none;
 border: none;
 cursor: pointer;
 font-size: 1.4rem;
 line-height: 1;
 padding: 0 2px;
 color: var(--text-medium);
}
.myroots-lifeline-search-clear:hover {
 color: var(--text-dark);
}
.myroots-lifeline-results {
 display: none;
}
.myroots-lifeline {
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 30px;
 min-height: 400px;
}
#myroots-lifeline-output {
 margin-top: 24px;
}
.myroots-loading {
 color: var(--text-medium);
 font-style: italic;
 padding: 20px 0;
}
.myroots-no-events {
 color: var(--text-medium);
 text-align: center;
 padding: 30px;
}
.lifeline-timeline {
 position: relative;
 padding: 40px 0;
 overflow: hidden;
}
.lifeline-timeline:before {
 content: "";
 position: absolute;
 left: 50%;
 top: 0;
 bottom: 0;
 width: 1px;
 background: var(--primary-alpha);
 transform: translatex(-50%);
 z-index: 0;
}
.timeline-event {
 position: relative;
 width: 45%;
 margin-bottom: 30px;
 clear: both;
}
.timeline-event.left {
 float: left;
}
.timeline-event.right {
 float: right;
}
.event-content {
 background: var(--bg-white);
 padding: 20px;
 border-radius: var(--radius);
 border: 1px solid var(--border);
 box-shadow: var(--mr-shadow, var(--shadow-sm));
}
.event-birth .event-content {
 border-left: 4px solid var(--ev-birth);
}
.event-death .event-content {
 border-left: 4px solid var(--ev-death);
}
.event-marriage .event-content {
 border-left: 4px solid var(--ev-marriage);
}
.event-marriage-end .event-content {
 border-left: 4px solid var(--ev-end);
}
.event-life-event .event-content, .event-default .event-content {
 border-left: 4px solid var(--ev-event);
}
.event-dot {
 position: absolute;
 width: 20px;
 height: 3px;
 border-radius: 2px;
 top: 50%;
 transform: translatey(-50%);
 z-index: 1;
 background: var(--ev-neutral);
 border: none;
}
.left .event-dot {
 left: calc(111.11% - 10px);
 right: auto;
}
.right .event-dot {
 left: calc(-11.11% - 10px);
 right: auto;
}
.person-profile .left .event-dot {
 left: calc(111.11% - 10px);
 right: auto;
}
.person-profile .right .event-dot {
 left: calc(-11.11% - 10px);
 right: auto;
}
.person-profile .lifeline-timeline:before {
 left: 20px;
 transform: none;
}
.person-profile .timeline-event {
 width: calc(100% - 50px);
 float: none !important;
 margin-left: 50px;
 margin-bottom: 20px;
}
.person-profile .event-dot {
 left: -40px !important;
 right: auto !important;
}
.event-birth .event-dot {
 background: var(--ev-birth);
}
.event-marriage .event-dot {
 background: var(--ev-marriage);
}
.event-death .event-dot {
 background: var(--ev-death);
}
.event-marriage-end .event-dot {
 background: var(--ev-end);
}
.event-life-event .event-dot, .event-default .event-dot {
 background: var(--ev-event);
}
.event-date {
 color: var(--text-medium);
 font-size: 14px;
 margin-bottom: 6px;
}
.event-title {
 font-size: 15px;
 font-weight: 500;
 margin-bottom: 4px;
 color: var(--text-dark);
 display: block;
 align-items: center;
 gap: 6px;
}
.event-person-link {
 color: var(--primary);
 font-weight: 600;
 text-decoration: none;
 border-bottom: 1px solid var(--accent-alpha);
 transition: var(--transition);
}
.event-person-link:hover {
 color: var(--accent);
 border-bottom-color: var(--accent);
}
.event-icon {
 display: inline-flex;
 align-items: center;
 flex-shrink: 0;
 color: currentColor;
}
.event-place {
 font-size: 13px;
 color: var(--text-medium);
 margin-top: 6px;
 display: flex;
 align-items: center;
 gap: 4px;
}
.event-description {
 margin-top: 8px;
 padding: 10px;
 background: var(--bg-light);
 border-radius: var(--radius-sm);
 font-size: 14px;
 line-height: 1.6;
}
.event-description-wrap {
 margin-top: 10px;
}
.event-header {
 display: flex;
 align-items: flex-start;
 gap: 12px;
 margin-bottom: 4px;
}
.event-person-photo {
 width: 44px;
 height: 44px;
 border-radius: 50%;
 object-fit: cover;
 flex-shrink: 0;
 border: 2px solid var(--border-light);
 display: block;
}
.event-person-photo-link {
 flex-shrink: 0;
 display: block;
}
.event-person-photo-link .event-person-photo {
 transition: opacity 0.15s;
}
.event-person-photo-link:hover .event-person-photo {
 opacity: 0.8;
}
.show-description {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 background: var(--bg-light);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 padding: 6px 12px;
 margin-top: 10px;
 cursor: pointer;
 transition: var(--transition);
 font-size: 14px;
 color: var(--text-medium);
}
.show-description:hover {
 background: var(--border-light);
}

/* =================== GALERIA =================== */
.gallery-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
 gap: 20px;
 margin: 20px 0;
}
.gallery-item {
 position: relative;
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 overflow: hidden;
 transition: var(--transition);
 cursor: pointer;
}
.gallery-item:hover {
 transform: translatey(-2px);
 box-shadow: var(--shadow-md);
}
.gallery-item img {
 width: 100%;
 height: 200px;
 object-fit: cover;
 transition: transform 0.3s ease;
}
.gallery-item:hover img {
 transform: scale(1.05);
}
.gallery-caption {
 padding: 8px 10px;
 font-size: 0.85em;
 color: var(--text-medium);
 text-align: center;
}

/* =================== SELECT2 =================== */
.select2-container {
 margin-bottom: 30px;
}
.select2-container--default .select2-selection--single {
 height: 48px;
 border: 1px solid var(--border);
 border-radius: var(--radius);
 background-color: var(--bg-white);
 transition: var(--transition);
}
.select2-container--default .select2-selection--single:hover {
 border-color: var(--primary);
}
.select2-container--default.select2-container--focus .select2-selection--single, .select2-container--default.select2-container--open .select2-selection--single {
 border-color: var(--primary);
 box-shadow: 0 0 0 1px var(--primary);
}
.select2-container .select2-selection--single .select2-selection__rendered {
 line-height: 46px;
 padding-left: 15px;
 padding-right: 35px;
 color: var(--text-dark);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
 color: var(--text-medium);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
 height: 46px;
 width: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
 border-color: var(--text-medium) transparent transparent transparent;
 border-style: solid;
 border-width: 5px 4px 0 4px;
 height: 0;
 left: 50%;
 margin-left: -4px;
 margin-top: -2px;
 position: absolute;
 top: 50%;
 width: 0;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
 border-color: transparent transparent var(--text-medium) transparent;
 border-width: 0 4px 5px 4px;
}
.select2-dropdown {
 background: var(--bg-white);
 border: 1px solid var(--primary);
 border-radius: 0 0 var(--radius) var(--radius);
 box-shadow: var(--shadow-md);
 /* Ponad modalem edycji (--z-modal: 99999), bo Select2 dopina listę do <body>. */
 z-index: 100001;
 margin-top: -1px;
}
/* Otwarty kontener Select2 (dopinany do <body>) musi być nad nakładką modala. */
.select2-container--open {
 z-index: 100001;
}
.select2-search--dropdown {
 display: block;
 padding: 8px;
 background: var(--bg-white);
}
.select2-search--dropdown .select2-search__field {
 width: 100%;
 box-sizing: border-box;
 padding: 8px 12px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 font-size: 14px;
 outline: none;
 background: var(--bg-white);
 font-family: inherit;
}
.select2-search--dropdown .select2-search__field:focus {
 border-color: var(--primary);
 box-shadow: inset 0 0 0 1px var(--primary);
}
.select2-results {
 display: block;
}
.select2-results__options {
 list-style: none;
 margin: 0;
 padding: 0;
 max-height: 200px;
 overflow-y: auto;
}
.select2-results__option {
 padding: 10px 15px;
 user-select: none;
 transition: background-color 0.2s;
 cursor: pointer;
 font-size: 14px;
 color: var(--text-dark);
}
.select2-results__option--highlighted {
 background: var(--primary);
 color: var(--bg-white);
}
.select2-results__option--selected {
 background: var(--bg-light);
}
.select2-results__option--disabled {
 color: var(--text-light);
 cursor: not-allowed;
}
.select2-results__group {
 padding: 6px 15px;
 font-weight: bold;
 color: var(--text-medium);
 font-size: 12px;
 text-transform: uppercase;
}
.select2-results__message {
 padding: 10px 15px;
 color: var(--text-medium);
 font-size: 14px;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
 background-color: var(--bg-light);
 cursor: not-allowed;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
 cursor: pointer;
 float: right;
 font-weight: bold;
 margin-right: 10px;
 color: var(--text-light);
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
 color: var(--text-dark);
}

/* =================== FLATPICKR =================== */
.flatpickr-calendar {
 border-radius: var(--radius);
 box-shadow: var(--shadow-md);
}
.flatpickr-day.selected {
 background: var(--primary);
 border-color: var(--primary);
}
.flatpickr-day:hover {
 background: var(--bg-light);
}

/* =================== ADMIN METABOX =================== */
.myroots-tabs__nav {
 display: flex;
 gap: 4px;
 border-bottom: 2px solid var(--border);
 margin-bottom: 20px;
}
.myroots-tab-btn {
 background: none;
 border: none;
 padding: 10px 18px;
 cursor: pointer;
 font-size: 14px;
 font-weight: 500;
 color: var(--text-medium);
 border-bottom: 2px solid transparent;
 margin-bottom: -2px;
 transition: var(--transition);
}
.myroots-tab-btn:hover {
 color: var(--primary);
}
.myroots-tab-btn.is-active {
 color: var(--primary);
 border-bottom-color: var(--primary);
}
.myroots-clan-checks {
 display: flex;
 flex-wrap: wrap;
 gap: 12px;
}
.myroots-clan-checks label {
 display: flex;
 align-items: center;
 gap: 6px;
 font-weight: normal;
 cursor: pointer;
}
.mr-spouse-item, .mr-relation-item, .mr-event-item, .mr-gallery-item {
 background: var(--bg-light);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 padding: 16px;
 margin-bottom: 12px;
}
.mr-spouse-item h4, .mr-event-item h4 {
 margin: 0 0 12px;
 font-size: 14px;
 color: var(--text-medium);
}
canvas {
 max-height: 300px;
 border-radius: var(--radius-sm);
}
.myroots-privacy-notice {
 background: #fff8e1;
 border: 1px solid #ffe082;
 border-radius: var(--radius);
 padding: 24px;
 text-align: center;
 margin: 20px auto;
 max-width: 600px;
}
.myroots-privacy-notice h2 {
 color: var(--primary);
 font-size: 1.4em;
 margin: 0 0 10px;
}
.myroots-notice {
 padding: 16px 20px;
 border-radius: var(--radius-sm);
 margin-bottom: 20px;
}
.myroots-notice--info {
 background: #e6f4ff;
 border: 1px solid #b3d8ff;
 color: #1a3c5e;
}

/* =================== ANIMACJE =================== */
@keyframes spin {
 to {
  transform: rotate(360deg);
  }
 }
@keyframes fadeIn {
 from {
  opacity: 0;
  } to {
  opacity: 1;
  }
 }
@keyframes slideIn {
 from {
  opacity: 0;
  transform: scale(0.9) translateY(-20px);
  } to {
  opacity: 1;
  transform: scale(1) translateY(0);
  }
 }

/* =================== PANEL BOCZNY DRZEWA — nadpisania profilu =================== */
#mrPanelContent .person-profile {
 padding: 0;
}
#mrPanelContent .person-toolbar {
 display: none !important;
}
#mrPanelContent .myroots-notice {
 margin: 0 0 12px;
 font-size: 0.8em;
 padding: 10px 14px;
}
#mrPanelContent .person-hero {
 flex-direction: column;
 align-items: center;
 text-align: center;
 padding: 20px 16px 16px;
 gap: 14px;
 border-radius: var(--radius);
 margin-bottom: 16px;
}
#mrPanelContent .person-hero__photo {
 width: 100px;
 height: 125px;
}
#mrPanelContent .person-hero__info {
 gap: 10px;
}
#mrPanelContent .person-hero__name {
 font-size: 1.25em;
 font-weight: 600;
}
#mrPanelContent .person-hero__pills {
 justify-content: center;
 gap: 6px;
}
#mrPanelContent .person-hero__pill {
 font-size: 0.75em;
 padding: 3px 10px;
}
#mrPanelContent .person-hero__panel-link {
 display: inline-flex;
 justify-content: center;
}
#mrPanelContent .person-content-wrapper {
 grid-template-columns: 1fr;
 gap: 0;
 min-width: 0;
}
#mrPanelContent .person-left-column, #mrPanelContent .person-right-column, #mrPanelContent .person-content-wrapper > * {
 min-width: 0;
}
#mrPanelContent .person-content-wrapper .person-section {
 overflow-wrap: anywhere;
}
#mrPanelContent .person-content-wrapper .person-table {
 table-layout: fixed;
}
#mrPanelContent .person-content-wrapper .person-table td {
 overflow-wrap: anywhere;
}
#mrPanelContent .person-section {
 padding: 14px;
 margin-bottom: 12px;
 box-shadow: none;
}
#mrPanelContent .section-title {
 font-size: 0.95em;
 margin-bottom: 10px;
 padding-bottom: 7px;
}
#mrPanelContent .person-table th, #mrPanelContent .person-table td {
 padding: 7px 8px;
 font-size: 0.8em;
}
#mrPanelContent .person-table th {
 width: 42%;
}
#mrPanelContent [id^="myRootsMap"], #mrPanelContent .mr-inline-map {
 height: 220px;
 margin: 0;
}
#mrPanelContent .lifeline-timeline:before {
 left: 16px;
 transform: none;
}
#mrPanelContent .timeline-event {
 width: calc(100% - 40px) !important;
 float: none !important;
 margin-left: 40px !important;
 margin-bottom: 14px !important;
}
#mrPanelContent .event-dot {
 left: -34px !important;
 right: auto !important;
}
#mrPanelContent .event-content {
 padding: 12px;
}
#mrPanelContent .event-title {
 font-size: 13px;
}
#mrPanelContent .event-date {
 font-size: 12px;
}
#mrPanelContent .event-place {
 font-size: 12px;
}
#mrPanelContent .gallery-grid {
 grid-template-columns: repeat(2, 1fr);
 gap: 8px;
}
#mrPanelContent .gallery-item img {
 height: 100px;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 991px) {
 .person-content-wrapper {
  grid-template-columns: 1fr;
  gap: 20px;
 }
 .person-hero {
  padding: 20px;
  gap: 20px;
 }
 .person-hero__photo {
  width: 130px;
  height: 165px;
 }
 .person-hero__name {
  font-size: 1.8em;
 }
}
@media (max-width: 768px) {
 .myroots-grid {
  grid-template-columns: repeat(2, 1fr);
 }
 .myroots-filters {
  gap: 8px;
 }
 .mr-stats-lists, .person-content-wrapper {
  grid-template-columns: 1fr;
 }
 .person-profile {
  overflow-x: hidden;
 }
 .person-content-wrapper > *, .person-left-column, .person-right-column {
  min-width: 0;
 }
 .person-content-wrapper .person-section {
  overflow-wrap: anywhere;
 }
 .person-content-wrapper .person-table {
  table-layout: fixed;
  width: 100%;
 }
 .person-content-wrapper .person-table th {
  width: 40%;
 }
 .person-content-wrapper .person-table td {
  overflow-wrap: anywhere;
 }
 .person-hero {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  gap: 16px;
 }
 .person-hero__photo {
  width: 120px;
  height: 150px;
 }
 .person-hero__name {
  font-size: 1.6em;
 }
 .person-hero__pills {
  justify-content: center;
 }
 .person-toolbar {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
 }
 .person-toolbar .mr-toolbar-btn {
  flex: 0 0 auto;
 }
 .person-toolbar .button {
  text-align: center;
 }
 .my-roots-wrapper {
  flex-direction: column !important;
  height: auto !important;
  max-height: none !important;
 }
 .my-roots-tree-container {
  flex: none !important;
  height: 60vh !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
 }
 .my-roots-panel {
  flex: none !important;
  max-width: none !important;
  width: 100% !important;
  height: 400px !important;
  border-left: 1px solid var(--border) !important;
  border-top: none !important;
  border-radius: 0 0 var(--radius) var(--radius) !important;
 }
 [id^="myRootsMap"], .mr-inline-map {
  height: 260px;
 }
 .lifeline-timeline:before {
  left: 20px;
  transform: none;
 }
 .timeline-event {
  width: calc(100% - 50px);
  float: none !important;
  margin-left: 50px;
  margin-bottom: 20px;
 }
 .event-dot {
  left: -40px !important;
  right: auto !important;
 }
 .person-profile .event-dot {
  left: -40px !important;
 }
 .myroots-modal-content {
  max-width: 95vw;
  min-width: 280px;
 }
 .select2-container--default .select2-selection--single {
  height: 44px;
 }
 .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 42px;
 }
 .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px;
 }
}
@media (max-width: 576px) {
 .myroots-filters {
  flex-direction: column;
 }
 .myroots-filters input:not([type="checkbox"]):not([type="radio"]), .myroots-filters select, .myroots-filters .mr-gallery-search, .myroots-filters .mr-gallery-clan-filter {
  flex: 0 0 auto;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  line-height: normal;
  box-sizing: border-box;
 }
 .myroots-filters input[type="checkbox"], .myroots-filters .mr-gallery-avatars-chk {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
 }
 .myroots-filters label {
  width: auto;
 }
 .myroots-events-filters {
  flex-flow: row wrap;
 }
 .myroots-events-filters input[type="search"], .myroots-events-filters select {
  flex: 1 1 100%;
 }
 .myroots-events-timeline .myroots-filters input[type="number"] {
  flex: 1 1 0;
  width: auto !important;
  min-width: 0;
 }
 .mr-stats {
  padding: 10px;
 }
 .mr-stats-filters select {
  min-width: 0;
  width: 100%;
 }
 .mr-stat-card--wide {
  grid-column: auto;
 }
}
@media (max-width: 480px) {
 .myroots-grid {
  grid-template-columns: 1fr;
 }
 .mr-stats-cards {
  grid-template-columns: repeat(2, 1fr);
 }
 .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
 }
 .gallery-item img {
  height: 150px;
 }
}

/* =================== DRUK — patrz niżej (profil osoby) =================== */

/* =================== DOSTEPNOSC =================== */
@media (prefers-reduced-motion: reduce) {
 * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
 }
}

/* =================== FULLSCREEN — PANEL BOCZNY =================== */
.my-roots-wrapper:fullscreen {
 display: flex;
 flex-direction: row !important;
 align-items: stretch;
 width: 100vw !important;
 max-width: none !important;
 margin: 0 !important;
 height: 100vh !important;
 max-height: 100vh !important;
 min-height: 0 !important;
 background: var(--mr-bg, #f9f9f9);
}
.my-roots-wrapper:-webkit-full-screen {
 display: flex;
 flex-direction: row !important;
 align-items: stretch;
 width: 100vw !important;
 max-width: none !important;
 margin: 0 !important;
 height: 100vh !important;
 max-height: 100vh !important;
 min-height: 0 !important;
 background: var(--mr-bg, #f9f9f9);
}
.my-roots-wrapper:-moz-full-screen {
 display: flex;
 flex-direction: row !important;
 align-items: stretch;
 width: 100vw !important;
 max-width: none !important;
 margin: 0 !important;
 height: 100vh !important;
 max-height: 100vh !important;
 min-height: 0 !important;
 background: var(--mr-bg, #f9f9f9);
}
.my-roots-wrapper:fullscreen::backdrop {
 background: var(--mr-bg, #f9f9f9);
}
.my-roots-wrapper:-webkit-full-screen::backdrop {
 background: var(--mr-bg, #f9f9f9);
}
.my-roots-wrapper:-moz-full-screen::backdrop {
 background: var(--mr-bg, #f9f9f9);
}
.my-roots-wrapper:fullscreen .my-roots-tree-container {
 flex: 1 1 0%;
 height: 100vh !important;
 max-height: 100vh !important;
 min-height: 0 !important;
 border: 0 !important;
 border-radius: 0 !important;
 background: var(--bg-light) !important;
}
.my-roots-wrapper:-webkit-full-screen .my-roots-tree-container {
 flex: 1 1 0%;
 height: 100vh !important;
 max-height: 100vh !important;
 min-height: 0 !important;
 border: 0 !important;
 border-radius: 0 !important;
 background: var(--bg-light) !important;
}
.my-roots-wrapper:-moz-full-screen .my-roots-tree-container {
 flex: 1 1 0%;
 height: 100vh !important;
 max-height: 100vh !important;
 min-height: 0 !important;
 border: 0 !important;
 border-radius: 0 !important;
 background: var(--bg-light) !important;
}
.my-roots-wrapper:fullscreen #FamilyChart {
 width: 100% !important;
 height: 100vh !important;
 background: var(--bg-light) !important;
}
.my-roots-wrapper:-webkit-full-screen #FamilyChart {
 width: 100% !important;
 height: 100vh !important;
 background: var(--bg-light) !important;
}
.my-roots-wrapper:-moz-full-screen #FamilyChart {
 width: 100% !important;
 height: 100vh !important;
 background: var(--bg-light) !important;
}
.my-roots-wrapper:fullscreen .my-roots-panel {
 display: flex;
 flex-direction: column;
 width: 340px;
 height: 100vh;
 overflow-y: auto;
 background: #fff;
 box-shadow: -2px 0 12px rgba(0, 0, 0, 0.12);
}
.my-roots-wrapper:-webkit-full-screen .my-roots-panel {
 display: flex;
 flex-direction: column;
 width: 340px;
 height: 100vh;
 overflow-y: auto;
 background: #fff;
 box-shadow: -2px 0 12px rgba(0, 0, 0, 0.12);
}
.my-roots-wrapper:-moz-full-screen .my-roots-panel {
 display: flex;
 flex-direction: column;
 width: 340px;
 height: 100vh;
 overflow-y: auto;
 background: #fff;
 box-shadow: -2px 0 12px rgba(0, 0, 0, 0.12);
}

/* =================== KLIKALNE TAGI (PILLS) =================== */
.person-hero__pill--link {
 text-decoration: none;
 cursor: pointer;
 transition: opacity 0.15s, transform 0.1s;
 display: inline-flex;
 align-items: center;
 gap: 4px;
}
.person-hero__pill--link:hover {
 opacity: 0.75;
 transform: translatey(-1px);
 text-decoration: none;
}

/* =================== BIOGRAFIA (meta) =================== */
.person-biography {
 margin-bottom: 20px;
}
.person-biography .person-description {
 line-height: 1.7;
 color: var(--mr-text, #333);
}

/* =================== ADMIN BAR — edytuj osobę =================== */
#wpadminbar .myroots-adminbar-edit > .ab-item::before {
 content: "✎";
 margin-right: 4px;
}

/* =================== GHOST SPOUSE CARD =================== */
.mr-card--ghost {
 border: 2px dashed var(--border);
 background: var(--bg-light);
 opacity: 0.75;
 cursor: pointer;
 transition: var(--transition);
}
.mr-card--ghost:hover {
 opacity: 1;
 border-color: var(--primary);
 background: var(--primary-alpha);
}
.mr-card-avatar-placeholder--ghost {
 opacity: 0.35;
}
.mr-card-name--ghost {
 color: var(--primary);
 font-style: italic;
 font-size: 0.82em;
 text-align: center;
}

/* =================== LISTA OSÓB — karty ze wspólnym stylem drzewa =================== */
.myroots-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
 gap: 20px;
}
.myroots-grid .mr-card-avatar {
 width: 100%;
 height: 170px;
 overflow: hidden;
 background: var(--bg-light);
 border-radius: var(--radius) var(--radius) 0 0;
 position: relative;
}

/* --- Globalny lazy-load: szkielet + płynne pojawienie obrazów --------- */
/* .mr-lazy = dowolny pojemnik o ustalonych wymiarach, w którym obraz ma
   loading="lazy". Szkielet (::after) leży POD obrazem (z-index) i jest
   widoczny, dopóki obraz się nie wczyta. Klasę is-loaded dokłada globalny
   skrypt (window.MyRootsLazy). Bez JS obraz i tak się pokaże. */
.mr-lazy { position: relative; overflow: hidden; }
.mr-lazy.is-loading::after {
 content: "";
 position: absolute;
 inset: 0;
 z-index: 1;
 background: linear-gradient(100deg,
   var(--bg-light, #ececec) 30%,
   rgba(255, 255, 255, 0.55) 50%,
   var(--bg-light, #ececec) 70%);
 background-size: 200% 100%;
 animation: mr-skeleton 1.2s ease-in-out infinite;
}
.mr-lazy > img,
.mr-lazy > a > img {
 position: relative;
 z-index: 2;
 transition: opacity 0.35s ease;
}
@keyframes mr-skeleton {
 0%   { background-position: 200% 0; }
 100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
 .mr-lazy.is-loading::after { animation: none; }
 .mr-lazy img { transition: none; }
}

/* Pomijaj renderowanie elementów poza ekranem (duży zysk przy setkach
   pozycji); contain-intrinsic-size rezerwuje wysokość, by przewijanie było
   stabilne. Karty zostają w DOM — filtry po stronie klienta działają dalej. */
.myroots-grid .mr-card { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.gallery-grid .gallery-item { content-visibility: auto; contain-intrinsic-size: auto 200px; }

/* Dopasowania szkieletu do konkretnych miejsc */
.event-person-photo-link.mr-lazy { border-radius: 50%; }
.mr-event-image.mr-lazy.is-loading { min-height: 140px; }

/* Stronicowanie listy osób */
.mr-load-more-wrap { text-align: center; margin-top: 24px; }
.mr-list-count {
 text-align: center;
 margin: 10px 0 0;
 font-size: 0.85em;
 color: var(--text-light, #888);
}
.myroots-grid .mr-card-body {
 padding: 12px;
}
.myroots-grid .mr-card-name {
 margin: 0 0 6px;
 font-size: 0.88em;
 font-weight: 600;
 color: var(--text-dark);
}

/* =================== EVENTS TIMELINE SHORTCODE =================== */
.myroots-events-timeline .myroots-filters {
 margin-bottom: 28px;
}
.myroots-events-timeline .myroots-filters input[type="number"] {
 flex: 0 0 100px;
}
.event-person {
 font-size: 13px;
 margin-top: 4px;
}
.event-person a {
 color: var(--primary);
 font-weight: 600;
 text-decoration: none;
}
.mr-events-empty {
 text-align: center;
 padding: 40px 20px;
 color: var(--text-light);
 font-style: italic;
 font-size: 0.9em;
}
@media (max-width: 600px) {
 .myroots-events-timeline {
  padding: 12px;
 }
}

/* =================== DRUK — profil osoby =================== */
@media print {
 @page {
  size: A4 portrait;
  margin: 1.5cm 2cm;
 }
 *, *::before, *::after {
  box-shadow: none !important;
  text-shadow: none !important;
  transition: none !important;
  animation: none !important;
 }
 html, body {
  background: #fff !important;
  font-size: 10pt !important;
  color: #111 !important;
  margin: 0 !important;
  padding: 0 !important;
 }
 /* W druku moduły wypełniają obszar strony (wyśrodkowany marginesami @page);
    znosimy wyłamanie/wyśrodkowanie względem okna z widoku ekranowego. */
 .myroots-people-list, .person-profile, .mr-stats, .myroots-lifeline-container,
 .myroots-events-timeline, .myroots-kinship, .myroots-shared-gallery,
 .my-roots-map-wrapper, .myroots-bookgen {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  left: auto !important;
  transform: none !important;
 }
 #wpadminbar, nav, header, footer, .site-header, .site-footer, .widget-area, .sidebar, .wp-block-navigation, .comments-area, #comments, .navigation, .nav-links {
  display: none !important;
 }
 .myroots-no-print, .person-toolbar, .tree-controls, .my-roots-panel, .person-hero__panel-link, .myroots-tabs__nav, .mr-filter-reset, .show-description {
  display: none !important;
 }
 .person-right-column {
  display: block !important;
  width: 100% !important;
  float: none !important;
 }
 /* mapa per-osoba to żywa mapa Leaflet (inline) — nie drukuje się sensownie,
    więc w druku chowamy całą jej sekcję; linia życia powyżej drukuje się normalnie */
 .person-section--map {
  display: none !important;
 }
 .my-roots-map-wrapper, .leaflet-container {
  display: none !important;
 }
 .mr-print-header {
  display: flex !important;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1.5pt solid #213951;
  padding-bottom: 5pt;
  margin-bottom: 12pt;
  font-size: 8pt;
  color: #666;
 }
 .mr-print-header__site {
  font-size: 12pt;
  font-weight: 700;
  color: #213951;
 }
 .mr-print-header__meta {
  text-align: right;
  line-height: 1.6;
  color: #999;
  font-size: 7.5pt;
 }
 .person-profile {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
 }
 .person-hero {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  text-align: left !important;
  gap: 12pt !important;
  padding: 10pt 12pt !important;
  border: 0.5pt solid #ddd !important;
  border-radius: 0 !important;
  margin-bottom: 10pt !important;
  background: #fff !important;
  box-shadow: none !important;
  break-inside: avoid;
 }
 .person-hero__photo {
  flex-shrink: 0 !important;
  width: 58pt !important;
  height: 72pt !important;
  border-radius: 2pt !important;
  border: 0.5pt solid #ccc !important;
  overflow: hidden !important;
  box-shadow: none !important;
 }
 .person-hero__photo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
 }
 .person-hero__photo-placeholder {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f3f3f3 !important;
 }
 .person-hero__photo-placeholder svg {
  width: 32pt !important;
  height: auto !important;
 }
 .person-hero__info {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 5pt !important;
  min-width: 0;
 }
 .person-hero__name {
  font-size: 14pt !important;
  color: #213951 !important;
  margin: 0 !important;
  line-height: 1.15 !important;
 }
 .person-hero__maiden {
  margin: 0 !important;
 }
 .person-hero__pills {
  gap: 5pt !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
 }
 .person-hero__pill {
  font-size: 7.5pt !important;
  padding: 2pt 8pt !important;
  border: 0.5pt solid #ccc !important;
  background: #f5f5f5 !important;
  color: #333 !important;
  border-radius: 10pt !important;
  gap: 3pt !important;
 }
 .person-hero__pill--birth {
  background: #fdf5ef !important;
  border-color: #caa288 !important;
  color: #213951 !important;
 }
 .person-hero__pill--death {
  background: #f5f5f5 !important;
  border-color: #aaa !important;
  color: #555 !important;
 }
 .person-hero__pill--clan {
  background: #eff3f7 !important;
  border-color: #213951 !important;
  color: #213951 !important;
  font-weight: 600 !important;
 }
 .person-biography {
  border: 0.5pt solid #ddd !important;
  border-radius: 0 !important;
  padding: 9pt 11pt !important;
  margin-bottom: 10pt !important;
  break-inside: avoid;
  box-shadow: none !important;
 }
 .person-description {
  font-size: 9pt !important;
  line-height: 1.6 !important;
  margin-bottom: 0 !important;
 }
 .person-content-wrapper, .person-content-wrapper.person-content-wrapper {
  display: block !important;
  grid-template-columns: unset !important;
  grid-template-rows: unset !important;
 }
 .person-left-column {
  width: 100% !important;
  float: none !important;
 }
 .person-right-column {
  display: block !important;
  width: 100% !important;
  float: none !important;
 }
 .person-section, .mr-section {
  border: 0.5pt solid #ddd !important;
  border-radius: 0 !important;
  padding: 10pt 12pt !important;
  margin-bottom: 10pt !important;
  break-inside: avoid;
  box-shadow: none !important;
  background: #fff !important;
 }
 .section-title {
  font-size: 9.5pt !important;
  color: #213951 !important;
  border-bottom: 0.5pt solid #ddd !important;
  padding-bottom: 4pt !important;
  margin-bottom: 8pt !important;
  display: flex;
  align-items: center;
  gap: 4pt;
 }
 .person-table {
  font-size: 9pt !important;
  margin-bottom: 0 !important;
 }
 .person-table th, .person-table td {
  padding: 5pt 8pt !important;
  font-size: 9pt !important;
  border-bottom: 0.5pt solid #eee !important;
 }
 .person-table th {
  width: 32% !important;
  background: #f7f7f7 !important;
  color: #555 !important;
  font-weight: 600 !important;
 }
 .person-table td {
  color: #111 !important;
 }
 .person-table td a {
  color: #213951 !important;
  text-decoration: none !important;
 }
 .person-table tr:hover {
  background: transparent !important;
 }
 /* Linia życia — zwarte wpisy w druku (mniej miejsca w pionie) */
 .person-profile .timeline-event {
  margin-bottom: 6pt !important;
  break-inside: avoid;
 }
 .event-content {
  padding: 5pt 8pt !important;
  border-radius: 0 !important;
  border-width: 0.5pt !important;
  border-left-width: 2pt !important;
 }
 .event-header {
  gap: 6pt !important;
  margin-bottom: 2pt !important;
  align-items: center !important;
 }
 .event-person-photo {
  width: 20pt !important;
  height: 20pt !important;
  border-width: 0.5pt !important;
 }
 .event-date {
  font-size: 7.5pt !important;
  margin-bottom: 1pt !important;
 }
 .event-title {
  font-size: 9pt !important;
  margin-bottom: 1pt !important;
  gap: 4pt !important;
 }
 .event-person, .event-person a {
  font-size: 8pt !important;
 }
 .event-place {
  font-size: 7.5pt !important;
  margin-top: 2pt !important;
  gap: 3pt !important;
 }
 .event-description {
  margin-top: 3pt !important;
  padding: 4pt 6pt !important;
  font-size: 8pt !important;
  line-height: 1.4 !important;
  border-radius: 0 !important;
 }
 .event-description-wrap {
  margin-top: 3pt !important;
 }
 .gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 6pt !important;
 }
 .gallery-item {
  break-inside: avoid;
 }
 .gallery-item img {
  width: 100% !important;
  height: 50pt !important;
  object-fit: cover !important;
  display: block !important;
  border: 0.5pt solid #ddd !important;
 }
 .gallery-caption {
  font-size: 7pt !important;
  color: #666 !important;
  margin-top: 2pt !important;
  text-align: center !important;
 }
 sup.mr-citation {
  font-size: 7pt !important;
 }
 .myroots-notice {
  border: 0.5pt solid #ccc !important;
  padding: 6pt 8pt !important;
  font-size: 8.5pt !important;
  margin-bottom: 8pt !important;
  break-inside: avoid;
 }
 a[href]::after {
  content: none !important;
 }
 .my-roots-wrapper {
  width: 100vw !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
 }
 .my-roots-tree-container {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
 }
 #FamilyChart svg {
  overflow: visible !important;
  width: 100% !important;
  height: auto !important;
 }
 .mr-stats-panel, .mr-stat-card {
  break-inside: avoid;
  box-shadow: none !important;
 }
 .myroots-modal, .mr-modal-overlay {
  display: none !important;
 }
}
.mr-view-btn--warn {
 color: var(--warning, #e67e22);
 border-color: rgba(230, 126, 34, 0.3);
}
.mr-view-btn--warn:hover {
 background: rgba(230, 126, 34, 0.1) !important;
 color: var(--warning, #e67e22) !important;
 border-color: var(--warning, #e67e22) !important;
}
.person-hero__panel-link--edit {
 opacity: 0.75;
 font-size: 0.8em;
}
.person-hero__panel-link--edit:hover {
 opacity: 1;
 color: var(--primary, #213951);
}
#FamilyChart .mr-card-avatar-placeholder svg {
 width: 55%;
 height: 55%;
 opacity: 0.45;
}
#FamilyChart .mr-card-avatar {
 height: var(--mr-card-img-h, 112px);
}

/* =================== MAPA — POPUP TOOLTIP (redesign) =================== */
.mr-leaflet-popup .leaflet-popup-content-wrapper {
 padding: 0 !important;
 border-radius: var(--radius, 8px) !important;
 border: 1px solid var(--border, #ddd) !important;
 overflow: hidden;
 font-family: var(--mr-font, inherit);
 box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.15)) !important;
}
.mr-leaflet-popup .leaflet-popup-content {
 margin: 0 !important;
 width: auto !important;
 min-width: 220px;
 max-width: 310px;
}
.mr-leaflet-popup .leaflet-popup-tip {
 background: var(--bg-white, #fff) !important;
 box-shadow: none !important;
 border: 1px solid var(--border, #ddd);
}
.mr-leaflet-popup .leaflet-popup-close-button {
 top: 6px !important;
 right: 8px !important;
 color: var(--text-medium, #999) !important;
 font-size: 18px !important;
 font-weight: 300 !important;
 transition: color 0.15s;
}
.mr-leaflet-popup .leaflet-popup-close-button:hover {
 color: var(--primary, #213951) !important;
}
.mr-map-popup {
 font-family: var(--mr-font, inherit);
 background: var(--bg-white, #fff);
 border-radius: var(--radius, 8px);
 overflow: hidden;
}
.mr-map-popup__header {
 display: flex;
 align-items: center;
 gap: 7px;
 padding: 11px 14px 10px;
 background: var(--primary, #213951);
 color: #fff;
 font-size: 13px;
 font-weight: 600;
 letter-spacing: 0.15px;
 line-height: 1.3;
}
.mr-map-popup__pin {
 flex-shrink: 0;
 opacity: 0.85;
}
.mr-map-popup__list {
 margin: 0;
 padding: 6px 0;
 list-style: none;
 max-height: 280px;
 overflow-y: auto;
}
.mr-map-popup__list::-webkit-scrollbar {
 width: 4px;
}
.mr-map-popup__list::-webkit-scrollbar-track {
 background: var(--bg-light, #f9f9f9);
}
.mr-map-popup__list::-webkit-scrollbar-thumb {
 background: var(--border, #ddd);
 border-radius: 2px;
}
.mr-map-popup__item {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 8px 14px;
 border-bottom: 1px solid var(--border-light, #f0f0f0);
 transition: background 0.12s;
}
.mr-map-popup__item:last-child {
 border-bottom: none;
}
.mr-map-popup__item:hover {
 background: var(--primary-alpha, rgba(33, 57, 81, 0.06));
}
.mr-map-popup__item--inline {
 gap: 6px;
 padding: 6px 14px;
 font-size: 12px;
}
.mr-map-popup__avatar {
 width: 34px;
 height: 34px;
 border-radius: 50%;
 object-fit: cover;
 border: 2px solid var(--border-light, #eee);
 flex-shrink: 0;
 background: var(--bg-light, #f9f9f9);
}
.mr-map-popup__initials {
 width: 34px;
 height: 34px;
 border-radius: 50%;
 flex-shrink: 0;
 background: linear-gradient(135deg, var(--primary, #213951) 0%, var(--primary-light, #4a6a87) 100%);
 color: #fff;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 12px;
 font-weight: 700;
 letter-spacing: 0.5px;
}
.mr-map-popup__name {
 display: block;
 font-size: 13px;
 font-weight: 600;
 color: var(--primary, #213951);
 text-decoration: none;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
 line-height: 1.3;
 margin-bottom: 3px;
 transition: color 0.12s;
}
.mr-map-popup__name:hover {
 color: var(--primary-light, #4a6a87);
 text-decoration: underline;
}
a.mr-map-popup__name {
 cursor: pointer;
}
.mr-map-popup__event {
 display: flex;
 align-items: center;
 gap: 4px;
 font-size: 11px;
 color: var(--text-medium, #777);
 line-height: 1.3;
}
.mr-map-popup__event-type {
 font-weight: 500;
 color: var(--text-dark, #333);
}
.mr-map-popup__event-date {
 color: var(--text-medium, #888);
}
.mr-map-popup__event-date::before {
 content: "·";
 margin-right: 3px;
}
.mr-map-popup__icon {
 flex-shrink: 0;
 vertical-align: middle;
}
.mr-map-popup__icon--birth {
 color: var(--ev-birth, #caa288);
}
.mr-map-popup__icon--death {
 color: var(--ev-death, #c8c8c8);
}
.mr-map-popup__icon--marriage {
 color: var(--primary, #213951);
}
.mr-map-popup__icon--event {
 color: var(--ev-event, #a8d8d0);
}

/* =================== GHOST CARD — ulepszone style =================== */
.mr-card--ghost {
 border: 2px dashed var(--border, #ddd);
 background: var(--bg-light, #f9f9f9);
 cursor: pointer;
 transition: var(--transition);
 position: relative;
 overflow: visible !important;
}
.mr-card--ghost:hover {
 border-color: var(--primary, #213951);
 background: var(--primary-alpha, rgba(33, 57, 81, 0.06));
}
.mr-card-avatar--ghost {
 border-radius: var(--radius, 8px) var(--radius, 8px) 0 0;
 overflow: hidden;
}
.mr-card-avatar-placeholder--ghost {
 opacity: 0.3;
 background: transparent !important;
}
.mr-card-name--ghost {
 color: var(--primary, #213951) !important;
 font-style: italic;
 font-size: 0.82em !important;
 text-align: center;
}
.mr-ghost-hint {
 margin: 2px 0 0;
 font-size: 0.68em;
 color: var(--text-light, #aaa);
 text-align: center;
 line-height: 1.3;
}
.mr-ghost-fab {
 position: absolute;
 bottom: -10px;
 left: 50%;
 transform: translatex(-50%);
 z-index: 10;
}
.mr-ghost-fab .mr-card-btn {
 width: 26px;
 height: 26px;
 background: var(--primary, #213951) !important;
 color: #fff !important;
 border-color: var(--primary, #213951) !important;
 border-radius: 50% !important;
 box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mr-ghost-fab .mr-card-btn:hover {
 background: var(--primary-light, #4a6a87) !important;
 transform: scale(1.15) !important;
}

/* ================================================================
 POPRAWKI / DODATKI v2.1.0
 Klasy zastępujące hardcoded style= z PHP/HTML
 ================================================================ */
.mr-empty-dash {
 color: #ccc;
}
.myroots-filter-info {
 font-size: 0.9em;
 color: var(--text-medium, rgba(51, 51, 51, 0.65));
 margin: 0 0 12px;
}
.mr-filter-reset {
 font-size: 0.85em;
 white-space: nowrap;
}
#mr-no-results, #mr-events-no-results {
 display: none;
}
.mr-sc-copy-notice {
 display: none;
 margin-top: 10px;
 padding: 7px 12px;
 background: #e8f5e9;
 border-radius: 5px;
 color: #2e7d32;
 font-size: 0.84em;
 font-weight: 500;
}
.mr-sc-copy-notice.is-visible {
 display: block;
}
.mr-quick-btn {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 background: var(--primary, #213951);
 color: #fff;
 padding: 10px 18px;
 border-radius: 6px;
 text-decoration: none;
 font-weight: 500;
 font-size: 14px;
 transition: background 0.15s;
}
.mr-quick-btn:hover, .mr-quick-btn:focus {
 background: var(--primary-light, #4a6a87);
 color: #fff;
 text-decoration: none;
}
.mr-dashboard-wrap {
 max-width: 1200px;
}
.mr-dashboard-title {
 display: flex;
 align-items: center;
 gap: 10px;
 font-size: 1.8em;
 margin-bottom: 24px;
}
.mr-dashboard-stats {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
 gap: 16px;
 margin-bottom: 28px;
}
.mr-dashboard-quickbtns {
 display: flex;
 gap: 12px;
 flex-wrap: wrap;
 margin-bottom: 28px;
}
.mr-dashboard-wrap {
 max-width: 1200px;
}
.mr-dashboard-title {
 display: flex;
 align-items: center;
 gap: 10px;
 font-size: 1.8em;
 margin-bottom: 24px;
}
.mr-dashboard-stats {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
 gap: 16px;
 margin-bottom: 28px;
}
.mr-dashboard-quickbtns {
 display: flex;
 gap: 12px;
 flex-wrap: wrap;
 margin-bottom: 28px;
}
.mr-dashboard-grid {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 20px;
}
.mr-dashboard-box {
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 20px 24px;
 box-shadow: var(--shadow-sm);
 margin-top: 20px;
}
.mr-dashboard-box__title {
 margin: 0 0 16px;
 font-size: 1em;
}
.mr-dashboard-list {
 margin: 0;
 padding: 0;
 list-style: none;
}
.mr-dashboard-list li {
 padding: 7px 0;
 border-bottom: 1px solid var(--border-light);
 font-size: 0.9em;
}
.mr-dashboard-list__link {
 color: var(--primary);
 font-weight: 500;
 text-decoration: none;
}
.mr-dashboard-list__link:hover {
 text-decoration: underline;
}
.mr-dashboard-list__meta {
 color: var(--text-light);
}
.mr-dashboard-empty {
 color: var(--text-light);
 font-size: 0.9em;
}
.mr-stat-card {
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 20px 16px;
 text-align: center;
 box-shadow: var(--shadow-sm);
}
.mr-stat-card__num {
 font-size: 2em;
 font-weight: 700;
 color: var(--primary);
 line-height: 1.1;
}
.mr-stat-card__label {
 font-size: 0.8em;
 color: var(--text-medium);
 margin-top: 4px;
}
.mr-stat-card__link {
 display: block;
 margin-top: 8px;
 font-size: 0.8em;
 color: #2c6fad;
 text-decoration: none;
}
.mr-stat-card__link:hover {
 text-decoration: underline;
}
.mr-shortcodes-box {
 margin-top: 20px;
}
.mr-shortcodes-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 flex-wrap: wrap;
 gap: 10px;
 margin-bottom: 14px;
}
.mr-shortcodes-hint {
 color: var(--text-light);
 font-size: 0.82em;
 margin: 0 0 12px;
}
.mr-shortcodes-table {
 width: 100%;
 border-collapse: collapse;
 font-size: 0.85em;
}
.mr-shortcodes-table th {
 text-align: left;
 background: var(--bg-light);
 border: 1px solid var(--border);
 font-weight: 600;
 color: var(--text-dark);
 padding: 7px 10px;
}
.mr-shortcodes-table td {
 padding: 7px 10px;
 border: 1px solid var(--border);
 border-top: none;
}
.mr-shortcodes-table__code {
 font-family: monospace;
 background: var(--bg-light);
 color: var(--primary);
 font-size: 0.93em;
}
.mr-settings-wrap {
 max-width: 900px;
}
.mr-settings-section {
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 20px 24px;
 margin-bottom: 20px;
}
.mr-settings-section__title {
 margin: 0 0 16px;
 font-size: 1em;
 border-bottom: 1px solid var(--border-light);
 padding-bottom: 10px;
}
.mr-clans-wrap {
 max-width: 900px;
}
.mr-clans-grid {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 24px;
 margin-top: 20px;
}
.mr-box {
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 20px 24px;
}
.mr-box__title {
 margin: 0 0 16px;
 font-size: 1em;
}
.mr-box__desc {
 color: var(--text-light);
 font-size: 0.85em;
 margin-bottom: 16px;
}
.mr-clans-empty {
 color: var(--text-light);
 font-size: 0.9em;
 margin-bottom: 16px;
}
.mr-clans-table .mr-clans-table__actions {
 width: 140px;
}
.mr-clans-count-col {
 width: 80px;
 text-align: center;
}
.mr-clans-status {
 font-size: 0.8em;
}
.mr-clans-status--defined {
 color: #2e7d32;
}
.mr-clans-status--only {
 color: #e65100;
}
.mr-clans-unregistered {
 margin-top: 16px;
 background: #fff8e1;
 border: 1px solid #ffe082;
 border-radius: var(--radius-sm);
 padding: 12px 16px;
}
.mr-clans-unregistered__title {
 margin: 0 0 8px;
 font-size: 0.9em;
 font-weight: 600;
}
.mr-clans-unregistered__desc {
 margin: 0 0 10px;
 font-size: 0.85em;
 color: var(--text-medium);
}
.mr-clans-add-form {
 margin-top: 16px;
}
.mr-clans-add-row {
 display: flex;
 gap: 8px;
 align-items: center;
}
.mr-clans-add-row input {
 flex: 1;
}
.mr-clans-bulk {
 margin-top: 20px;
}
.mr-clans-bulk summary {
 cursor: pointer;
 color: #2c6fad;
 font-size: 0.9em;
}
.mr-clans-bulk-form {
 margin-top: 12px;
}
.mr-clans-bulk-row {
 display: flex;
 gap: 8px;
 margin-bottom: 8px;
}
.mr-clans-bulk-row input {
 flex: 1;
}
.mr-clans-info-box {
 background: #e8f4fd;
 border: 1px solid #b3d8ff;
 border-radius: var(--radius);
 padding: 16px 20px;
 margin-top: 20px;
}
.mr-clans-info-box ul {
 margin: 8px 0 0;
 padding-left: 20px;
 font-size: 0.9em;
}
.mr-appearance-title {
 display: flex;
 align-items: center;
 gap: 10px;
 margin-bottom: 24px;
}
.mr-ap-actions {
 display: flex;
 gap: 10px;
 align-items: center;
 margin-top: 4px;
}
.mr-reset-btn {
 color: #c0392b !important;
 border-color: #c0392b !important;
}
.mr-visually-hidden {
 position: absolute;
 width: 1px;
 height: 1px;
 overflow: hidden;
 clip: rect(0, 0, 0, 0);
 white-space: nowrap;
}

/* ====== APPEARANCE PAGE STYLES ====== */
.mr-appearance-wrap {
 max-width: 1200px;
}
.mr-appearance-grid {
 display: grid;
 grid-template-columns: 1fr 340px;
 gap: 28px;
 align-items: start;
}
.mr-ap-section {
 background: var(--bg-white);
 border: 1px solid var(--border);
 border-radius: var(--radius-lg);
 padding: 22px 24px;
 margin-bottom: 16px;
 box-shadow: var(--shadow-sm);
}
.mr-ap-section__title {
 margin: 0 0 18px;
 font-size: 0.9em;
 font-weight: 700;
 text-transform: uppercase;
 letter-spacing: 0.6px;
 color: var(--text-medium);
 border-bottom: 1px solid var(--border-light);
 padding-bottom: 10px;
 display: flex;
 align-items: center;
 gap: 7px;
}
.mr-ap-colors-grid {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 10px;
}
.mr-ap-color-row {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 8px 10px;
 border: 1px solid var(--border-light);
 border-radius: var(--radius);
 background: var(--bg-light);
 transition: border-color 0.15s;
}
.mr-ap-color-row:hover {
 border-color: var(--primary-light);
}
.mr-ap-color-label {
 position: relative;
 flex-shrink: 0;
 cursor: pointer;
}
.mr-ap-color-swatch {
 display: block;
 width: 36px;
 height: 36px;
 border-radius: 50%;
 border: 2px solid rgba(0, 0, 0, 0.12);
 box-shadow: var(--shadow-sm);
 cursor: pointer;
 transition: transform 0.15s;
}
.mr-ap-color-label:hover .mr-ap-color-swatch {
 transform: scale(1.1);
}
.mr-ap-color-native {
 position: absolute;
 inset: 0;
 opacity: 0;
 width: 100%;
 height: 100%;
 cursor: pointer;
}
.mr-ap-color-meta strong {
 display: block;
 font-size: 0.85em;
 color: var(--text-dark);
 line-height: 1.3;
}
.mr-ap-color-desc {
 display: block;
 font-size: 0.75em;
 color: var(--text-light);
 margin-top: 1px;
}
.mr-ap-color-hex {
 font-size: 0.75em;
 color: var(--text-light);
 white-space: nowrap;
}
.mr-ap-field {
 display: grid;
 grid-template-columns: 140px 1fr;
 gap: 10px 16px;
 align-items: start;
 padding: 12px 0;
 border-bottom: 1px solid var(--border-light);
}
.mr-ap-field:last-child {
 border-bottom: none;
 padding-bottom: 0;
}
.mr-ap-field__label {
 font-size: 0.85em;
 font-weight: 600;
 color: var(--text-medium);
 padding-top: 8px;
}
.mr-ap-field__control {
 display: flex;
 flex-direction: column;
 gap: 8px;
}
.mr-ap-field__desc {
 margin: 0;
 font-size: 0.75em;
 color: var(--text-light);
}
.mr-ap-select {
 padding: 7px 10px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 font-size: 0.88em;
 background: var(--bg-light);
 width: 100%;
 cursor: pointer;
}
.mr-ap-input-custom {
 padding: 7px 10px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 font-size: 0.85em;
 width: 100%;
}
.mr-ap-font-preview {
 padding: 8px 10px;
 border: 1px dashed var(--border);
 border-radius: var(--radius-sm);
 font-size: 0.9em;
 color: var(--text-medium);
 background: var(--bg-light);
}
.mr-ap-segmented {
 display: flex;
 gap: 4px;
 flex-wrap: wrap;
}
.mr-ap-seg-btn {
 flex: 1 1 auto;
 min-width: 48px;
 padding: 6px 10px;
 border: 1.5px solid var(--border);
 border-radius: var(--radius-sm);
 background: var(--bg-light);
 color: var(--text-medium);
 font-size: 0.78em;
 font-weight: 600;
 cursor: pointer;
 transition: all 0.15s;
 text-align: center;
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 1px;
 line-height: 1.2;
}
.mr-ap-seg-btn span {
 font-size: 0.7em;
 font-weight: 400;
 color: var(--text-light);
}
.mr-ap-seg-btn:hover {
 border-color: var(--primary);
 background: var(--primary-alpha);
 color: var(--primary);
}
.mr-ap-seg-btn:hover span {
 color: var(--primary-light);
}
.mr-ap-seg-btn.is-active span {
 color: rgba(255, 255, 255, 0.6);
}
.mr-ap-slider-wrap {
 display: flex;
 align-items: center;
 gap: 12px;
}
.mr-ap-slider {
 flex: 1;
 -webkit-appearance: none;
 height: 4px;
 border-radius: 4px;
 background: var(--border);
 outline: none;
 cursor: pointer;
}
.mr-ap-slider::-webkit-slider-thumb {
 -webkit-appearance: none;
 width: 18px;
 height: 18px;
 border-radius: 50%;
 background: var(--primary);
 cursor: pointer;
 border: 2px solid var(--bg-white);
 box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.mr-ap-slider-val {
 font-size: 0.8em;
 font-weight: 600;
 color: var(--primary);
 min-width: 36px;
 text-align: right;
}
.mr-ap-radius-preview {
 margin-top: 6px;
}
.mr-ap-radius-box {
 width: 100%;
 height: 36px;
 background: linear-gradient(135deg, var(--primary-alpha), var(--accent-xlight));
 border: 2px solid var(--primary);
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 0.8em;
 color: var(--primary);
 font-weight: 600;
 transition: border-radius 0.2s;
}
.mr-ap-shadow-opt {
 flex: 1 1 70px;
 text-align: center;
 cursor: pointer;
 padding: 10px 8px 8px;
 border: 1.5px solid var(--border);
 border-radius: var(--radius);
 background: var(--bg-light);
 transition: all 0.15s;
 font-size: 0.75em;
 color: var(--text-medium);
}
.mr-ap-shadow-opt:hover {
 border-color: var(--primary);
 background: var(--primary-alpha);
}
.mr-ap-shadow-opt.is-active {
 border-color: var(--primary);
 background: var(--primary-alpha);
 color: var(--primary);
 font-weight: 600;
}
.mr-ap-shadow-box {
 width: 44px;
 height: 32px;
 background: var(--bg-white);
 border: 1px solid var(--border-light);
 border-radius: var(--radius-sm);
 margin: 0 auto 6px;
 display: flex;
 align-items: center;
 justify-content: center;
 font-weight: 700;
 font-size: 1.1em;
 color: var(--primary);
}
.mr-ap-preview-col {

}
.mr-ap-preview-sticky {
 position: sticky;
 top: 32px;
}
.mr-ap-preview-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 margin-bottom: 12px;
}
.mr-ap-preview-header > span {
 font-size: 0.8em;
 font-weight: 700;
 text-transform: uppercase;
 letter-spacing: 0.5px;
 color: var(--text-light);
}
.mr-ap-preview-tabs {
 display: flex;
 gap: 4px;
}
.mr-ap-ptab {
 padding: 5px 12px;
 border: 1px solid var(--border);
 border-radius: 20px;
 background: var(--bg-light);
 font-size: 0.78em;
 cursor: pointer;
 color: var(--text-medium);
 transition: all 0.15s;
}
.mr-ap-ptab:hover {
 border-color: var(--primary);
 color: var(--primary);
}
.mr-ap-pane {
 display: none;
}
.mr-ap-pane.is-active {
 display: block;
}
.mr-preview-bg {
 background: var(--mrp-bg, #f9f9f9);
 border: 1px solid var(--border);
 border-radius: var(--radius-lg);
 padding: 20px;
 font-family: var(--mrp-font, inherit);
 font-size: var(--mrp-font-size, 15px);
}
.mr-ap-preview-caption {
 margin: 10px 0 0;
 font-size: 0.72em;
 color: var(--text-light);
 text-align: center;
}
.mr-preview-card {
 background: var(--mrp-card-bg, #fff);
 border: 1px solid var(--mrp-border, #ddd);
 border-radius: var(--mrp-radius, 8px);
 overflow: hidden;
 max-width: 180px;
 margin: 0 auto;
 box-shadow: var(--mrp-shadow, 0 2px 8px rgba(0,0,0,.10));
}
.mr-preview-card__avatar {
 height: 110px;
 background: var(--mrp-primary-alpha, rgba(33, 57, 81, 0.08));
 display: flex;
 align-items: center;
 justify-content: center;
 color: var(--mrp-primary, #213951);
 opacity: 0.6;
}
.mr-preview-card__body {
 padding: 10px 12px;
}
.mr-preview-card__name {
 margin: 0 0 6px;
 font-size: 0.88em;
 font-weight: 600;
 color: var(--mrp-text, #333);
 font-family: var(--mrp-font, inherit);
}
.mr-preview-card__dates {
 display: flex;
 flex-direction: column;
 gap: 3px;
}
.mr-preview-card__birth, .mr-preview-card__death {
 font-size: 0.72em;
 display: flex;
 align-items: center;
 gap: 3px;
}
.mr-preview-card__birth {
 color: var(--mrp-ev-birth, #caa288);
}
.mr-preview-card__death {
 color: #999;
}
.mr-preview-profile {
 display: flex;
 gap: 12px;
 align-items: flex-start;
 background: var(--mrp-card-bg, #fff);
 border: 1px solid var(--mrp-border, #ddd);
 border-radius: var(--mrp-radius, 8px);
 padding: 14px;
 margin-bottom: 10px;
 box-shadow: var(--mrp-shadow, 0 2px 8px rgba(0,0,0,.10));
}
.mr-preview-profile__photo {
 width: 56px;
 height: 70px;
 border-radius: calc(var(--mrp-radius, 8px) * 0.8);
 background: var(--mrp-primary-alpha, rgba(33, 57, 81, 0.08));
 display: flex;
 align-items: center;
 justify-content: center;
 color: var(--mrp-primary, #213951);
 flex-shrink: 0;
 opacity: 0.6;
 border: 1px solid var(--mrp-border, #ddd);
}
.mr-preview-profile__info {
 flex: 1;
}
.mr-preview-profile__name {
 font-size: 1.1em;
 font-weight: var(--mrp-hw, 300);
 color: var(--mrp-primary, #213951);
 margin-bottom: 8px;
 font-family: var(--mrp-font, inherit);
}
.mr-preview-profile__pills {
 display: flex;
 flex-wrap: wrap;
 gap: 5px;
}
.mr-preview-pill {
 display: inline-flex;
 align-items: center;
 gap: 3px;
 font-size: 0.68em;
 padding: 3px 9px;
 border-radius: 20px;
 border: 1px solid var(--mrp-border, #ddd);
 background: var(--mrp-bg, #f9f9f9);
 color: #777;
 white-space: nowrap;
}
.mr-preview-pill--birth {
 background: rgba(202, 162, 136, 0.12);
 border-color: var(--mrp-ev-birth, #caa288);
 color: var(--mrp-primary, #213951);
}
.mr-preview-pill--death {
 background: rgba(200, 200, 200, 0.15);
 border-color: var(--mrp-ev-death, #c8c8c8);
}
.mr-preview-pill--clan {
 background: var(--mrp-primary-alpha, rgba(33, 57, 81, 0.08));
 border-color: var(--mrp-primary, #213951);
 color: var(--mrp-primary, #213951);
 font-weight: 600;
}
.mr-preview-table {
 background: var(--mrp-card-bg, #fff);
 border: 1px solid var(--mrp-border, #ddd);
 border-radius: var(--mrp-radius, 8px);
 overflow: hidden;
 box-shadow: var(--mrp-shadow, 0 2px 8px rgba(0,0,0,.10));
}
.mr-preview-table__title {
 padding: 8px 12px;
 font-size: 0.78em;
 font-weight: 700;
 color: var(--mrp-primary, #213951);
 border-bottom: 1px solid var(--mrp-border, #ddd);
 background: var(--mrp-bg, #f9f9f9);
}
.mr-preview-table__row {
 display: flex;
 justify-content: space-between;
 padding: 6px 12px;
 font-size: 0.75em;
 color: var(--mrp-text, #333);
 border-bottom: 1px solid var(--mrp-border, #eee);
}
.mr-preview-table__row:last-child {
 border-bottom: none;
}
.mr-preview-table__row > span:first-child {
 color: #888;
}
.mr-preview-lifeline {
 background: var(--mrp-card-bg, #fff);
 border: 1px solid var(--mrp-border, #ddd);
 border-radius: var(--mrp-radius, 8px);
 padding: 14px;
 box-shadow: var(--mrp-shadow, 0 2px 8px rgba(0,0,0,.10));
}
.mr-preview-ll__title {
 font-size: 0.78em;
 font-weight: 700;
 color: var(--mrp-primary, #213951);
 margin-bottom: 12px;
 padding-bottom: 8px;
 border-bottom: 1px solid var(--mrp-border, #eee);
}
.mr-preview-ll__event {
 display: flex;
 align-items: flex-start;
 gap: 10px;
 padding: 6px 0;
 position: relative;
}
.mr-preview-ll__event:not(:last-child)::after {
 content: "";
 position: absolute;
 left: 5px;
 top: 20px;
 bottom: -6px;
 width: 2px;
 background: var(--mrp-border, #eee);
}
.mr-preview-ll__dot {
 width: 12px;
 height: 12px;
 border-radius: 50%;
 flex-shrink: 0;
 margin-top: 3px;
 border: 2px solid var(--mrp-card-bg, #fff);
 box-shadow: 0 0 0 1.5px currentColor;
}
.mr-preview-ll__dot--birth {
 background: var(--mrp-ev-birth, #caa288);
 color: var(--mrp-ev-birth, #caa288);
}
.mr-preview-ll__dot--marriage {
 background: var(--mrp-ev-marriage, #213951);
 color: var(--mrp-ev-marriage, #213951);
}
.mr-preview-ll__dot--event {
 background: var(--mrp-ev-event, #a8d8d0);
 color: var(--mrp-ev-event, #a8d8d0);
}
.mr-preview-ll__dot--end {
 background: var(--mrp-ev-end, #e0c4c4);
 color: var(--mrp-ev-end, #e0c4c4);
}
.mr-preview-ll__dot--death {
 background: var(--mrp-ev-death, #c8c8c8);
 color: var(--mrp-ev-death, #c8c8c8);
}
.mr-preview-ll__content strong {
 display: block;
 font-size: 0.8em;
 color: var(--mrp-text, #333);
 line-height: 1.3;
}
.mr-preview-ll__content span {
 font-size: 0.72em;
 color: #999;
}
@media (max-width: 1100px) {
 .mr-appearance-grid {
  grid-template-columns: 1fr;
 }
 .mr-ap-preview-sticky {
  position: static;
 }
}
@media (max-width: 782px) {
 .mr-dashboard-grid {
  grid-template-columns: 1fr;
 }
 .mr-clans-grid {
  grid-template-columns: 1fr;
 }
 .mr-ap-colors-grid {
  grid-template-columns: 1fr;
 }
}
@media (max-width: 1100px) {
 .mr-appearance-grid {
  grid-template-columns: 1fr;
 }
 .mr-ap-preview-sticky {
  position: static;
 }
}
@media (max-width: 782px) {
 .mr-dashboard-grid {
  grid-template-columns: 1fr;
 }
 .mr-clans-grid {
  grid-template-columns: 1fr;
 }
 .mr-ap-colors-grid {
  grid-template-columns: 1fr;
 }
}

/* ==================================================================== */
/*  Zwierzęta — mini-kafelki w drzewie + sekcje                          */
/* ==================================================================== */

/* W drzewie: pasek zwierząt pod kartą właściciela.
   Karta f3 ma overflow:hidden, więc pasek pozycjonujemy absolutnie
   poza kartą i pozwalamy mu wystawać. */
#FamilyChart .mr-card {
 overflow: visible;
}
.mr-card-pets {
 position: absolute;
 top: 100%;
 left: 0;
 display: flex;
 flex-wrap: wrap;
 gap: 4px;
 padding: 6px 4px 0;
 box-sizing: border-box;
 justify-content: center;
 pointer-events: auto;
 z-index: 3;
}
.mr-pet-chip {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 max-width: 100%;
 padding: 2px 7px 2px 2px;
 background: var(--bg-white, #fff);
 border: 1px solid var(--border, #e0d8cf);
 border-radius: 999px;
 font-size: 11px;
 line-height: 1.2;
 color: var(--text-dark, #3a3a3a);
 text-decoration: none;
 box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08));
 transition: var(--transition, all .15s ease);
}
.mr-pet-chip:hover {
 border-color: var(--accent, #caa288);
 transform: translatey(-1px);
}
.mr-pet-chip-avatar {
 width: 20px;
 height: 20px;
 flex: 0 0 20px;
 border-radius: 50%;
 overflow: hidden;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 background: var(--accent-xlight, rgba(202,162,136,.12));
 color: var(--accent, #caa288);
}
.mr-pet-chip-avatar img {
 width: 100%;
 height: 100%;
 object-fit: cover;
}
.mr-pet-chip-name {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 max-width: 90px;
}

/* Sekcja „Zwierzęta" w profilu — rasa w nawiasie wyszarzona */
.mr-pet-breed {
 color: var(--text-medium, #888);
 font-size: .9em;
}

/* Lista zwierząt (zakładka) — karta z łapką jako placeholder */
.mr-card--pet .mr-card-avatar-placeholder {
 color: var(--accent, #caa288);
}

/* ============================================================
   Sekcja „Nagrania i materiały" (audio/wideo ze źródeł)
   ============================================================ */
.mr-media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.mr-media-item {
  margin: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mr-media-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-light);
}
.mr-media-embed iframe,
.mr-media-embed video,
.mr-media-embed object,
.mr-media-embed embed {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
/* osadzenia audio (np. SoundCloud/Spotify) bywają niskie — nie wymuszaj 16:9 */
.mr-media-embed:has(iframe[src*="spotify"]),
.mr-media-embed:has(iframe[src*="soundcloud"]) {
  aspect-ratio: auto;
}
.mr-media-embed:has(iframe[src*="spotify"]) iframe,
.mr-media-embed:has(iframe[src*="soundcloud"]) iframe {
  position: static;
  height: 152px !important;
}
.mr-media-caption {
  padding: 8px 12px;
  font-size: .9em;
  color: var(--text-medium);
}

/* ============================================================
   Legenda mapy globalnej (kolory wg typu wydarzenia)
   ============================================================ */
.mr-map-legend {
  background: var(--bg-white, #fff);
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 1px 5px rgba(0,0,0,.2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dark, #1f2d3a);
}
.mr-map-legend__title {
  font-weight: 600;
  margin-bottom: 4px;
}
.mr-map-legend__row {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.mr-map-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  flex: 0 0 auto;
}

/* ============================================================
   Statyczna mapa do DRUKU — siatka kafelków OSM + kropki + podpisy.
   Na ekranie trzymana poza widokiem (ale renderowana, żeby kafelki
   się załadowały); w druku pokazywana zamiast żywej mapy Leaflet.
   ============================================================ */
.mr-map-print {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 900px;
}
.mr-map-print__canvas {
  position: relative;
  overflow: hidden;
  background: #aadaff;                 /* kolor „wody" pod kafelkami */
  border: 1px solid #c3c4c7;
  border-radius: var(--radius-sm, 6px);
}
.mr-map-print__tile {
  position: absolute;
  width: 256px;
  height: 256px;
  border: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.mr-map-print__dot {
  position: absolute;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;               /* wyśrodkowanie na współrzędnej */
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35);
}
.mr-map-print__plabel {
  position: absolute;
  transform: translateY(-50%);
  background: rgba(255,255,255,.85);
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: #1f2d3a;
  white-space: nowrap;
  border-radius: 2px;
}
.mr-map-print__attr {
  position: absolute;
  right: 0; bottom: 0;
  background: rgba(255,255,255,.7);
  font-size: 9px;
  padding: 1px 4px;
  color: #333;
}
.mr-map-print__legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12px;
}
.mr-map-print__legend-title { font-weight: 600; width: 100%; }
.mr-map-print__legend-row { display: flex; align-items: center; gap: 6px; }
.mr-map-print__legend-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  flex: 0 0 auto;
}

@media print {
  /* w druku: pokaż statyczną mapę, schowaj żywą mapę Leaflet */
  .my-roots-map-wrapper { display: none !important; }
  .mr-map-print {
    position: static !important;
    left: auto !important;
    width: 100% !important;
    max-width: 900px;
  }
  .mr-map-print,
  .mr-map-print * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .mr-map-print__canvas { width: 100% !important; }
}

/* =================== Searchable select (rody) =================== */
.mr-combo { position: relative; display: inline-block; min-width: 180px; }
.mr-combo__native { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mr-combo__input {
 width: 100%; box-sizing: border-box; padding: 9px 12px;
 border: 1px solid var(--border); border-radius: var(--radius-sm, 4px);
 background: var(--bg-white); color: var(--text-dark); font-size: 14px; cursor: pointer;
 font-family: var(--mr-font, inherit);
}
.mr-combo__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-xlight, rgba(202,162,136,.18)); }
.mr-combo__list {
 position: absolute; z-index: 9999; left: 0; right: 0; top: calc(100% + 2px); margin: 0;
 max-height: 260px; overflow: auto; background: var(--bg-white);
 border: 1px solid var(--border); border-radius: var(--radius-sm, 4px);
 box-shadow: var(--shadow-md); list-style: none; padding: 4px;
}
/* Na mapie (Leaflet ma wysokie z-indexy) — wynieś cały combobox nad mapę. */
.mr-map-filters .mr-combo, #mr-map-filters .mr-combo { position: relative; z-index: 9999; }
.mr-combo__opt {
 padding: 8px 11px; cursor: pointer; border-radius: var(--radius-sm, 4px);
 font-size: 14px; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mr-combo__opt:hover { background: var(--accent-xlight, rgba(202,162,136,.14)); }
.mr-combo__opt[aria-selected="true"] { background: var(--accent-alpha, rgba(202,162,136,.3)); font-weight: 600; }

/* =================== Font z „Wygląd" w treści MyRoots ===================
   Motywy często narzucają własny font na h1–h6 (wyższa specyficzność niż
   dziedziczenie po kontenerze), przez co nagłówki nie brały --mr-font.
   Ta reguła wymusza wybrany font na nagłówkach i kluczowych etykietach
   we wszystkich widokach wtyczki. */
.myroots-people-list, .person-profile, .mr-stats,
.myroots-lifeline-container, .myroots-events-timeline,
.my-roots-map-wrapper,
.my-roots-panel, .myroots-shared-gallery {
 font-family: var(--mr-font, inherit);
}
.myroots-people-list h1, .myroots-people-list h2, .myroots-people-list h3, .myroots-people-list h4, .myroots-people-list h5, .myroots-people-list h6,
.person-profile h1, .person-profile h2, .person-profile h3, .person-profile h4, .person-profile h5, .person-profile h6,
.mr-stats h1, .mr-stats h2, .mr-stats h3, .mr-stats h4, .mr-stats h5, .mr-stats h6,
.myroots-lifeline-container h1, .myroots-lifeline-container h2, .myroots-lifeline-container h3, .myroots-lifeline-container h4,
.myroots-events-timeline h1, .myroots-events-timeline h2, .myroots-events-timeline h3, .myroots-events-timeline h4,
.my-roots-panel h1, .my-roots-panel h2, .my-roots-panel h3, .my-roots-panel h4,
.person-hero__name, .section-title,
.event-title, .mr-card-name, .mr-card__name {
 font-family: var(--mr-font, inherit);
}

/* Adnotacja przy wieku końcowym (domniemana śmierć) */
.person-hero__pill-note { font-size: .82em; opacity: .7; font-style: italic; margin-left: 2px; }

/* =================== Pole daty (kwalifikator + częściowa data + kalendarz) ============ */
.mr-date-field { display: flex; gap: 6px; align-items: stretch; }
.mr-date-qual { flex: 0 0 auto; max-width: 130px; }
.mr-date-input { position: relative; flex: 1 1 auto; min-width: 0; }
.mr-date-input > input.myroots-datepicker { width: 100%; padding-right: 38px; box-sizing: border-box; }
.mr-date-cal {
 position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
 display: inline-flex; align-items: center; justify-content: center;
 width: 30px; height: 30px; padding: 0; cursor: pointer;
 background: transparent; border: none; color: var(--primary, #213951); opacity: .6;
}
.mr-date-cal:hover { opacity: 1; }

/* ====================================================================
   Kalkulator pokrewieństwa ([myrootskinship])
   ==================================================================== */
.mr-kinship-form {
 display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
 margin-bottom: 18px;
}
.mr-kinship-pick { position: relative; flex: 1 1 220px; min-width: 200px; }
.mr-kinship-input {
 width: 100%; padding: 10px 14px; box-sizing: border-box;
 border: 1px solid var(--border, #e0e4ea); border-radius: var(--radius-sm, 8px);
 background: var(--bg-white, #fff); color: var(--text-dark, #222);
 font-size: 14px; transition: var(--transition, all .2s ease);
}
.mr-kinship-input:focus { outline: none; border-color: var(--primary, #213951); }
.mr-kinship-input.is-picked { border-color: var(--primary, #213951); font-weight: 600; }
.mr-kinship-vs { color: var(--text-light, #888); font-size: 18px; }
.mr-kinship-results {
 position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
 margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
 background: var(--bg-white, #fff); border: 1px solid var(--border, #e0e4ea);
 border-radius: var(--radius-sm, 8px); box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.mr-kinship-results li {
 padding: 8px 10px; cursor: pointer; border-radius: 6px; font-size: 14px;
}
.mr-kinship-results li:hover { background: var(--bg-light, #f4f6f9); }
.mr-kinship-results li.mr-kinship-empty { cursor: default; color: var(--text-light, #888); }
.mr-kinship-opt-years { color: var(--text-light, #888); font-size: 12px; }
.mr-kinship-btn {
 padding: 10px 20px; border: none; cursor: pointer;
 background: var(--primary, #213951); color: #fff; font-weight: 600; font-size: 14px;
 border-radius: var(--radius-sm, 8px); transition: var(--transition, all .2s ease);
}
.mr-kinship-btn:hover { opacity: .9; }
.mr-kinship-btn:disabled { opacity: .5; cursor: wait; }
.mr-kinship-result {
 padding: 18px; background: var(--bg-white, #fff);
 border: 1px solid var(--border, #e0e4ea);
 border-left: 3px solid var(--primary, #213951);
 border-radius: var(--radius, 10px);
}
.mr-kinship-relation { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--text-dark, #222); }
.mr-kinship-detail   { margin: 0; font-size: 13px; color: var(--text-medium, #555); }
.mr-kinship-path {
 display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.mr-kinship-chip {
 display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
 padding: 7px 12px; text-decoration: none;
 background: var(--bg-light, #f4f6f9); border: 1px solid var(--border, #e0e4ea);
 border-radius: var(--radius-sm, 8px); color: var(--text-dark, #222);
 transition: var(--transition, all .2s ease);
}
a.mr-kinship-chip:hover { border-color: var(--primary, #213951); background: var(--bg-white, #fff); }
.mr-kinship-chip strong { font-size: 13px; line-height: 1.25; }
.mr-kinship-chip small  { font-size: 11px; color: var(--text-light, #888); }
.mr-kinship-arrow {
 display: inline-flex; flex-direction: column; align-items: center;
 color: var(--text-light, #888);
}
.mr-kinship-arrow small { font-size: 10px; line-height: 1; margin-bottom: 1px; }
[dir="rtl"] .mr-kinship-arrow svg { transform: scaleX(-1); }

/* ====================================================================
   Widok „Cały graf" (wszystkie osoby) — #mrFullGraph
   Układ plakatowy: kolumny pokoleń, rodzeństwo w pionie, klamry par,
   linie ortogonalne. Paski kolorowane płcią wg palety motywu.
   ==================================================================== */
#mrFullGraph {
 position: relative;
 width: 100%; height: 100%; min-height: 420px;
 background: var(--bg-light, #f4f6f9);
}
#mrFullGraph svg { display: block; width: 100%; height: 100%; cursor: grab; }
#mrFullGraph svg:active { cursor: grabbing; }

/* Linie — ortogonalne, jak na drukowanym drzewie */
.mr-fg-edge { fill: none; stroke: var(--text-medium, #555); stroke-width: 1.2; }
.mr-fg-edge--marriage { stroke: var(--primary, #213951); stroke-width: 1.4; }
.mr-fg-edge--far { opacity: .65; }
.mr-fg-edge--child { opacity: .8; }
.mr-fg-mlabel {
 font-size: 9px; fill: var(--text-light, #888);
 font-family: inherit; letter-spacing: .03em;
}

/* Paski osób — płeć kolorem palety motywu */
.mr-fg-bar {
 display: flex; align-items: center; gap: 6px; box-sizing: border-box;
 width: 100%; height: 100%; padding: 2px 7px; overflow: hidden;
 background: var(--bg-white, #fff); border: 1px solid var(--border, #e0e4ea);
 border-radius: 4px; cursor: pointer;
 box-shadow: 0 1px 2px rgba(0,0,0,.07);
 transition: box-shadow .15s ease, border-color .15s ease;
}
.mr-fg-bar--m {
 border-inline-start: 3px solid var(--primary, #213951);
 background: color-mix(in srgb, var(--primary, #213951) 8%, #fff);
}
.mr-fg-bar--f {
 border-inline-start: 3px solid var(--accent, #b0413e);
 background: color-mix(in srgb, var(--accent, #b0413e) 8%, #fff);
}
.mr-fg-bar--u { border-inline-start: 3px solid var(--border, #cfd4dc); background: var(--bg-light, #f4f6f9); }
.mr-fg-bar:hover { border-color: var(--primary, #213951); box-shadow: 0 2px 8px rgba(0,0,0,.16); }
.mr-fg-bar.is-active { box-shadow: 0 0 0 2px var(--primary, #213951); }
.mr-fg-thumb {
 width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
 object-fit: cover; background: var(--bg-light, #f4f6f9);
}
.mr-fg-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mr-fg-name {
 font-size: 11px; font-weight: 700; color: var(--text-dark, #222);
 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mr-fg-sub {
 font-size: 9px; color: var(--text-medium, #555);
 white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Plakietka i modal osób bez połączeń (widok „Cały graf") */
.mr-fg-excluded {
 position: absolute; bottom: 12px; left: 12px; z-index: 5;
 display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
 padding: 5px 11px; font-size: 12px; font-weight: 700;
 background: var(--bg-white, #fff); color: var(--text-medium, #555);
 border: 1px solid var(--border, #e0e4ea); border-radius: 999px;
 box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.mr-fg-excluded span { font-weight: 400; }
.mr-fg-excluded:hover { border-color: var(--primary, #213951); color: var(--primary, #213951); }
.mr-fg-modal-overlay {
 position: absolute; inset: 0; z-index: 20;
 display: flex; align-items: center; justify-content: center;
 background: rgba(15, 23, 35, .45);
}
/* display:flex wygrywałoby z atrybutem [hidden] — przywracamy jego działanie */
.mr-fg-modal-overlay[hidden] { display: none; }
.mr-fg-modal {
 display: flex; flex-direction: column; width: min(420px, 92%);
 max-height: min(70%, 480px); overflow: hidden;
 background: var(--bg-white, #fff); border-radius: var(--radius, 10px);
 box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.mr-fg-modal-head {
 display: flex; align-items: center; justify-content: space-between;
 padding: 14px 16px; border-bottom: 1px solid var(--border, #e0e4ea);
}
.mr-fg-modal-head h3 { margin: 0; font-size: 15px; color: var(--text-dark, #222); }
.mr-fg-modal-close {
 width: 30px; height: 30px; padding: 0; cursor: pointer; font-size: 20px; line-height: 1;
 background: transparent; border: none; color: var(--text-light, #888); border-radius: 6px;
}
.mr-fg-modal-close:hover { background: var(--bg-light, #f4f6f9); color: var(--text-dark, #222); }
.mr-fg-modal-list { display: flex; flex-direction: column; overflow-y: auto; padding: 8px; }
.mr-fg-modal-list button {
 display: flex; align-items: baseline; gap: 8px;
 padding: 9px 10px; text-align: start; cursor: pointer; font-size: 13px;
 background: transparent; border: none; border-radius: 6px;
 color: var(--text-dark, #222);
}
.mr-fg-modal-list button:hover { background: var(--bg-light, #f4f6f9); }
.mr-fg-modal-list small { color: var(--text-light, #888); font-size: 11px; }

/* Linia relacji przez >1 pokolenie — przerywana = podejrzane dane */
.mr-fg-edge--span { stroke-dasharray: 5 4; opacity: .75; }
/* Relacja nie-biologiczna (adopcja / piecza / przybrana) — linia kropkowana */
.mr-fg-edge--nonbio { stroke-dasharray: 1.5 3; opacity: .85; }

/* Kropki węzłów (realne połączenia wiązki) */
.mr-fg-dot { fill: var(--text-medium, #555); stroke: none; }

/* Tryb przodków (klik na osobę w „Całym grafie"): wyszarzenie nie-przodków */
.mr-fg-bar, .mr-fg-edge, .mr-fg-dot, .mr-fg-mlabel { transition: opacity .25s ease; }
.mr-fg-bar.is-dim { opacity: .22; filter: grayscale(1); }
.mr-fg-edge.is-dim, .mr-fg-dot.is-dim, .mr-fg-mlabel.is-dim { opacity: .07; }

/* Kursor klikalności kart w pozostałych widokach drzewa (family-chart) */
#FamilyChart .mr-card { cursor: pointer; }

/* ====================================================================
   Generator księgi genealogicznej ([myrootsbook])
   ==================================================================== */
.myroots-bookgen { width: 100%; max-width: var(--mr-content-width, 1200px); margin: 0 auto; padding: 20px; box-sizing: border-box; font-family: var(--mr-font, inherit); }

/* Formularz ustawień */
.mr-bk-form {
 background: var(--bg-white, #fff); border: 1px solid var(--border, #e0e4ea);
 border-left: 3px solid var(--primary, #213951);
 border-radius: var(--radius, 10px); padding: 18px 20px; margin-bottom: 24px;
 width: 100%; box-sizing: border-box;
 display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 28px;
 align-items: start;
}
.mr-bk-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mr-bk-field { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) { .mr-bk-form { grid-template-columns: 1fr; } }
.mr-bk-form__actions { display: flex; align-items: center; gap: 12px; padding-top: 4px; border-top: 1px solid var(--border, #e0e4ea); margin-top: 4px; }
.mr-bk-label { font-weight: 700; font-size: 13px; color: var(--text-dark, #222); }
.mr-bk-input {
 padding: 8px 12px; font-size: 14px; box-sizing: border-box; width: 100%;
 border: 1px solid var(--border, #e0e4ea); border-radius: var(--radius-sm, 8px);
 background: var(--bg-white, #fff); color: var(--text-dark, #222);
}
.mr-bk-input--num { width: 90px; }
.mr-bk-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-medium, #555); }
.mr-bk-modes { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.mr-bk-clans, .mr-bk-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.mr-bk-chip {
 display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
 padding: 5px 10px; font-size: 13px;
 background: var(--bg-light, #f4f6f9); border: 1px solid var(--border, #e0e4ea);
 border-radius: 999px;
}
.mr-bk-hint { margin: 0; font-size: 12px; color: var(--text-light, #888); }
.mr-bk-years { display: flex; gap: 14px; flex-wrap: wrap; }
.mr-bk-pick { position: relative; }
.mr-bk-pick-results {
 position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
 margin: 0; padding: 4px; list-style: none; max-height: 240px; overflow-y: auto;
 background: var(--bg-white, #fff); border: 1px solid var(--border, #e0e4ea);
 border-radius: var(--radius-sm, 8px); box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.mr-bk-pick-results li { padding: 7px 10px; cursor: pointer; border-radius: 6px; font-size: 14px; }
.mr-bk-pick-results li:hover { background: var(--bg-light, #f4f6f9); }
.mr-bk-pick-results li.is-empty { cursor: default; color: var(--text-light, #888); }
.mr-bk-btn {
 padding: 10px 20px; border: none; cursor: pointer; font-weight: 700; font-size: 14px;
 background: var(--primary, #213951); color: #fff; border-radius: var(--radius-sm, 8px);
}
.mr-bk-btn--ghost { background: transparent; color: var(--primary, #213951); border: 1px solid var(--primary, #213951); }
.mr-bk-status { font-size: 13px; color: var(--text-medium, #555); }

/* Kontener pomiarowy — poza ekranem, ale renderowany */
.mr-bk-flow { position: absolute; left: -99999px; top: 0; }

/* Księga — układ PŁYNNY (element po elemencie). Podgląd: arkusze jak kartki;
   druk: natywne łamanie stron przez przeglądarkę (bez sztywnych pudełek). */
.mr-bk-pages { display: block; }
.mr-bk-pages .mr-bk-sheet {
 background: #fff; max-width: 760px; margin: 0 auto 22px; padding: 48px 56px;
 box-sizing: border-box; box-shadow: 0 3px 18px rgba(0,0,0,.12); border-radius: 2px;
}
.mr-bk-sheet--cover {
 text-align: center; display: flex; flex-direction: column;
 justify-content: center; gap: 16px; min-height: 70vh;
}
.mr-bk-sheet--dedication { text-align: center; }
@media print {
 .mr-bk-pages { display: block; }
 .mr-bk-pages .mr-bk-sheet {
  max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0; min-height: 0;
 }
 .mr-bk-sheet--cover, .mr-bk-sheet--dedication, .mr-bk-sheet--toc, .mr-bk-sheet--index {
  break-after: page; page-break-after: always;
 }
 .mr-bk-chapter-head { break-before: page; page-break-before: always; }
 .mr-bk-person { break-before: page; page-break-before: always; }
 .mr-bk-person .person-section, .mr-bk-person .person-hero, .mr-bk-person .timeline-event {
  break-inside: avoid; page-break-inside: avoid;
 }
 .mr-bk-sheet .section-title, .mr-bk-chapter-title { break-after: avoid; }
}

/* Okładka i dedykacja */
.mr-bk-cover-rule { height: 3px; background: var(--primary, #213951); width: 40%; margin: 0 auto; }
.mr-bk-cover-title { font-size: 40px; margin: 10px 0; color: var(--primary, #213951); line-height: 1.2; }
.mr-bk-cover-sub { font-size: 16px; color: var(--text-medium, #555); margin: 0; }
.mr-bk-cover-count { font-size: 13px; color: var(--text-light, #888); margin: 0; }
.mr-bk-dedication { font-style: italic; font-size: 18px; text-align: center; color: var(--text-medium, #555); max-width: 70%; line-height: 1.7; }

/* Spis treści i indeks */
.mr-bk-toc-title { font-size: 24px; color: var(--primary, #213951); margin: 0 0 18px; }
.mr-bk-toc-row { display: flex; align-items: baseline; gap: 6px; font-size: 14px; padding: 5px 0; }
.mr-bk-index-cols { column-count: 2; column-gap: 36px; }
.mr-bk-index-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 3px 0; break-inside: avoid; }
.mr-bk-index-name small { color: var(--text-light, #888); }

/* Rozdziały */
.mr-bk-chapter-no { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-light, #888); }
.mr-bk-chapter-title { font-size: 28px; color: var(--primary, #213951); margin: 4px 0 14px; border-bottom: 2px solid var(--primary, #213951); padding-bottom: 8px; }
.mr-bk-chtree { width: 100%; height: auto; margin: 10px 0 6px; }
.mr-bk-chtree-bar { fill: var(--bg-light, #f4f6f9); stroke: var(--border, #cfd4dc); }
.mr-bk-chtree-bar.is-m { fill: color-mix(in srgb, var(--primary, #213951) 10%, #fff); stroke: var(--primary, #213951); }
.mr-bk-chtree-bar.is-f { fill: color-mix(in srgb, var(--accent, #b0413e) 10%, #fff); stroke: var(--accent, #b0413e); }
.mr-bk-chtree-name { font-size: 9.5px; fill: var(--text-dark, #222); }
.mr-bk-chtree-edge { fill: none; stroke: var(--text-light, #999); stroke-width: 1; }

/* Sekcja osoby w książce */
.mr-bk-person { margin: 0 0 14px; }

/* Przełączniki treści profilu (chowane PRZED paginacją) */
.mr-bk--no-bio .person-biography,
.mr-bk--no-photos .person-hero__photo,
.mr-bk--no-photos .person-section:has(.gallery-grid),
.mr-bk--no-lifeline .person-section:has([class*="lifeline"]),
.mr-bk--no-sources .person-section:has([class*="source"]) { display: none !important; }

/* Linia życia w księdze — kompaktowa. */
.mr-bk-sheet .lifeline-timeline { padding: 12px 0; }
.mr-bk-sheet .timeline-event { margin-bottom: 10px; }
.mr-bk-sheet .event-content { padding: 8px 12px; font-size: 12px; box-shadow: none; }
.mr-bk-sheet .event-content h1, .mr-bk-sheet .event-content h2,
.mr-bk-sheet .event-content h3, .mr-bk-sheet .event-content h4 { font-size: 13px; margin: 0 0 4px; }
.mr-bk-sheet .event-content p { margin: 2px 0; }

/* Etykiety przycisków paska drzewa — własny tooltip (natywny title nie
   wyświetla się m.in. w trybie pełnoekranowym) */
.tree-controls .mr-view-btn { position: relative; }
.tree-controls .mr-view-btn:hover::after {
 content: attr(title);
 position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
 white-space: nowrap; padding: 5px 10px; font-size: 12px; line-height: 1.2;
 background: var(--text-dark, #222); color: #fff; border-radius: 6px;
 box-shadow: 0 2px 8px rgba(0,0,0,.25);
 pointer-events: none; z-index: var(--z-tooltip, 1000);
}

/* Wiersz „Zakres" w generatorze księgi — pełna szerokość (długa lista rodów) */
.mr-bk-clans { max-height: 132px; overflow-y: auto; padding: 4px; border: 1px solid var(--border, #e0e4ea); border-radius: var(--radius-sm, 8px); }

/* Galeria: ta sama szerokość co lista osób, niezależnie od kolumny motywu —
   wyłamanie i wycentrowanie względem okna (kontener galerii jest centrowany). */
.myroots-people-list.myroots-shared-gallery {
 width: min(calc(100vw - 32px), var(--mr-content-width, 1200px));
 max-width: none;
 margin-left: auto;
 margin-right: auto;
}


/* ====================================================================
   Motywy blokowe (Gutenberg): układ „is-layout-constrained" zwęża KAŻDE
   dziecko treści do --wp--style--global--content-size (często ~640 px),
   ZANIM zadziałają max-width modułów wtyczki. Zdejmujemy ten limit z
   modułów MyRoots oraz z ich bezpośrednich opakowań blokowych —
   szerokością rządzą reguły wtyczki (i ustawienia z zakładki Wygląd).
   Dzięki temu NIE trzeba edytować plików motywu.
   ==================================================================== */
.is-layout-constrained > .myroots-bookgen,
.is-layout-constrained > .myroots-people-list,
.is-layout-constrained > .person-profile,
.is-layout-constrained > .myroots-shared-gallery,
.is-layout-constrained > .my-roots-wrapper,
.is-layout-constrained > .mr-stats,
.is-layout-constrained > .myroots-lifeline-container,
.is-layout-constrained > .myroots-events-timeline,
.is-layout-constrained > .my-roots-map-wrapper,
.is-layout-constrained > .myroots-kinship,
.is-layout-constrained > :where(:has(> .myroots-bookgen)),
.is-layout-constrained > :where(:has(> .myroots-people-list)),
.is-layout-constrained > :where(:has(> .person-profile)),
.is-layout-constrained > :where(:has(> .myroots-shared-gallery)),
.is-layout-constrained > :where(:has(> .my-roots-wrapper)),
.is-layout-constrained > :where(:has(> .mr-stats)),
.is-layout-constrained > :where(:has(> .myroots-lifeline-container)),
.is-layout-constrained > :where(:has(> .myroots-events-timeline)),
.is-layout-constrained > :where(:has(> .my-roots-map-wrapper)),
.is-layout-constrained > :where(:has(> .myroots-kinship)) {
 max-width: none;
}

/* ── Minimapa widoku „Cały graf" ──────────────────────────────────── */
.mr-fg-minimap {
 position: absolute; right: 12px; bottom: 12px; z-index: 6;
 padding: 4px; line-height: 0;
 background: var(--bg-white, #fff);
 border: 1px solid var(--border, #e0e4ea); border-radius: 8px;
 box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
#mrFullGraph .mr-fg-minimap-svg {
 display: block; cursor: pointer; border-radius: 4px;
 background: var(--bg-light, #f4f6f9);
}
#mrFullGraph .mr-fg-minimap-svg:active { cursor: grabbing; }
.mr-fg-minimap-vp {
 fill: color-mix(in srgb, var(--primary, #213951) 14%, transparent);
 stroke: var(--primary, #213951); stroke-width: 1.2;
 vector-effect: non-scaling-stroke; pointer-events: none;
}
.mr-fg-minimap.is-hidden { display: none; }
@media (prefers-reduced-motion: no-preference) {
 .mr-fg-minimap-vp { transition: x .1s linear, y .1s linear; }
}

/* Znacznik typu relacji rodzic–dziecko w profilu (adopcja/piecza/przybrany) */
.mr-rel-tag { color: var(--text-medium, #777); font-size: .88em; font-style: italic; }
