/* People module */
.people-layout {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 450px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    background: var(--surface-main);
}

.people-layout.preview-collapsed {
    grid-template-columns: minmax(0, 1fr) 54px;
}

.people-content {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: var(--space-4);
    gap: var(--space-3);
    overflow: hidden;
}

.people-directory-controls {
    min-width: 0;
    display: grid;
    gap: var(--space-3);
}

.people-toolbar-slot {
    min-width: 0;
    min-height: 44px;
    display: grid;
    align-items: stretch;
}

.people-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) max-content max-content minmax(190px, 220px) max-content;
    gap: var(--space-3);
    align-items: center;
    min-width: 0;
}

.people-search-field {
    width: 100%;
    max-width: none;
    flex: none;
}

.people-bulk-toolbar {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.people-bulk-summary {
    flex: 0 0 auto;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
}

.people-bulk-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.people-bulk-actions .button {
    white-space: nowrap;
}

#addPeoplePerson {
    white-space: nowrap;
    min-width: 158px;
    justify-content: center;
}

/* Shared project-wide Sort control */

.app-sort-field {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    height: 44px;

    flex: 0 1 auto;

    display: inline-flex;
    align-items: center;
}

.app-sort-trigger {
    width: fit-content;
    max-width: 100%;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease),
        box-shadow var(--ease);
}

.app-sort-trigger:hover {
    border-color: var(--border-strong);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.app-sort-trigger:focus-visible {
    outline: 0;
    border-color: rgba(98, 217, 154, .55);
    box-shadow: 0 0 0 3px rgba(98, 217, 154, .1);
}

.app-sort-trigger[aria-expanded="true"] {
    border-color: rgba(98, 217, 154, .55);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.app-sort-icon,
.app-sort-chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
}

.app-sort-icon svg,
.app-sort-chevron svg {
    width: 18px;
    height: 18px;
    display: block;
}

.app-sort-icon svg {
    transition: transform var(--ease);
}

.app-sort-icon.is-ascending svg {
    transform: rotate(180deg);
}

.app-sort-current {
    min-width: 0;
    flex: 0 1 auto;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    text-align: left;
}

.app-sort-chevron {
    margin-left: 0;
}

.app-sort-chevron svg {
    width: 16px;
    height: 16px;
    transform: rotate(90deg);
    transition: transform var(--ease);
}

.app-sort-trigger[aria-expanded="true"] .app-sort-chevron svg {
    transform: rotate(-90deg);
}

.app-sort-popover {
    width: min(280px, calc(100vw - 24px));
    padding: var(--space-2);
}

.app-sort-popover-section+.app-sort-popover-section {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-default);
}

.app-sort-popover-title {
    padding: 5px 10px 7px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.app-sort-popover-group {
    display: grid;
    gap: 2px;
}

.app-sort-option {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.app-sort-option:hover,
.app-sort-option:focus-visible {
    outline: 0;
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.app-sort-option[aria-checked="true"] {
    background: rgba(98, 217, 154, .1);
    color: var(--brand-green-300);
}

.app-sort-option-check {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.app-sort-option-check svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 620px) {
    .app-sort-field {
        width: 44px;
        max-width: 44px;
        flex: 0 0 44px;
    }

    .app-sort-trigger {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        padding: 0;
    }

    .app-sort-current,
    .app-sort-chevron {
        display: none;
    }
}

.search-input {
    height: 42px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--border-default);
    background: var(--surface-input);
    border-radius: var(--radius-md);
    padding: 0 var(--space-3);
    color: var(--text-tertiary);
}

.search-input svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--text-tertiary);
}

.search-input input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
}

.search-input input::placeholder {
    color: var(--text-tertiary);
}

.people-filterbar {
    border: 1px solid var(--border-default);
    background: rgba(21, 26, 26, .72);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.filter-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-secondary);
    padding: 0 10px;
    font-weight: 700;
    font-size: 13px;
}

.filter-chip button {
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.filter-spacer {
    flex: 1;
}

.active-filter-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex: 0 0 auto;
    white-space: nowrap;
}

.people-save-view {
    min-height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    font-weight: 800;
    letter-spacing: .01em;
}

.people-save-view:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.people-nav-unavailable {
    color: var(--text-tertiary);
    opacity: .58;
    cursor: default;
}

.people-nav-unavailable svg {
    color: var(--text-tertiary);
}

.people-nav-unavailable:hover {
    background: transparent;
    color: var(--text-tertiary);
}

.people-nav-unavailable:hover svg {
    color: var(--text-tertiary);
}

.people-nav-unavailable .people-review-count {
    background: rgba(127, 138, 134, .10);
    border-color: rgba(127, 138, 134, .18);
    color: var(--text-tertiary);
}

.people-review-count {
    margin-left: auto;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(212, 170, 107, .18);
    border: 1px solid rgba(212, 170, 107, .28);
    color: var(--amber);
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
}

.people-saved-filter-row {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease);
}

.people-saved-filter-row:hover {
    background: rgba(255, 255, 255, .035);
}

.people-saved-filter-row.active {
    background: var(--surface-selected);
    border-color: rgba(98, 217, 154, .12);
}

.people-saved-filter-main {
    min-width: 0;
    min-height: 42px;
    flex: 1 1 auto;
    padding: 0 var(--space-3);
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-align: left;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
}

.people-saved-filter-main svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: var(--text-tertiary);
}

.people-saved-filter-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.people-saved-filter-row.active .people-saved-filter-main {
    color: var(--text-primary);
}

.people-saved-filter-row.active .people-saved-filter-main svg {
    color: var(--brand-green-300);
}

.people-saved-filter-more {
    flex: 0 0 34px;
    margin: 0 var(--space-2) 0 0;
    opacity: 0;
    transition: opacity var(--ease);
}

.people-saved-filter-row:hover .people-saved-filter-more,
.people-saved-filter-row:focus-within .people-saved-filter-more,
.people-saved-filter-row.active .people-saved-filter-more {
    opacity: 1;
}

