.aft-tree-shell {
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    margin: 20px 0;
}
.aft-tree-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #dcdcde;
    background: #f6f7f7;
}
.aft-tree-toolbar label {
    font-weight: 600;
}
.aft-tree-toolbar select,
.aft-tree-toolbar input {
    min-height: 34px;
}
.aft-tree-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    min-height: 520px;
}
.aft-tree-canvas {
    position: relative;
    overflow: auto;
    padding: 24px;
    min-height: 520px;
    background: linear-gradient(90deg, rgba(0,0,0,.03) 1px, transparent 1px), linear-gradient(rgba(0,0,0,.03) 1px, transparent 1px);
    background-size: 24px 24px;
}
.aft-tree-level {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 34px;
    flex-wrap: wrap;
}
.aft-tree-node {
    width: 180px;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    cursor: pointer;
    text-align: center;
}
.aft-tree-node:hover,
.aft-tree-node.is-active {
    border-color: #2271b1;
    box-shadow: 0 3px 14px rgba(34,113,177,.25);
}
.aft-tree-node-name {
    font-weight: 700;
    margin-bottom: 4px;
}
.aft-tree-node-dates {
    color: #646970;
    font-size: 12px;
}
.aft-tree-panel {
    border-left: 1px solid #dcdcde;
    padding: 16px;
    background: #fff;
    overflow: auto;
}
.aft-tree-panel h3 {
    margin-top: 0;
}
.aft-person-card-photo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    background: #f0f0f1;
    margin-bottom: 10px;
}
.aft-tree-empty,
.aft-tree-loading {
    padding: 30px;
    text-align: center;
    color: #646970;
}
@media (max-width: 900px) {
    .aft-tree-layout {
        grid-template-columns: 1fr;
    }
    .aft-tree-panel {
        border-left: 0;
        border-top: 1px solid #dcdcde;
    }
}

.aft-person-media-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.aft-person-media-item {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    text-decoration: none;
    background: #fff;
}

.aft-person-media-item img,
.aft-file-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #f6f7f7;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.aft-person-media-item strong,
.aft-person-media-item small {
    display: block;
}

.aft-person-media-item small {
    color: #646970;
}

/* Ancestoria 1.1.0 — lepszy widok drzewa na telefonach */
.aft-tree-toolbar .button,
.aft-tree-toolbar button {
    min-height: 38px;
}
.aft-tree-canvas {
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 700px) {
    .aft-tree-shell {
        border-radius: 8px;
        margin: 12px 0;
    }
    .aft-tree-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
    }
    .aft-tree-toolbar label {
        margin-top: 8px;
    }
    .aft-tree-toolbar select,
    .aft-tree-toolbar input,
    .aft-tree-toolbar .button,
    .aft-tree-toolbar button {
        width: 100%;
        max-width: 100%;
        min-height: 42px;
        font-size: 16px;
    }
    .aft-tree-layout {
        min-height: 0;
    }
    .aft-tree-canvas {
        min-height: 360px;
        padding: 14px;
        overflow-x: auto;
        background-size: 18px 18px;
    }
    .aft-tree-level {
        justify-content: flex-start;
        gap: 12px;
        margin-bottom: 18px;
        flex-wrap: nowrap;
        min-width: max-content;
    }
    .aft-tree-node {
        width: 148px;
        min-width: 148px;
        padding: 9px;
        border-radius: 9px;
    }
    .aft-tree-node-name {
        font-size: 14px;
        line-height: 1.25;
    }
    .aft-tree-node-dates {
        font-size: 11px;
    }
    .aft-tree-panel {
        max-height: none;
        padding: 14px;
    }
    .aft-person-media-item {
        grid-template-columns: 38px 1fr;
    }
    .aft-person-media-item img,
    .aft-file-icon {
        width: 38px;
        height: 38px;
    }
}