.people-filter-delete-copy {
    padding: var(--space-4);
    border: 1px solid rgba(212, 107, 107, .24);
    border-radius: var(--radius-sm);
    background: rgba(212, 107, 107, .08);
    color: #f0b8b8;
}

.people-delete-confirm-copy {
    display: grid;
    gap: var(--space-3);
    color: var(--text-secondary);
}

.people-delete-confirm-copy p,
.people-delete-confirm-copy ul {
    margin: 0;
}

.people-delete-confirm-copy ul {
    display: grid;
    gap: 6px;
    padding-left: 20px;
    color: var(--text-primary);
}

.people-delete-remaining {
    color: var(--text-tertiary);
    font-size: 13px;
}

.people-filter-button {
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease),
        box-shadow var(--ease);
}

.people-filter-button:hover {
    border-color: var(--border-strong);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.people-filter-button:focus-visible {
    border-color: rgba(98, 217, 154, .55);
    outline: 0;
    box-shadow:
        0 0 0 3px rgba(98, 217, 154, .1);
}

.people-filter-button.active {
    border-color: rgba(98, 217, 154, .38);
    background: var(--surface-selected);
    color: var(--brand-green-300);
}

.people-filter-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
}

.people-filter-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.people-filter-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand-green-500);
    color: var(--brand-green-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.active-filter-chip {
    min-height: 34px;
    padding: 4px 5px 4px 10px;
    border-color: rgba(98, 217, 154, .22);
    background: rgba(47, 174, 116, .08);
    color: var(--text-secondary);
    gap: var(--space-2);
}

.active-filter-chip-copy {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.active-filter-chip strong {
    color: var(--text-primary);
    font-weight: 900;
}

.active-filter-chip-remove {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition:
        background var(--ease),
        color var(--ease);
}

.active-filter-chip-remove:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--text-primary);
}

.active-filter-chip-remove:focus-visible {
    outline: 2px solid var(--brand-green-400);
    outline-offset: 1px;
}

.active-filter-chip-remove svg {
    width: 14px;
    height: 14px;
    display: block;
}

.people-filter-popover {
    position: fixed;
    width: 360px;
    z-index: 95;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.people-filter-popover-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
}

.people-filter-popover-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.people-filter-popover-header p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.people-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.people-filter-popover>.people-filter-grid {
    padding: var(--space-4);
}

.people-filter-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.people-filter-field.full {
    grid-column: 1 / -1;
}

.people-filter-field label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
}

.people-filter-field select,
.people-filter-field input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background-color: var(--surface-input);
    color: var(--text-primary);
    padding: 0 34px 0 10px;
    outline: 0;
    appearance: none;
    font-weight: 700;
}

.people-filter-field select {
    background-image: var(--select-chevron);
    background-position: calc(100% - 17px) center;
    background-size: 12px 7px;
    background-repeat: no-repeat;
}

.people-filter-field select:hover,
.people-filter-field input:hover {
    border-color: var(--border-strong);
    background-color: var(--surface-card-hover);
}

.people-filter-footer {
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.people-filter-footer .button {
    min-height: 38px;
    letter-spacing: .01em;
}

/* ---------- Shared module filters ---------- */

.shared-filter-panel {
    position: fixed;
    z-index: 95;
    width: min(460px, calc(100vw - 24px));
    max-height: min(680px, calc(100vh - 24px));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.shared-filter-panel.people-filter-popover,
.shared-filter-panel.albums-shared-filter-popover {
    width:
        min(560px,
            calc(100vw - 24px));

    overflow:
        visible;
}

.shared-filter-panel-header {
    min-width: 0;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.shared-filter-panel-header h3 {
    margin: 0;
    font-size: 16px;
}

.shared-filter-panel-header p {
    margin: 4px 0 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.shared-filter-panel-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.shared-filter-panel-close:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.shared-filter-panel-close:focus-visible {
    outline: 2px solid var(--brand-green-400);
    outline-offset: 1px;
}

.shared-filter-panel-close svg {
    width: 18px;
    height: 18px;
}

.shared-filter-panel-body {
    min-height: 0;
    padding: var(--space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.shared-filter-fields {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--space-3);
}

.shared-filter-field {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 7px;
}

.shared-filter-field--full {
    grid-column: 1 / -1;
}

.shared-filter-field>label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
}

.shared-filter-boolean-title {
    color:
        var(--text-secondary);

    font-size:
        12px;

    font-weight:
        900;

    letter-spacing:
        .02em;
}

.shared-filter-boolean-control {
    min-height:
        42px;

    padding:
        0 var(--space-3);

    border:
        1px solid var(--border-default);

    border-radius:
        var(--radius-sm);

    background:
        var(--surface-input);

    color:
        var(--text-primary);

    display:
        flex;

    align-items:
        center;

    gap:
        var(--space-2);

    font-size:
        13px;

    font-weight:
        750;

    cursor:
        pointer;

    transition:
        border-color var(--ease),
        background var(--ease);
}

.shared-filter-boolean-control:hover {
    border-color:
        var(--border-strong);

    background:
        var(--surface-card-hover);
}

.shared-filter-boolean-control:focus-within {
    border-color:
        rgba(98, 217, 154, .55);

    box-shadow:
        0 0 0 3px rgba(98, 217, 154, .1);
}

.shared-filter-boolean-control input {
    width:
        17px;

    height:
        17px;

    margin:
        0;

    accent-color:
        var(--brand-green-500);
}

.shared-filter-field select,
.shared-filter-field input {
    font: inherit;
}

.shared-filter-combobox {
    position: relative;
    min-width: 0;
}

.shared-filter-selected {
    margin-bottom: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shared-filter-selected[hidden] {
    display: none;
}

.shared-filter-token {
    max-width: 100%;
    min-height: 28px;
    padding: 3px 4px 3px 9px;
    border: 1px solid rgba(98, 217, 154, .24);
    border-radius: var(--radius-xs);
    background: rgba(47, 174, 116, .08);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 750;
}

.shared-filter-token-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-filter-token-remove {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.shared-filter-token-remove:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--text-primary);
}

.shared-filter-token-remove:focus-visible {
    outline: 2px solid var(--brand-green-400);
}

.shared-filter-token-remove svg {
    width: 13px;
    height: 13px;
}

.shared-filter-combobox-input {
    height: 42px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-input);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 11px;
}

.shared-filter-combobox-input:hover {
    border-color: var(--border-strong);
    background: var(--surface-card-hover);
}

.shared-filter-combobox-input:focus-within {
    border-color: rgba(98, 217, 154, .55);
    box-shadow:
        0 0 0 3px rgba(98, 217, 154, .1);
}

.shared-filter-combobox-input>svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    color: var(--text-tertiary);
}

.shared-filter-combobox-input input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-weight: 700;
}

.shared-filter-combobox-input input::placeholder {
    color: var(--text-tertiary);
    font-weight: 600;
}

.shared-filter-combobox-toggle {
    width: 36px;
    height: 100%;
    flex: 0 0 36px;
    padding: 0;
    border: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: transparent;
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.shared-filter-combobox-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .035);
}

.shared-filter-combobox-toggle svg {
    width: 15px;
    height: 15px;
    transform: rotate(90deg);
    transition: transform var(--ease);
}

.shared-filter-combobox.is-open .shared-filter-combobox-toggle svg {
    transform: rotate(-90deg);
}

.shared-filter-listbox {
    position: fixed;
    z-index: 110;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    max-height: 320px;
    padding: 5px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.shared-filter-listbox.is-above {
    transform-origin: bottom;
}

.shared-filter-listbox[hidden] {
    display: none;
}

.shared-filter-option {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.shared-filter-option:hover,
.shared-filter-option.is-active {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.shared-filter-option[aria-selected="true"] {
    background: rgba(47, 174, 116, .09);
    color: var(--text-primary);
}

.shared-filter-option-check {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    color: transparent;
    display: grid;
    place-items: center;
}

.shared-filter-option[aria-selected="true"] .shared-filter-option-check {
    color: var(--brand-green-300);
}

.shared-filter-option-check svg {
    width: 15px;
    height: 15px;
}

.shared-filter-option-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-filter-option-count {
    flex: 0 0 auto;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 750;
}

.shared-filter-empty {
    padding: 14px 10px;
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
}

.shared-filter-year-range {
    min-width:
        0;

    display:
        grid;

    gap:
        7px;
}

.shared-filter-year-controls {
    min-width:
        0;

    display:
        grid;

    grid-template-columns:
        minmax(0, 1fr) minmax(86px, .72fr);

    align-items:
        center;

    gap:
        var(--space-2);
}

.shared-filter-year-controls.is-empty {
    grid-template-columns:
        minmax(0, 1fr);
}

.shared-filter-year-controls.is-between {
    grid-template-columns:
        minmax(0, 1fr) minmax(72px, .68fr) minmax(72px, .68fr);
}

.shared-filter-year-input-shell {
    min-width:
        0;

    display:
        block;
}

.shared-filter-year-input-shell[hidden] {
    display:
        none;
}

.shared-filter-year-input {
    box-sizing:
        border-box;

    width:
        100%;

    min-width:
        0;

    height:
        40px;

    padding:
        0 11px;

    border:
        1px solid var(--border-default);

    border-radius:
        var(--radius-sm);

    outline:
        0;

    background:
        var(--surface-input);

    color:
        var(--text-primary);

    font-weight:
        700;
}

.shared-filter-year-input::placeholder {
    color:
        var(--text-tertiary);

    font-weight:
        600;
}

.shared-filter-year-input:hover {
    border-color:
        var(--border-strong);

    background:
        var(--surface-card-hover);
}

.shared-filter-year-input:focus-visible {
    border-color:
        rgba(98, 217, 154, .55);

    box-shadow:
        0 0 0 3px rgba(98, 217, 154, .1);
}

.shared-filter-year-input[aria-invalid="true"] {
    border-color:
        var(--red);
}

.shared-filter-field-error {
    margin: 0;
    color: var(--red);
    font-size: 12px;
    line-height: 1.4;
}

.shared-filter-field-error[hidden] {
    display: none;
}

.shared-filter-panel-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.shared-filter-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.shared-filter-panel-footer .button {
    min-height: 40px;
}

.shared-filter-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .shared-filter-panel.is-mobile {
        top: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        left: 12px !important;
        width: auto;
        max-height: none;
    }

    .shared-filter-year-controls {
        gap:
            6px;
    }

    .shared-filter-panel.is-mobile .shared-filter-panel-body {
        flex: 1 1 auto;
    }

    .shared-filter-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .shared-filter-field--full {
        grid-column: auto;
    }

    .shared-filter-panel-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .shared-filter-panel-actions,
    .shared-filter-panel-actions .button {
        width: 100%;
    }
}

.people-saved-view-modal {
    width: min(620px, calc(100vw - 32px));
}

.people-saved-view-body {
    display: grid;
    gap: var(--space-5);
}

.people-saved-view-identity {
    display: grid;
    gap: var(--space-4);
}

.people-saved-view-filters {
    display: grid;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-default);
}

.people-saved-view-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.people-saved-view-section-header h3 {
    margin: 0 0 4px;
    color: var(--text-primary);
    font-size: 15px;
}

.people-saved-view-section-header p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.people-saved-view-clear {
    flex: 0 0 auto;
}

.people-saved-view-error {
    margin: 0;
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
}

.people-saved-view-error[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .people-filter-grid {
        grid-template-columns: 1fr;
    }

    .people-saved-view-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .people-saved-view-clear {
        align-self: flex-start;
    }
}

.people-columns-button {
    white-space: nowrap;
    justify-content: center;
    min-width: 118px;
}

.people-columns-button svg {
    width: 18px;
    height: 18px;
}

.people-columns-button.active {
    background: var(--surface-selected);
    border-color: rgba(98, 217, 154, .3);
    color: var(--brand-green-300);
}

.people-columns-popover {
    position: fixed;
    width: 290px;
    z-index: 95;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.people-columns-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
}

.people-columns-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.people-columns-header p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.people-columns-list {
    padding: var(--space-3);
    display: grid;
    gap: 4px;
}

.people-columns-option {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border-radius: 8px;
    padding: 0 var(--space-2);
    color: var(--text-secondary);
    font-weight: 800;
}

.people-columns-option:hover {
    background: rgba(255, 255, 255, .035);
    color: var(--text-primary);
}

.people-columns-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-green-500);
}