/* Ancestoria 1.2.0 — zoom, przesuwanie, zwijanie i druk */
.aft-tree-inner {
    transform-origin: 0 0;
    transition: transform .12s ease;
    min-width: max-content;
}
.aft-tree-canvas.is-dragging {
    cursor: grabbing;
    user-select: none;
}
.aft-tree-section h4 {
    text-align: center;
    margin: 0 0 12px;
}
.aft-tree-collapse {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}
.aft-tree-section.is-collapsed .aft-tree-level {
    display: none;
}
.aft-tree-node-toggle {
    float: right;
    color: #8c8f94;
}
@media print {
    body * { visibility: hidden; }
    .aft-tree-shell, .aft-tree-shell * { visibility: visible; }
    .aft-tree-shell { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
    .aft-tree-toolbar, .aft-tree-panel { display: none !important; }
    .aft-tree-layout { display: block; }
    .aft-tree-canvas { overflow: visible; background: #fff; }
}

/* Ancestoria 1.2.1 — układ pokoleniowy drzewa: dziadkowie -> rodzice -> osoba -> dzieci */
.aft-tree-generations .aft-tree-section {
    position: relative;
    padding-bottom: 10px;
}
.aft-tree-generations .aft-tree-section:not(:last-child)::after {
    content: "";
    display: block;
    width: 2px;
    height: 18px;
    margin: 4px auto 0;
    background: #c3c4c7;
}
.aft-tree-generations .aft-tree-section[data-section="root"] .aft-tree-node {
    border-width: 2px;
}
.aft-tree-generations .aft-tree-section[data-section^="ancestors"] .aft-tree-node,
.aft-tree-generations .aft-tree-section[data-section^="descendants"] .aft-tree-node {
    position: relative;
}
.aft-tree-generations .aft-tree-section[data-section="same-generation"] .aft-tree-node {
    background: #fdfdfd;
}
@media (max-width: 700px) {
    .aft-tree-generations .aft-tree-section h4 {
        text-align: left;
        white-space: nowrap;
    }
    .aft-tree-generations .aft-tree-section:not(:last-child)::after {
        margin-left: 72px;
        margin-right: 0;
    }
}

/* Ancestoria 1.2.2 — rodzina boczna: wujkowie, ciotki i kuzyni */
.aft-tree-generations .aft-tree-section[data-section="aunts-uncles"] .aft-tree-node,
.aft-tree-generations .aft-tree-section[data-section="cousins"] .aft-tree-node {
    background: #fbfbfc;
    border-style: dashed;
}
.aft-tree-generations .aft-tree-section[data-section="aunts-uncles"] h4,
.aft-tree-generations .aft-tree-section[data-section="cousins"] h4 {
    color: #50575e;
}


.aft-person-family-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; }
.aft-person-family-grid > div { border:1px solid rgba(0,0,0,.08); border-radius:8px; padding:8px; background:rgba(255,255,255,.65); }
.aft-person-family-grid ul, .aft-card-timeline { margin:6px 0 0 18px; }
.aft-muted { color:#777; }

/* Ancestoria 1.2.8 tree UX */
.aft-tree-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.aft-person-card-section { border-top: 1px solid rgba(0,0,0,.08); padding-top: 12px; margin-top: 12px; }
.aft-person-card-section h4 { margin: 0 0 8px; }
.aft-life-map-compact { position: relative; min-height: 170px; overflow: hidden; border: 1px solid rgba(0,0,0,.12); border-radius: 12px; background: linear-gradient(135deg, #eef6ff 0%, #f9fbf4 55%, #f4efe4 100%); }
.aft-life-map-pin { position: absolute; left: var(--aft-pin-x); top: var(--aft-pin-y); transform: translate(-50%, -50%); }
.aft-life-map-marker { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #2271b1; color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.22); }
.aft-life-map-label { display: none; position: absolute; left: 28px; top: 50%; transform: translateY(-50%); min-width: 160px; padding: 6px 8px; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); z-index: 2; }
.aft-life-map-pin:hover .aft-life-map-label { display: block; }

/* =========================================================
   Ancestoria 1.3.1 — nowoczesny widok drzewa genealogicznego
   ========================================================= */
.aft-tree-shell {
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #f8fafc;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.aft-tree-toolbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px;
    gap: 10px 12px;
}

.aft-tree-toolbar label {
    color: #374151;
    font-weight: 800;
    font-size: 13px;
}

.aft-tree-toolbar select,
.aft-tree-toolbar input[type="search"] {
    border: 1px solid #d1d5db;
    border-radius: 12px;
    min-height: 42px;
    padding: 8px 12px;
    background: #fff;
}

.aft-tree-toolbar input[type="search"] {
    min-width: 220px;
}

.aft-tree-toolbar .button,
.aft-tree-toolbar button {
    border-radius: 12px !important;
    min-height: 42px;
    font-weight: 800;
}

.aft-tree-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    min-height: 650px;
}

.aft-tree-canvas {
    min-height: 650px;
    padding: 34px;
    background-color: #f8fafc;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(37, 99, 235, 0.12) 1px, transparent 0);
    background-size: 26px 26px;
}

.aft-tree-generations .aft-tree-section h4 {
    color: #374151;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.aft-tree-level {
    gap: 18px;
    margin-bottom: 38px;
}

.aft-tree-node {
    width: 235px;
    min-width: 235px;
    border: 2px solid #d1d5db;
    border-radius: 18px;
    background: #ffffff;
    padding: 12px;
    text-align: left;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    position: relative;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, opacity .14s ease;
}

.aft-tree-node:hover,
.aft-tree-node.is-active {
    transform: translateY(-2px);
    border-color: #2563eb;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.22);
}

.aft-tree-node.is-public { border-color: #16a34a; }
.aft-tree-node.is-family { border-color: #2563eb; }
.aft-tree-node.is-limited { border-color: #f59e0b; }
.aft-tree-node.is-private { border-color: #dc2626; }

.aft-tree-node-main {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
}

.aft-tree-node-photo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.aft-tree-node-copy {
    min-width: 0;
}

.aft-tree-node-name {
    display: block;
    margin: 0 0 3px;
    font-size: 15px;
    line-height: 1.2;
    color: #111827;
}

.aft-tree-node-dates,
.aft-tree-node-life {
    display: block;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.25;
}

.aft-tree-node-privacy {
    display: inline-flex;
    margin-top: 10px;
    border-radius: 999px;
    padding: 4px 9px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
}

.aft-tree-node.is-public .aft-tree-node-privacy {
    background: #dcfce7;
    color: #166534;
}

.aft-tree-node.is-limited .aft-tree-node-privacy {
    background: #fef3c7;
    color: #92400e;
}

.aft-tree-node.is-private .aft-tree-node-privacy {
    background: #fee2e2;
    color: #991b1b;
}

.aft-tree-node-toggle {
    position: absolute;
    top: 8px;
    right: 10px;
    color: #9ca3af;
}

.aft-tree-node.is-filtered-out {
    opacity: .18;
    filter: grayscale(1);
}

.aft-tree-node.is-search-match {
    outline: 4px solid rgba(37, 99, 235, .18);
}

.aft-tree-panel {
    border-left: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 22px;
}

.aft-tree-panel h3 {
    font-size: 24px;
    color: #111827;
    margin: 8px 0 12px;
}

.aft-person-card-photo {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
}

.aft-tree-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.aft-tree-card-actions .button {
    border-radius: 12px !important;
    min-height: 38px;
    text-align: center;
}

.aft-tree-card-actions .aft-action-add-person {
    min-height: 44px;
    font-weight: 700;
}

.aft-person-card-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
    margin-top: 16px;
}

.aft-person-family-grid > div {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    padding: 10px;
}

@media (max-width: 1100px) {
    .aft-tree-layout {
        grid-template-columns: 1fr;
    }

    .aft-tree-panel {
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 700px) {
    .aft-tree-toolbar input[type="search"] {
        min-width: 0;
        width: 100%;
    }

    .aft-tree-canvas {
        padding: 16px;
        min-height: 430px;
    }

    .aft-tree-level {
        justify-content: flex-start;
        flex-wrap: nowrap;
        min-width: max-content;
    }

    .aft-tree-node {
        width: 205px;
        min-width: 205px;
    }

    .aft-tree-card-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Ancestoria 1.3.2 — full width tree page + display options
   ========================================================= */
body:has(.aft-tree-shell),
.site:has(.aft-tree-shell),
.site-content:has(.aft-tree-shell),
.content-area:has(.aft-tree-shell),
.entry-content:has(.aft-tree-shell),
.wp-block-post-content:has(.aft-tree-shell) {
    max-width: none !important;
    width: 100% !important;
}

.entry-content:has(.aft-tree-shell),
.wp-block-post-content:has(.aft-tree-shell) {
    padding-left: 32px !important;
    padding-right: 32px !important;
}

.aft-tree-shell {
    width: calc(100vw - 80px);
    max-width: 1760px;
    margin: 0 auto 40px;
}

.aft-tree-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    padding: 18px;
}

.aft-tree-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aft-tree-toolbar select,
.aft-tree-toolbar input[type="text"],
.aft-tree-toolbar input[type="search"] {
    min-height: 42px;
    border-radius: 12px !important;
    border: 1px solid #d1d5db !important;
    padding: 8px 12px !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.aft-tree-toolbar button,
.aft-tree-toolbar .button {
    min-height: 42px;
    border-radius: 12px !important;
    padding: 8px 14px !important;
    font-weight: 800 !important;
}

.aft-tree-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 4px 0;
}

.aft-tree-options label {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 8px 12px;
    color: #374151;
    font-size: 13px;
}

.aft-tree-options input {
    margin: 0;
}

.aft-tree-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    min-height: 700px;
}

.aft-tree-canvas {
    min-height: 700px;
    overflow: auto;
}

.aft-tree-empty,
.aft-tree-loading {
    min-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 22px;
    text-align: center;
    padding: 40px;
}

.aft-tree-hide-photos .aft-tree-node-photo {
    display: none !important;
}

.aft-tree-hide-photos .aft-tree-node-main {
    grid-template-columns: 1fr;
}

.aft-tree-hide-dates .aft-tree-node-life {
    display: none !important;
}

.aft-tree-node.is-option-hidden-living,
.aft-tree-node.is-option-hidden-private {
    display: none !important;
}

@media (max-width: 1100px) {
    .aft-tree-shell {
        width: calc(100vw - 32px);
    }

    .entry-content:has(.aft-tree-shell),
    .wp-block-post-content:has(.aft-tree-shell) {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .aft-tree-layout {
        grid-template-columns: 1fr;
    }

    .aft-tree-panel {
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 640px) {
    .aft-tree-shell {
        width: calc(100vw - 20px);
        border-radius: 16px;
    }

    .aft-tree-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .aft-tree-toolbar button,
    .aft-tree-toolbar .button,
    .aft-tree-toolbar select,
    .aft-tree-toolbar input[type="text"],
    .aft-tree-toolbar input[type="search"] {
        width: 100%;
    }

    .aft-tree-options {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* Ancestoria privacy model: Publiczna / Rodzinna / Prywatna */
.aft-tree-node-restricted {
    display: inline-flex;
    margin-top: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 800;
}

.aft-tree-node.is-private .aft-tree-node-photo {
    filter: grayscale(1);
    opacity: .7;
}

.aft-tree-node.is-private .aft-tree-node-name {
    color: #991b1b;
}

.aft-tree-node.is-family .aft-tree-node-privacy {
    background: #dbeafe;
    color: #1d4ed8;
}

.aft-tree-node.is-public .aft-tree-node-privacy {
    background: #dcfce7;
    color: #166534;
}

.aft-tree-node.is-private .aft-tree-node-privacy {
    background: #fee2e2;
    color: #991b1b;
}

/* Restricted person access requests */
.aft-restricted-access-actions {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 16px;
}
.aft-restricted-access-actions .button {
    margin: 6px 8px 0 0;
}
.aft-tree-access-request-notice {
    max-width: 1760px;
    margin: 0 auto 16px;
}

/* Ancestoria 1.5.1 — memories on person card */
.aft-person-card-memories{display:grid;gap:10px}.aft-person-card-memory{border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fff}.aft-person-card-memory small{display:block;color:#667085;margin-top:2px}.aft-person-card-memory audio{width:100%;margin-top:8px}.aft-person-card-memory p{margin:.45em 0}
/* Ancestoria - poprawka drzewa: prawa karta osoby + RWD */

.aft-tree-shell,
.aft-tree-shell * {
    box-sizing: border-box;
}

.aft-tree-shell {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.aft-tree-toolbar {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.aft-tree-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.aft-tree-canvas {
    min-width: 0;
    max-width: 100%;
    overflow: auto;
}

.aft-tree-inner {
    min-width: max-content;
}

.aft-tree-panel {
    width: 360px;
    max-width: 360px;
    min-width: 0;
    overflow: auto;
    word-break: break-word;
}

@media (max-width: 1200px) {
    .aft-tree-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .aft-tree-panel {
        width: 320px;
        max-width: 320px;
    }
}

@media (max-width: 900px) {
    .aft-tree-layout {
        display: block;
    }

    .aft-tree-canvas {
        width: 100%;
        min-height: 420px;
        max-height: 70vh;
    }

    .aft-tree-inner {
        min-width: 720px;
    }

    .aft-tree-panel {
        width: 100%;
        max-width: 100%;
        border-left: 0;
        border-top: 1px solid #dcdcde;
    }
}
/* Ancestoria 1.5.8-card-ux — premium prawa karta osoby */
.aft-tree-panel {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 48%);
    padding: 18px;
}
.aft-person-premium-card,
.aft-person-premium-section {
    border: 1px solid #dbe6f6;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    padding: 16px;
    margin: 0 0 14px;
}
.aft-person-premium-header {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}
.aft-person-premium-photo {
    width: 94px;
    height: 94px;
    object-fit: cover;
    border-radius: 28px;
    background: #eef2f7;
    border: 1px solid #dbe6f6;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .12);
}
.aft-person-premium-card h3 {
    font-size: 24px;
    line-height: 1.12;
    margin: 0 0 8px;
    color: #13223a;
}
.aft-person-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 9px;
}
.aft-person-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    background: #eef5ff;
    color: #1d4ed8;
}
.aft-person-badge.is-status { background: #ecfdf5; color: #047857; }
.aft-person-badge.is-privacy { background: #eff6ff; color: #1d4ed8; }
.aft-person-premium-meta {
    display: grid;
    gap: 4px;
    color: #475569;
    font-size: 13px;
}
.aft-person-premium-actions {
    display: grid;
    gap: 9px;
    margin-top: 15px;
}
.aft-person-premium-actions .button {
    border-radius: 12px !important;
    min-height: 42px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
}
.aft-person-premium-actions .aft-person-primary-action {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border-color: #1d4ed8 !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .24);
}
.aft-person-premium-actions .aft-person-secondary-action {
    background: #fff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}
.aft-person-premium-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #172033;
    font-size: 15px;
}
.aft-person-premium-section h4 span {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
}
.aft-person-family-list { display: grid; gap: 8px; }
.aft-person-family-row {
    border: 1px solid #edf2f7;
    border-radius: 13px;
    background: #fbfdff;
    overflow: hidden;
}
.aft-person-family-row summary {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    color: #1e293b;
}
.aft-person-family-row summary::-webkit-details-marker { display: none; }
.aft-card-row-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: #eff6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.aft-person-family-row summary strong,
.aft-person-resource-tile small {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.aft-person-card-mini-list {
    margin: 0;
    padding: 0 12px 10px 50px;
    color: #475569;
}
.aft-person-card-mini-list li { margin: 4px 0; }
.aft-card-timeline-premium {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.aft-card-timeline-premium li {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    position: relative;
    padding: 0 0 13px 20px;
}
.aft-card-timeline-premium li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}
.aft-card-timeline-premium li::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 17px;
    bottom: 2px;
    width: 1px;
    background: #bfdbfe;
}
.aft-card-timeline-premium li:last-child::after { display: none; }
.aft-card-timeline-premium time { color: #334155; font-size: 12px; }
.aft-card-timeline-premium strong { display: block; color: #172033; }
.aft-card-timeline-premium small { display: block; color: #64748b; margin-top: 2px; }
.aft-person-section-actions { display: grid; grid-template-columns: 1fr; margin-top: 8px; }
.aft-person-resources-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.aft-person-resource-tile {
    border: 1px solid #e5edf8;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 12px 8px;
    display: grid;
    justify-items: center;
    gap: 5px;
    text-align: center;
}
.aft-person-resource-tile > span { font-size: 23px; }
.aft-person-resource-tile strong { font-size: 12px; color: #172033; }
.aft-person-media-list-compact { margin-top: 10px; }
.aft-person-card-memories-premium .aft-person-card-memory {
    background: linear-gradient(135deg, #ffffff 0%, #f3f7ff 100%);
    border-color: #e1eaff;
}
.aft-citation-card-list {
    display: grid;
    gap: 9px;
}
.aft-citation-card-list article {
    border: 1px solid #e5edf8;
    border-radius: 13px;
    background: #fbfdff;
    padding: 10px;
}
.aft-citation-card-list strong,
.aft-citation-card-list small { display: block; }
.aft-citation-card-list small { color: #64748b; margin-top: 3px; }
.aft-citation-card-list p { margin: 7px 0 0; color: #475569; }
.aft-person-info-grid {
    display: grid;
    gap: 9px;
}
.aft-person-info-grid > div,
.aft-person-dna-grave-box {
    border: 1px solid #e5edf8;
    border-radius: 13px;
    padding: 10px;
    background: #fbfdff;
}
.aft-person-info-grid strong,
.aft-person-info-grid span,
.aft-person-info-grid small { display: block; }
.aft-person-info-grid span { color: #172033; margin-top: 4px; }
.aft-person-info-grid small { color: #64748b; }
.aft-person-contact-row { display: grid; gap: 6px; margin-top: 10px; }
.aft-person-contact-row a { color: #1d4ed8; text-decoration: none; }
.aft-person-card-bio {
    margin-top: 10px;
    color: #475569;
    line-height: 1.5;
}
.aft-person-dna-grave-grid { display: grid; gap: 10px; }
.aft-person-dna-grave-box p { margin: 7px 0 0; color: #475569; }
.aft-person-completeness {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
}
.aft-person-completeness-ring {
    --aft-completeness: 0%;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: conic-gradient(#2563eb var(--aft-completeness), #e5e7eb 0);
    display: grid;
    place-items: center;
    position: relative;
}
.aft-person-completeness-ring::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #fff;
}
.aft-person-completeness-ring strong {
    position: relative;
    z-index: 1;
    color: #172033;
    font-size: 22px;
}
.aft-person-completeness ul { margin: 6px 0 0 18px; color: #475569; }
.aft-person-card-updated {
    color: #94a3b8;
    font-size: 12px;
    margin: 10px 2px 0;
}
@media (max-width: 900px) {
    .aft-person-premium-header { grid-template-columns: 74px 1fr; }
    .aft-person-premium-photo { width: 74px; height: 74px; border-radius: 22px; }
    .aft-person-premium-card h3 { font-size: 20px; }
    .aft-person-completeness { grid-template-columns: 1fr; }
}

/* Ancestoria 1.5.9 — nowoczesny nagłówek i panel filtrów zgodny z kartą osoby */
.aft-tree-shell-modern {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}
.aft-tree-app-header {
    padding: 26px 28px 10px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.aft-tree-app-header h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1.08;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.aft-tree-app-header p {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 16px;
}
.aft-tree-toolbar-modern {
    display: grid;
    grid-template-columns: minmax(420px, 1.35fr) minmax(280px, .8fr) minmax(360px, 1fr);
    gap: 22px;
    align-items: start;
    padding: 18px 22px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}
.aft-toolbar-block {
    min-width: 0;
}
.aft-toolbar-block h3,
.aft-tree-options-modern strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}
.aft-toolbar-block h3 span,
.aft-tree-options-modern strong::before {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 14px;
}
.aft-tree-options-modern strong::before {
    content: "☷";
}
.aft-toolbar-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 12px;
}
.aft-toolbar-fields label,
.aft-toolbar-search label:not(.screen-reader-text) {
    display: grid;
    gap: 7px;
    margin: 0;
    color: #172033;
    font-weight: 700;
    font-size: 12px;
}
.aft-toolbar-fields label > span {
    display: block;
}
.aft-tree-toolbar-modern select,
.aft-tree-toolbar-modern input[type="search"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    padding: 0 13px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.aft-tree-toolbar-modern select:focus,
.aft-tree-toolbar-modern input[type="search"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
    outline: none;
}
.aft-toolbar-search-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 10px;
}
.aft-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.aft-tree-toolbar-modern .button,
.aft-tree-toolbar-modern button {
    min-height: 44px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #0f172a !important;
    padding: 0 16px !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.aft-tree-toolbar-modern .button:hover,
.aft-tree-toolbar-modern button:hover {
    transform: translateY(-1px);
    border-color: #93c5fd !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08) !important;
}
.aft-tree-toolbar-modern .aft-toolbar-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border-color: #1d4ed8 !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .24) !important;
}
.aft-tree-toolbar-modern .aft-icon-button {
    width: 44px;
    padding: 0 !important;
    font-size: 18px !important;
}
.aft-tree-options-modern {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 2px;
}
.aft-tree-options-modern strong {
    margin: 0 4px 0 0;
}
.aft-tree-options-modern label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f8fbff;
    color: #172033;
    font-weight: 700;
    cursor: pointer;
}
.aft-tree-options-modern input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2563eb;
}
.aft-tree-shell-modern .aft-tree-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
}
.aft-tree-shell-modern .aft-tree-canvas {
    min-height: 620px;
    background-color: #fbfdff;
    background-image: radial-gradient(circle, rgba(37, 99, 235, .16) 1px, transparent 1px);
    background-size: 26px 26px;
}
.aft-tree-shell-modern .aft-tree-panel {
    border-left: 1px solid #e2e8f0;
    background: #fbfdff;
    padding: 18px;
}
.aft-tree-shell-modern .aft-tree-node {
    border-color: #bfdbfe;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}
.aft-tree-shell-modern .aft-tree-node:hover,
.aft-tree-shell-modern .aft-tree-node.is-active {
    border-color: #2563eb;
    box-shadow: 0 18px 35px rgba(37, 99, 235, .18);
}
@media (max-width: 1200px) {
    .aft-tree-toolbar-modern {
        grid-template-columns: 1fr 1fr;
    }
    .aft-toolbar-tools {
        grid-column: 1 / -1;
    }
}
@media (max-width: 900px) {
    .aft-tree-app-header {
        padding: 20px 16px 8px;
    }
    .aft-tree-toolbar-modern {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 16px;
    }
    .aft-toolbar-fields,
    .aft-toolbar-search-row {
        grid-template-columns: 1fr;
    }
    .aft-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .aft-tree-toolbar-modern .aft-icon-button {
        width: 100%;
    }
    .aft-tree-options-modern {
        align-items: stretch;
    }
    .aft-tree-options-modern strong {
        width: 100%;
    }
    .aft-tree-options-modern label {
        flex: 1 1 160px;
        justify-content: center;
    }
    .aft-tree-shell-modern .aft-tree-layout {
        grid-template-columns: 1fr;
    }
    .aft-tree-shell-modern .aft-tree-panel {
        border-left: 0;
        border-top: 1px solid #e2e8f0;
    }
}

/* Ancestoria 1.5.9 - correction request modal */
.aft-correction-modal{position:fixed;inset:0;z-index:99999;display:none;align-items:center;justify-content:center;padding:24px;font-family:inherit;color:#111827;}
.aft-correction-modal.is-open{display:flex;}
.aft-correction-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(4px);}
.aft-correction-dialog{position:relative;width:min(760px,calc(100vw - 32px));max-height:calc(100vh - 48px);overflow:auto;background:#fff;border:1px solid #e5e7eb;border-radius:22px;box-shadow:0 24px 80px rgba(15,23,42,.24);padding:24px;}
.aft-correction-close{position:absolute;top:14px;right:14px;width:36px;height:36px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;color:#374151;font-size:24px;line-height:1;cursor:pointer;}
.aft-correction-close:hover{background:#f8fafc;color:#111827;}
.aft-correction-head{display:flex;gap:14px;align-items:flex-start;margin:0 40px 20px 0;}
.aft-correction-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:16px;background:#eff6ff;color:#2563eb;font-size:22px;flex:0 0 auto;}
.aft-correction-head h3{margin:0 0 4px;font-size:24px;line-height:1.2;color:#0f172a;}
.aft-correction-head p{margin:0;color:#64748b;font-size:14px;line-height:1.5;}
.aft-correction-form{display:grid;gap:14px;}
.aft-correction-person{border:1px solid #dbeafe;background:linear-gradient(180deg,#f8fbff,#fff);border-radius:16px;padding:12px 14px;}
.aft-correction-person small{display:block;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:700;font-size:11px;margin-bottom:3px;}
.aft-correction-person strong{display:block;color:#0f172a;font-size:16px;}
.aft-correction-form label{display:grid;gap:6px;margin:0;font-weight:600;color:#111827;font-size:14px;}
.aft-correction-form label span{font-weight:700;color:#1f2937;}
.aft-correction-form input,.aft-correction-form select,.aft-correction-form textarea{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:12px;background:#fff;color:#111827;padding:11px 12px;font:inherit;line-height:1.4;box-shadow:0 1px 2px rgba(15,23,42,.04);}
.aft-correction-form textarea{resize:vertical;min-height:76px;}
.aft-correction-form input:focus,.aft-correction-form select:focus,.aft-correction-form textarea:focus{outline:2px solid rgba(37,99,235,.16);border-color:#2563eb;}
.aft-correction-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.aft-correction-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:8px;border-top:1px solid #e5e7eb;margin-top:4px;}
.aft-correction-actions .button{border-radius:12px;padding:10px 16px;height:auto;font-weight:700;}
.aft-correction-actions .button-primary{background:#2563eb;border-color:#2563eb;color:#fff;}
.aft-correction-status{min-height:20px;font-size:14px;font-weight:600;}
.aft-correction-status.is-loading{color:#2563eb;}
.aft-correction-status.is-success{color:#15803d;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:12px;padding:10px 12px;}
.aft-correction-status.is-error{color:#b91c1c;background:#fef2f2;border:1px solid #fecaca;border-radius:12px;padding:10px 12px;}
.aft-person-premium-actions .aft-action-correction{cursor:pointer;}
@media (max-width:700px){.aft-correction-modal{padding:12px;align-items:flex-end}.aft-correction-dialog{width:100%;max-height:92vh;border-radius:20px 20px 0 0;padding:20px}.aft-correction-grid{grid-template-columns:1fr}.aft-correction-actions{flex-direction:column-reverse}.aft-correction-actions .button{width:100%;justify-content:center;text-align:center}}


/* Ancestoria 1.5.9.7 — oznaczenie osoby zmarłej */
.aft-tree-node-main{position:relative;}
.aft-person-premium-header-with-ribbon{position:relative;}
.aft-black-ribbon{display:inline-block;position:absolute;z-index:4;width:24px;height:24px;pointer-events:none;}
.aft-black-ribbon::before,.aft-black-ribbon::after{content:"";position:absolute;left:10px;top:2px;width:7px;height:22px;background:#111827;border-radius:8px;box-shadow:0 1px 2px rgba(15,23,42,.25);}
.aft-black-ribbon::before{transform:rotate(38deg);}
.aft-black-ribbon::after{transform:rotate(-38deg);}
.aft-black-ribbon-node{left:28px;top:-8px;transform:scale(.72);}
.aft-black-ribbon-card{left:42px;top:4px;}
.aft-tree-node.is-deceased .aft-tree-node-photo{filter:grayscale(.45);}


/* Ancestoria 1.5.9.10 — mapa relacji: wszystkie osoby są na jednym płótnie, a widoczność zależy od zoomu i przesunięcia okna. */
.aft-tree-canvas {
    overflow: hidden;
    cursor: grab;
}
.aft-tree-canvas.is-dragging {
    cursor: grabbing;
}
.aft-tree-inner.aft-tree-map {
    position: relative;
    transform-origin: 0 0;
    transition: transform .12s ease-out;
    min-width: 900px;
    min-height: 520px;
}
.aft-tree-map .aft-tree-node {
    position: absolute;
    z-index: 3;
    width: 190px;
    min-height: 94px;
    text-align: left;
}
.aft-tree-map .aft-tree-node-main {
    display: flex;
    align-items: center;
    gap: 10px;
}
.aft-tree-map-links {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: visible;
}
.aft-tree-map-link {
    stroke: #9bbcf5;
    stroke-width: 1.4;
    vector-effect: non-scaling-stroke;
}
.aft-tree-map-link.is-partner {
    stroke-dasharray: 5 5;
    stroke: #a78bfa;
}
.aft-tree-map-link.is-sibling {
    stroke-dasharray: 3 6;
    stroke: #93c5fd;
}
.aft-tree-map-link-label {
    fill: #64748b;
    font-size: 10px;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 4px;
    stroke-linejoin: round;
}
.aft-person-family-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    padding: 2px 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.aft-person-family-link:hover,
.aft-person-family-link:focus {
    color: #0f172a;
    text-decoration: underline;
}
.aft-black-ribbon-node {
    left: 34px;
    top: -5px;
    transform: scale(.5);
    opacity: .78;
}
.aft-black-ribbon::before,
.aft-black-ribbon::after {
    width: 5px;
    height: 18px;
    left: 10px;
    top: 3px;
}

/* Ancestoria 1.5.9.11 — czytelny układ rodzinny: para obok siebie + zoom kółkiem */
.aft-tree-canvas {
    cursor: grab;
    overflow: hidden;
    touch-action: none;
}

.aft-tree-canvas.is-dragging {
    cursor: grabbing;
}

.aft-tree-inner.aft-tree-map {
    transform-origin: 0 0;
    transition: transform .06s linear;
    min-width: 1100px;
    min-height: 620px;
}

.aft-tree-map .aft-tree-node {
    width: 235px;
    min-width: 235px;
    min-height: 112px;
}

.aft-tree-map-link {
    fill: none;
    stroke: #9bbcf5;
    stroke-width: 1.25;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aft-tree-map-link.is-parent-child {
    stroke: #93baf7;
}

.aft-tree-map-link.is-partner {
    stroke: #64748b;
    stroke-width: 1.6;
    stroke-dasharray: none;
}

.aft-tree-map-link-label {
    display: none;
}

/* Ancestoria 1.5.9.20 — czytelniejsze relacje genealogiczne
   Linie ciągłe = relacje pokoleniowe rodzic/dziecko.
   Linie przerywane = rodzeństwo/powiązania boczne.
   Małżonkowie/partnerzy są prawie na styk jako jedna jednostka rodzinna. */
.aft-tree-inner.aft-tree-map {
    min-width: 1200px;
    min-height: 680px;
}

.aft-tree-map-link {
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aft-tree-map-link.is-parent-child {
    stroke: #8fb4f8;
    stroke-width: 1.45;
    stroke-dasharray: none;
}

.aft-tree-map-link.is-sibling {
    stroke: #93c5fd;
    stroke-width: 1.15;
    stroke-dasharray: 4 8;
    opacity: .8;
}

.aft-tree-map-link.is-partner {
    stroke: #334155;
    stroke-width: 1.8;
    stroke-dasharray: none;
    opacity: .85;
}


/* Ancestoria 1.6 — minimalistyczny kafelek osoby: zdjęcie, imię i nazwisko, symbole, daty tylko dla zmarłych, kokarda i gwiazdki kompletności. */
.aft-tree-node.aft-tree-node-minimal{
    width: 164px;
    min-width: 164px;
    min-height: 184px;
    padding: 12px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: center;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}
.aft-tree-node.aft-tree-node-minimal:hover,
.aft-tree-node.aft-tree-node-minimal.is-active{
    transform: none;
    border-color: #2563eb;
    box-shadow: 0 14px 32px rgba(37, 99, 235, .18);
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-main{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex: 1 1 auto;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-photo-wrap{
    position: relative;
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-photo{
    width: 66px;
    height: 66px;
    border-radius: 20px;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
    margin: 0;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-photo.is-placeholder{
    font-size: 30px;
    color: #94a3b8;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-copy{
    width: 100%;
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 3px;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-name{
    margin: 0;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.18;
    color: #0f172a;
    font-weight: 900;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-dates{
    display: block;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-life,
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-privacy{
    display: none !important;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-symbols{
    min-height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-symbols:empty{
    display: none;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-stars{
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #eef2f7;
    display: flex;
    justify-content: center;
    gap: 1px;
    font-size: 13px;
    line-height: 1;
    letter-spacing: .02em;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-stars .is-filled{color:#f59e0b;}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-stars .is-empty{color:#cbd5e1;}
.aft-tree-node.aft-tree-node-minimal .aft-black-ribbon-node{
    right: -5px;
    top: -6px;
    left: auto;
    width: 16px;
    height: 16px;
    transform: scale(.58);
    opacity: .88;
}
.aft-tree-node.aft-tree-node-minimal .aft-black-ribbon::before,
.aft-tree-node.aft-tree-node-minimal .aft-black-ribbon::after{
    background: #111827;
    box-shadow: 0 1px 2px rgba(15,23,42,.18);
}
.aft-tree-node.aft-tree-node-minimal.is-deceased .aft-tree-node-photo{filter:grayscale(.35);}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-toggle{
    top: 7px;
    right: 8px;
    font-size: 10px;
    color: #94a3b8;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-status.is-pending{
    margin-top: 6px;
    border-radius: 999px;
    padding: 3px 7px;
    background:#fff7ed;
    color:#c2410c;
    font-size:10px;
    font-weight:900;
}
.aft-tree-node.aft-tree-node-minimal .aft-tree-node-restricted{
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.25;
    color: #64748b;
}
@media(max-width:700px){
    .aft-tree-node.aft-tree-node-minimal{width:150px;min-width:150px;min-height:176px;}
    .aft-tree-node.aft-tree-node-minimal .aft-tree-node-photo-wrap,
    .aft-tree-node.aft-tree-node-minimal .aft-tree-node-photo{width:60px;height:60px;}
}


/* Ancestoria 1.6.4 – przycisk pamięci / przyszły sklep WooCommerce */
.aft-person-memory-action {
    width: 100%;
    margin-top: 8px;
}
.aft-person-memory-action .aft-action-memory,
.aft-action-memory {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid #f3d1df;
    background: linear-gradient(180deg, #fff7fb 0%, #fff 100%);
    color: #9f1239;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(159, 18, 57, .08);
}
.aft-person-memory-action .aft-action-memory:hover,
.aft-action-memory:hover {
    border-color: #e11d48;
    color: #881337;
    transform: translateY(-1px);
}
.aft-memory-shop-notice {
    margin: 0 0 18px;
}

/* Ancestoria 1.6.8 — tryb pełnego ekranu drzewa. */
body.aft-tree-fullscreen-active {
    overflow: hidden !important;
}
.aft-tree-shell.is-aft-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
}
.aft-tree-shell.is-aft-fullscreen .aft-tree-app-header {
    display: none !important;
}
.aft-tree-shell.is-aft-fullscreen .aft-tree-toolbar {
    flex: 0 0 auto !important;
    border-radius: 0 !important;
}
.aft-tree-shell.is-aft-fullscreen .aft-tree-layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    grid-template-columns: minmax(0, 1fr) 390px !important;
}
.aft-tree-shell.is-aft-fullscreen .aft-tree-canvas {
    min-height: 0 !important;
    height: 100% !important;
}
.aft-tree-shell.is-aft-fullscreen .aft-tree-panel {
    height: 100% !important;
    overflow: auto !important;
}
@media (max-width: 900px) {
    .aft-tree-shell.is-aft-fullscreen .aft-tree-layout {
        grid-template-columns: 1fr !important;
    }
}