.people-columns-option input:disabled {
    opacity: .55;
}

.people-columns-footer {
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
}

.people-columns-footer .button {
    min-height: 36px;
    letter-spacing: .01em;
}

.people-table-wrap {
    min-height: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: auto;
    background: #0c1210;
}

.people-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 820px;
}

.people-table th,
.people-table td {
    border-bottom: 1px solid var(--border-default);
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.people-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #111716;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: .04em;
    font-weight: 800;
}

.people-table tr {
    cursor: pointer;
}

.people-table tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

.people-table tbody tr.is-previewed {
    background: rgba(255, 255, 255, .035);
}

.people-table tbody tr.is-previewed td {
    border-color: rgba(255, 255, 255, .09);
}

.people-table tbody tr.is-selected {
    background: var(--surface-selected);
}

.people-table tbody tr.is-selected td {
    border-color: rgba(98, 217, 154, .14);
}

.people-table tbody tr.is-previewed.is-selected {
    box-shadow: inset 3px 0 0 var(--brand-green-400);
}


.more-button {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    display: inline-grid;
    place-items: center;
    line-height: 0;
    cursor: pointer;
    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease);
}

.more-button svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

.more-button:hover,
.more-button:focus-visible {
    background: var(--surface-card-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.people-table .more-button {
    background: var(--surface-card);
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.people-table .more-button:hover,
.people-table .more-button:focus-visible {
    background: var(--surface-input);
    border-color: rgba(98, 217, 154, .32);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(47, 174, 116, .12);
}

.people-table tr.is-previewed .more-button,
.people-table tr.is-selected .more-button {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(98, 217, 154, .36);
    color: var(--text-primary);
}


.people-table .people-row-action {
    background: transparent;
    border-color: transparent;
    color: var(--text-tertiary);
    box-shadow: none;
}

.people-table .people-row-action:hover,
.people-table .people-row-action:focus-visible {
    background: rgba(255, 255, 255, .06);
    border-color: var(--border-default);
    color: var(--text-primary);
    box-shadow: none;
}

.people-select-column {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    text-align: center !important;
}

.people-actions-column {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    text-align: center !important;
}

.people-select-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand-green-500);
    cursor: pointer;
}

.people-select-checkbox:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

/* People table identity cell */
.person-cell {
    min-width: 230px;

    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
}

.person-cell-copy {
    min-width: 0;

    display: grid;
    align-content: center;
    gap: 2px;
}

.person-cell-copy>strong,
.person-cell-copy>span {
    min-width: 0;
    margin: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-cell-copy>strong {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.2;
}

.person-cell-copy>span {
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.25;
}

.table-footer {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--text-secondary);
    padding: 10px var(--space-2);
    min-height: 48px;
    font-size: 13px;
    background: var(--surface-main);
    border-top: 1px solid var(--border-default);
}

.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 7px;
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
}

.page-button.active {
    background: var(--surface-selected);
    color: var(--brand-green-300);
}

.page-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-ellipsis {
    min-width: 20px;

    display: inline-grid;
    place-items: center;

    color:
        var(--text-tertiary);
}

.people-table-footer-summary {
    white-space: nowrap;
}

.people-rows-per-page {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    white-space: nowrap;
}

.people-rows-per-page-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

.people-rows-select-shell {
    width: 82px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;

    flex: 0 0 82px;

    border:
        1px solid var(--border-default);

    border-radius:
        var(--radius-sm);

    background:
        var(--surface-input);

    transition:
        border-color var(--ease),
        background var(--ease),
        box-shadow var(--ease);
}

.people-rows-select-shell:hover {
    border-color:
        var(--border-strong);

    background:
        var(--surface-card-hover);
}

.people-rows-select-shell:focus-within {
    border-color:
        rgba(98,
            217,
            154,
            0.5);

    box-shadow:
        0 0 0 2px rgba(47,
            174,
            116,
            0.1);
}

.people-rows-select {
    padding:
        0 34px 0 12px;

    border: 0;

    outline: 0;

    background:
        transparent;

    color:
        var(--text-primary);

    text-align:
        left;

    box-shadow:
        none;
}

.people-rows-select:hover,
.people-rows-select:focus {
    border: 0;

    outline: 0;

    background:
        transparent;

    color:
        var(--text-primary);

    box-shadow:
        none;
}

.people-rows-select option {
    background-color:
        var(--surface-card);

    color:
        var(--text-primary);
}

.people-rows-select-chevron {
    right: 10px;

    width: 14px;

    color:
        var(--text-secondary);
}

.people-rows-select-chevron svg {
    width: 13px;
    height: 13px;

    display: block;

    transform:
        rotate(90deg);
}

.people-table-footer {
    min-height: 50px;
    padding-block: 8px;
}

@media (max-width: 760px) {
    .people-table-footer {
        justify-content: center;
        flex-wrap: wrap;
    }

    .people-table-footer-summary {
        width: 100%;
        text-align: center;
    }
}

.people-collapse-button,
.person-sidebar-restore-button {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    font-size: 18px;
}

.people-collapse-button:hover,
.person-sidebar-restore-button:hover {
    background: rgba(255, 255, 255, .05);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.people-hero {
    position: relative;
    padding: 10px;
    min-height: 170px;
    background: linear-gradient(90deg, var(--brand-green-700) 0%, var(--brand-green-900) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    overflow: hidden;
    isolation: isolate;
}

.people-hero::after {
    content: "";
    position: absolute;
    right: -52px;
    bottom: 0px;
    width: 260px;
    height: 190px;
    opacity: .14;
    background: var(--geneograph-cover-tree-image) bottom / contain no-repeat;
    mix-blend-mode: screen;
    filter: saturate(.72) brightness(.82);
    pointer-events: none;
    z-index: -1;
}

.people-hero-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
}

.people-hero-main {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: var(--space-1);
    align-items: start;
}

.people-photo {
    width: 88px;
    height: 104px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 900;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, .12);
    background: linear-gradient(145deg, rgba(47, 174, 116, .55), rgba(16, 36, 27, .9));
}

.people-hero h2 {
    margin: 0 0 8px;
    font-size: 21px;
    line-height: 1.12;
    letter-spacing: -.02em;
}

.people-hero p {
    margin: 0 0 10px;
    color: var(--text-secondary);
}

.people-hero-copy {
    min-width: 0;
}

.people-hero-copy h2 {
    font-size: 20px;
}

.people-row-menu .danger {
    color: #F2B3B3;
}










.record-info {
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
}

.record-kv {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .045);
}

.record-kv span:first-child {
    color: var(--text-tertiary);
}

.record-kv span:last-child {
    text-align: right;
}

.facts-list {
    display: grid;
    gap: var(--space-2);
}

.fact-row {
    border: 1px solid var(--border-default);
    background: rgba(255, 255, 255, .025);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    color: var(--text-secondary);
}

.fact-row strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-hero {
    --profile-hero-fact-text:
        rgba(240, 248, 244, .76);
    grid-column: 1 / -1;
    position: relative;
    isolation: isolate;

    min-width: 0;
    min-height: 178px;
    padding: var(--space-5);

    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    grid-template-areas:
        "content actions";
    align-items: center;
    gap: var(--space-5);

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-md);

    background:
        linear-gradient(90deg,
            var(--brand-green-700) 0%,
            var(--brand-green-900) 100%);
}

.profile-hero::after {
    content: "";
    position: absolute;
    z-index: 0;
    right: 200px;
    bottom: 0;

    width: 400px;
    height: 270px;

    background:
        var(--geneograph-cover-tree-image) bottom / contain no-repeat;

    opacity: .26;
    mix-blend-mode: screen;
    filter:
        saturate(.72) brightness(.82);

    pointer-events: none;
}

.profile-hero-content {
    grid-area: content;
    position: relative;
    z-index: 1;

    min-width: 0;

    display: grid;
    grid-template-columns:
        132px minmax(260px, 1fr);
    grid-template-areas:
        "photo identity"
        "photo life"
        "photo relation"
        "photo tags";
    align-items: start;
    column-gap: var(--space-5);
    row-gap: var(--space-3);
}

.profile-hero-content>.person-photo-control {
    grid-area: photo;
    align-self: center;
}

.profile-hero-copy {
    grid-area: identity;
    min-width: 0;
}

.profile-hero-copy h1 {
    margin: 0;

    overflow-wrap: anywhere;

    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -.025em;
}

.profile-hero-life {
    grid-area: life;
    min-width: 0;

    display: grid;
    grid-template-columns:
        minmax(0, 1fr);
    gap: 10px;
}

.profile-hero-life-item {
    min-width: 0;

    display: grid;
    grid-template-columns:
        max-content max-content minmax(0, 1fr);
    align-items: baseline;
    column-gap: 4px;
    row-gap: 4px;
}

.profile-hero-life-label,
.profile-hero-life-primary,
.profile-hero-life-place {
    color:
        var(--profile-hero-fact-text);

    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.profile-hero-life-label {
    min-width: 0;
    white-space: nowrap;
}

.profile-hero-life-label::after {
    content: ":";
}

.profile-hero-life-primary {
    min-width: 0;

    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
}

.profile-hero-life-primary strong,
.profile-hero-life-primary span {
    color: inherit;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.profile-hero-life-primary span::before {
    content: " - ";
    white-space: pre;
}

.profile-hero-life-place {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-hero-life-place::before {
    content: "-";
    margin-right: 4px;
}

.profile-hero-relation {
    grid-area: relation;

    min-width: 0;
    margin: 4px 0 0;

    overflow-wrap: anywhere;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.4;
}

.profile-hero-tags {
    grid-area: tags;

    min-width: 0;
    margin-top: 2px;
}

.profile-hero-actions {
    grid-area: actions;
    position: relative;
    z-index: 1;

    min-width: 0;
    padding-top: 34px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-2);

    align-self: center;
}

.profile-hero-actions .button {
    min-height: 44px;
    white-space: nowrap;
}

.profile-back-link {
    position: absolute;
    z-index: 2;
    top: var(--space-4);
    right: var(--space-5);

    min-height: 32px;
    padding: 0;

    border: 0;
    background: transparent;
    color: var(--text-secondary);

    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-weight: 600;
}

.profile-back-link-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.profile-back-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/*
    Compact Profile hero keeps the regular hero layout.
    Only the action buttons change into a vertical rail.
*/
@container people-profile (max-width: 1500px) {
    .profile-command-hero .profile-hero-actions {
        width: 260px;

        display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .profile-command-hero .profile-hero-actions .button {
        width: 100%;
        min-width: 0;

        justify-content: flex-start;

        white-space: normal;
        text-align: left;
        line-height: 1.3;
    }
}

/*
    Narrow Profile hero:
    actions move below the information and fill the width.
*/
@container people-profile (max-width: 760px) {
    .profile-command-hero {
        padding: var(--space-4);

        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "navigation"
            "content"
            "actions";
    }

    .profile-command-hero .profile-back-link {
        grid-area: navigation;
        position: relative;
        top: auto;
        right: auto;

        justify-self: start;
    }

    .profile-command-hero .profile-hero-content {
        grid-template-columns:
            96px minmax(0, 1fr);
        column-gap: var(--space-4);
    }

    .profile-command-hero .profile-hero-photo {
        --person-avatar-width: 96px;
        --person-avatar-height: 96px;
        --person-avatar-font-size: 30px;
    }

    .profile-command-hero .profile-hero-copy h1 {
        font-size: 25px;
    }

    .profile-command-hero .profile-hero-life {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .profile-command-hero .profile-hero-life-item {
        grid-column: 1;
    }

    .profile-command-hero .profile-hero-actions {
        width: 100%;
    }

    .profile-command-hero::after {
        right: -100px;
        opacity: .18;
    }
}

@container people-profile (max-width: 520px) {
    .profile-command-hero {
        padding: var(--space-3);
    }

    .profile-command-hero .profile-hero-content {
        grid-template-columns:
            76px minmax(0, 1fr);
        column-gap: var(--space-3);
    }

    .profile-command-hero .profile-hero-photo {
        --person-avatar-width: 76px;
        --person-avatar-height: 76px;
        --person-avatar-font-size: 24px;
    }

    .profile-command-hero .profile-hero-copy h1 {
        font-size: 22px;
    }
}

.profile-back-link-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.profile-back-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-card,
.profile-side-card {
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 0;
}

.profile-card h3,
.profile-side-card h3 {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.profile-card h3 .section-title,
.profile-side-card h3 .section-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.profile-card-body {
    padding: var(--space-4);
}

@media (max-width: 1080px) {

    .profile-edit-grid,
    .profile-edit-grid.main,
    .profile-death-fields {
        grid-template-columns: 1fr;
    }
}

.people-columns-button {
    white-space: nowrap;
    justify-content: center;
}

.people-columns-button.active {
    background: var(--surface-selected);
    border-color: rgba(98, 217, 154, .3);
    color: var(--brand-green-300);
}

.people-columns-popover {
    position: fixed;
    width: 288px;
    z-index: 96;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.people-columns-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-default);
}

.people-columns-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.people-columns-header p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
}

.people-columns-list {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.people-columns-footer {
    border-top: 1px solid var(--border-default);
    padding: var(--space-3);
    display: flex;
    justify-content: flex-end;
}

.people-columns-footer .button {
    min-height: 36px;
    letter-spacing: .01em;
}

.people-hero-copy h2 {
    margin-bottom: 8px;
}

.people-hero-copy p {
    margin-bottom: 8px;
}

@media (max-width: 1280px) {
    .people-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .people-person-sidebar {
        display: none;
    }

    .people-normal-toolbar {
        grid-template-columns: 1fr auto;
    }

    .people-normal-toolbar .people-sort-field,
    .people-normal-toolbar .button.secondary {
        display: none;
    }

    .people-bulk-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .people-layout {
        grid-template-columns: 1fr;
    }
}

.profile-edit-card-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .035);
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.profile-edit-card-state.editing {
    color: var(--brand-green-300);
    background: rgba(47, 174, 116, .12);
    border-color: rgba(98, 217, 154, .24);
}

.profile-readonly-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
}

.profile-info-block {
    border: 1px solid rgba(255, 255, 255, .055);
    background: rgba(255, 255, 255, .018);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    display: grid;
    gap: 10px;
    min-width: 0;
}

.profile-info-block h4 {
    margin: 0 0 2px;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.profile-partner-value {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.profile-partner-meta {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-partner-link {
    border: 0;
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
    min-width: 0;
}

.profile-partner-link:hover,
.profile-partner-link:focus-visible {
    color: var(--brand-green-300);
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
}

.profile-card-tabs {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-input);
    overflow: hidden;
}

.profile-card-tab {
    min-width: 0;
    min-height: 40px;
    padding: 0 var(--space-2);
    position: relative;
    border: 0;
    border-right: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-tertiary);
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.profile-card-tab:last-child {
    border-right: 0;
}

.profile-card-tab:hover,
.profile-card-tab:focus-visible {
    background: rgba(255, 255, 255, .035);
    color: var(--text-primary);
}

.profile-card-tab.active {
    background: var(--surface-card);
    color: var(--text-primary);
}

.profile-card-tab.active::after {
    content: "";
    position: absolute;
    right: 24%;
    bottom: 5px;
    left: 24%;
    height: 2px;
    border-radius: 999px;
    background: var(--text-primary);
}

.profile-card-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.profile-card-edit-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-card-edit-grid .field.full {
    grid-column: 1 / -1;
}

/* Profile → Other editing */

.person-profile .profile-other-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.person-profile .profile-other-religion {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.person-profile .profile-other-baptism-date {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.person-profile .profile-other-baptism-place {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
}

.profile-edit-date-cell {
    min-width: 0;
}

.profile-edit-date-cell .genealogy-date-field {
    width: 100%;
}

.profile-edit-inline-actions {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

@media (max-width: 900px) {
    .person-profile .profile-other-edit-grid {
        grid-template-columns: 1fr;
    }

    .person-profile .profile-other-religion,
    .person-profile .profile-other-baptism-date,
    .person-profile .profile-other-baptism-place {
        grid-column: 1;
        grid-row: auto;
    }

}

/* =========================================================
    People Profile — canonical component styles
    ========================================================= */

/* Profile page layout */

.main.people-profile-main {
    min-height: 0;
    overflow: auto;
}

.person-profile {
    --profile-primary-card-min-h: 408px;

    --profile-connected-card-h: 276px;
    --profile-connected-grid-h:
        calc(var(--profile-connected-card-h) + var(--profile-connected-card-h) + var(--space-4));
    container-name: people-profile;
    container-type: inline-size;
    min-height: 100%;
    height: auto;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: start;
    gap: var(--space-4);
    padding: 24px 28px 36px;
    background: var(--surface-main);
    overflow: visible;
}

.person-profile .profile-command-hero,
.person-profile__top,
.person-profile__bottom {
    grid-column: 1 / -1;
    min-width: 0;
}

.person-profile__top,
.person-profile__bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: stretch;
    gap: var(--space-4);
}

.person-profile .profile-command-hero,
.person-profile .profile-full-card,
.person-profile .profile-family-slot,
.person-profile .profile-connected-cube,
.person-profile .profile-compact-timeline {
    grid-area: auto;
}

/* Main Profile card */

.person-profile .profile-full-card {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height:
        var(--profile-primary-card-min-h);
    max-height: none;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/*
* Editing dropdowns and place suggestion lists may extend
* outside the card.
*/
.person-profile .profile-full-card.editing {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.person-profile .profile-full-card .profile-card-body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    overflow: visible;
}

/*
* Every panel occupies the same grid cell. Hidden panels retain
* layout participation, so the stack height is established by
* the tallest panel in the current locked/editing mode.
*/
.profile-card-panel-stack {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: grid;
    align-items: start;
}

.profile-card-panel {
    grid-area: 1 / 1;
    min-width: 0;
    align-self: start;
    visibility: hidden;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.profile-card-panel.active {
    visibility: visible;
    pointer-events: auto;
    user-select: auto;
    z-index: 1;
}

/* Read-only information grids */

.profile-readonly-grid.profile-readonly-grid-single {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.profile-readonly-grid.profile-readonly-grid-tabbed.main {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.profile-readonly-grid.profile-readonly-grid-tabbed.main .profile-info-block {
    align-content: start;
    grid-auto-rows: max-content;
}

.profile-readonly-grid.profile-readonly-grid-tabbed.main .profile-info-row {
    align-items: start;
}

/* Information key/value rows */

.profile-info-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(92px, .72fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-3);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .045);
    color: var(--text-secondary);
    font-size: 13px;
}

.profile-info-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.profile-info-row>span:first-child {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.profile-info-row>strong {
    min-width: 0;
    color: var(--text-primary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-info-row>small {
    color: var(--text-tertiary);
    line-height: 1.35;
}

/* Connected resources and Timeline */

.person-profile__bottom {
    align-items: start;
}

.profile-connected-card {
    min-width: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    overflow: hidden;
}

.profile-connected-card>.profile-connected-head {
    flex: 0 0 54px;
    min-height: 54px;
    margin: 0;
    padding: 0 var(--space-4);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: 16px;
}

.profile-connected-title {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 900;
}

.profile-connected-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-grid;
    place-items: center;
    color: var(--text-secondary);
}

.profile-connected-icon svg {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    display: block;
}

.profile-resource-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.profile-connected-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
    white-space: nowrap;
}

.profile-connected-action {
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--brand-green-300);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.profile-connected-action svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex: 0 0 16px;
    display: block;
}

.profile-connected-action:hover,
.profile-connected-action:focus-visible {
    border-color: rgba(98, 217, 154, .18);
    background: rgba(47, 174, 116, .09);
    color: var(--text-primary);
    text-decoration: none;
}

/* 2 × 2 resource grid */

.person-profile .profile-connected-cube {
    min-width: 0;
    align-self: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows:
        var(--profile-connected-card-h);
    gap: var(--space-4);
    margin: 0;
}

.person-profile .profile-resource-card {
    height: var(--profile-connected-card-h);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.profile-resource-card__body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: var(--space-3) var(--space-4);
    overflow: hidden;
}

.profile-resource-card__footer {
    width: 100%;
    flex: 0 0 44px;
    min-height: 44px;
    padding: 0 var(--space-4);
    border: 0;
    border-top: 1px solid var(--border-default);
    background: rgba(11, 15, 14, .16);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    text-align: left;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        color var(--ease),
        background var(--ease);
}

.profile-resource-card__footer svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.profile-resource-card__footer:hover,
.profile-resource-card__footer:focus-visible {
    background: rgba(255, 255, 255, .035);
    color: var(--brand-green-300);
}

.profile-resource-empty {
    height: 100%;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: var(--space-4);
    color: var(--text-tertiary);
    text-align: center;
    font-size: 13px;
}

/* Shared preview rows */

.profile-resource-list {
    height: 100%;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: var(--space-1);
}

.profile-resource-row {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition:
        color var(--ease),
        background var(--ease),
        border-color var(--ease);
}

.profile-resource-row:hover,
.profile-resource-row:focus-visible {
    border-color: var(--border-default);
    background: rgba(255, 255, 255, .035);
    color: var(--text-primary);
}

.profile-resource-row strong {
    min-width: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.3;
}

.profile-resource-row small {
    min-width: 0;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.3;
}

/* Photos */

.profile-resource-card--photos .profile-resource-card__body {
    padding-inline: var(--space-3);
}

.profile-photo-carousel {
    height: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
}

.profile-photo-carousel.has-overflow {
    grid-template-columns:
        34px minmax(0, 1fr) 34px;
}

.profile-photo-track {
    grid-column: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
}

.profile-photo-carousel.has-overflow .profile-photo-track {
    grid-column: 2;
}

.profile-photo-track::-webkit-scrollbar {
    display: none;
}

.profile-photo-thumb {
    position: relative;
    isolation: isolate;

    width: 118px;
    min-width: 118px;
    height: 118px;
    flex: 0 0 118px;

    scroll-snap-align: start;

    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: 9px;

    background: transparent;
    color: inherit;

    display: grid;
    place-items: center;

    overflow: hidden;

    appearance: none;
    cursor: pointer;

    transition:
        transform var(--ease),
        border-color var(--ease);
}

.profile-photo-thumb:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.profile-photo-thumb:focus-visible {
    transform: translateY(-1px);
    border-color: var(--border-strong);

    outline: 2px solid var(--text-tertiary);
    outline-offset: 2px;
}

.profile-photo-carousel-button {
    width: 34px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-input);
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.profile-photo-carousel-button.previous {
    grid-column: 1;
}

.profile-photo-carousel-button.next {
    grid-column: 3;
}

.profile-photo-carousel-button svg {
    width: 18px;
    height: 18px;
}

.profile-photo-carousel-button:hover:not(:disabled),
.profile-photo-carousel-button:focus-visible:not(:disabled) {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.profile-photo-carousel-button:disabled {
    opacity: .35;
    cursor: default;
}

/* Notes — compact portrait preview tiles */

.profile-resource-card--notes .profile-resource-card__body {
    padding:
        var(--space-3);
}

.profile-note-tile-grid {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;

    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    align-items: stretch;
    gap: var(--space-2);
}

.profile-note-tile {
    position: relative;

    min-width: 0;
    min-height: 0;
}

.profile-note-tile__open {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding:
        9px;

    border:
        1px solid var(--border-default);

    border-radius:
        10px;

    background:
        rgba(255, 255, 255, .018);

    color:
        var(--text-secondary);

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    overflow: hidden;

    text-align: left;

    cursor: pointer;

    transition:
        background var(--ease),
        border-color var(--ease),
        color var(--ease);
}

.profile-note-tile__open:hover,
.profile-note-tile__open:focus-visible {
    border-color:
        var(--border-strong);

    background:
        rgba(255, 255, 255, .04);

    color:
        var(--text-primary);
}

.profile-note-tile__open:focus-visible {
    outline:
        2px solid var(--brand-green-300);

    outline-offset:
        2px;
}

.profile-note-tile__title {
    width: 100%;
    min-width: 0;
    /*
    Keep the title clear of the unlink action.
    */
    padding-right: 32px;

    color:
        var(--text-primary);

    font-size: 12.5px;
    line-height: 1.3;
    font-weight: 900;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp:
        2;

    overflow: hidden;

    /*
    Reserve two lines so titles of different
    lengths still produce aligned cards.
    */
    min-height:
        calc(1.3em * 2);
}

.profile-note-tile__preview {
    width: 100%;
    min-width: 0;
    margin-top: 8px;

    color:
        var(--text-secondary);

    font-size: 11.5px;
    line-height: 1.4;
    font-weight: 500;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp:
        2;
    overflow: hidden;
}

.profile-note-tile__collection,
.profile-note-tile__updated {
    width: 100%;
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-note-tile__collection {
    margin-top: auto;
    padding-top: 8px;

    color:
        var(--text-secondary);

    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
}

.profile-note-tile__updated {
    margin-top: 3px;

    color:
        var(--text-tertiary);

    font-size: 10.5px;
    line-height: 1.25;
}

/*
    The shared unlink button is vertically centered
    for sidebar rows. Override its position only
    inside portrait Note tiles.
*/

.profile-note-tile>.connected-note-unlink {
    top: 8px;
    right: 8px;

    width: 29px;
    height: 29px;

    transform:
        translateY(-2px) scale(.96);
}

.profile-note-tile:hover>.connected-note-unlink,
.profile-note-tile:focus-within>.connected-note-unlink {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translateY(0) scale(1);
}

@media (hover: none) {
    .profile-note-tile>.connected-note-unlink {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: none;
    }
}

/* Archive */

.profile-resource-card--archive .profile-resource-card__body {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.profile-resource-card--archive .connected-file-list {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0;
}

.profile-resource-card--archive .connected-file-item {
    width: 100%;
    min-width: 0;
}

.profile-resource-card--archive .connected-file-main {
    width: 100%;
    min-width: 0;
}

.profile-file-row {
    padding: 5px 8px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
}

/* Places */

.profile-place-preview-row {
    padding: 6px 9px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.profile-place-preview-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-place-preview-title strong {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-place-coordinate-warning {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-grid;
    place-items: center;
    color: var(--amber);
}

.profile-place-coordinate-warning svg {
    width: 14px;
    height: 14px;
    display: block;
}

.profile-place-preview-meta {
    min-width: 0;
    display: block;
    overflow: hidden;
    color: var(--text-tertiary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Timeline */

.person-profile .profile-compact-timeline.profile-connected-card {
    width: 100%;
    height: var(--profile-connected-grid-h);
    min-height: var(--profile-connected-grid-h);
    max-height: var(--profile-connected-grid-h);
    align-self: start;
    display: flex;
    flex-direction: column;
}

.profile-compact-timeline-list {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: var(--space-4);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.profile-compact-timeline-list>.timeline {
    margin: 0;
}

.profile-compact-timeline-list .timeline-dot {
    background: var(--surface-card);
}

.profile-compact-timeline-list>.panel-muted {
    margin: 0;
    padding: var(--space-2) 0;
}

/* Family card */

/*
* The Profile card determines the desktop grid-row height.
* The Family slot fills that row without contributing its own
* intrinsic height.
*/
.person-profile__top .profile-family-slot {
    min-width: 0;
    min-height: 0;
    position: relative;
    align-self: stretch;
}

.person-profile__top .profile-family-hub {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
}

/*
* The shared .profile-side-card h3 rule supplies the heading
* layout, border, font size, alignment, and spacing.
*/
.person-profile__top .profile-family-head {
    flex: 0 0 54px;
    min-height: 54px;
    padding: 0 var(--space-4);
}

.person-profile .profile-family-title {
    min-width: 0;
}

.person-profile .profile-family-title-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-grid;
    place-items: center;
    color: var(--text-secondary);
}

.person-profile .profile-family-title-icon svg {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    display: block;
}

.person-profile .profile-family-count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.person-profile__top .profile-family-scroll {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: var(--space-4);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.person-profile__top .profile-family-scroll .relationship-list {
    gap: var(--space-4);
}

.person-profile__top .profile-family-scroll .panel-muted {
    margin: 0;
}

/* Small Profile utilities */

.profile-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 900;
    white-space: nowrap;
}

/* Responsive Profile layout */

@media (max-width: 1420px) {
    .profile-readonly-grid.profile-readonly-grid-tabbed.main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .person-profile__top,
    .person-profile__bottom {
        grid-template-columns: 1fr;
    }

    .person-profile__top .profile-family-slot {
        position: static;
        min-height: 0;
    }

    .person-profile__top .profile-family-hub {
        position: static;
        inset: auto;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .person-profile__top .profile-family-scroll {
        max-height: 360px;
    }

    .profile-readonly-grid.profile-readonly-grid-tabbed.main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .person-profile .profile-connected-cube {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .person-profile .profile-resource-card {
        height: auto;
        min-height: var(--profile-connected-card-h);
    }

    .person-profile .profile-compact-timeline.profile-connected-card {
        height: 520px;
        min-height: 520px;
        max-height: 520px;
    }
}
