/* Geneograph module */
.geneo-home-page {
    height:
        100%;
    min-width:
        0;
    overflow:
        auto;
    padding:
        var(--space-6);
    background:
        var(--surface-main);
}

.geneo-board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-7, 28px);
}

.geneo-board-toolbar-left,
.geneo-board-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.geneo-board-section {
    width:
        100%;

    min-width:
        0;

    margin-bottom:
        var(--space-8);
}

.geneo-board-grid {
    display:
        grid;

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

    align-items:
        stretch;

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

.geneo-board-list {
    display:
        grid;

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

.geneo-board-card {
    position:
        relative;

    min-width:
        0;

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

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

    background:
        var(--surface-card);

    overflow:
        hidden;

    text-align:
        left;

    cursor:
        pointer;

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

.geneo-board-card:hover {
    transform:
        translateY(-1px);

    border-color:
        var(--border-strong);

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

.geneo-board-card:focus-visible {
    outline:
        2px solid var(--brand-green-500);

    outline-offset:
        2px;
}

/* Grid card */

.geneo-board-grid .geneo-board-card {
    min-height:
        238px;

    display:
        flex;

    flex-direction:
        column;
}

.geneo-thumb {
    height:
        92px;

    flex:
        0 0 92px;

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

    background:
        radial-gradient(circle at 20% 20%,
            rgba(98, 217, 154, .14),
            transparent 22%),
        #101615;

    position:
        relative;

    overflow:
        hidden;
}

.geneo-thumb::before {
    content:
        "";

    position:
        absolute;

    inset:
        0;

    opacity:
        .72;

    background-image:
        linear-gradient(90deg,
            rgba(98, 217, 154, .08) 1px,
            transparent 1px),
        linear-gradient(rgba(98, 217, 154, .08) 1px,
            transparent 1px);

    background-size:
        22px 22px;
}

.geneo-thumb::after {
    content:
        "";

    position:
        absolute;

    left:
        20px;

    right:
        20px;

    top:
        22px;

    bottom:
        18px;

    opacity:
        .92;

    background:
        linear-gradient(90deg,
            transparent 0 7%,
            rgba(212, 170, 107, .72) 7% 8%,
            transparent 8% 36%,
            rgba(141, 108, 232, .65) 36% 37%,
            transparent 37% 70%,
            rgba(47, 174, 116, .66) 70% 71%,
            transparent 71%),
        radial-gradient(circle at 10% 34%,
            #273337 0 12px,
            transparent 13px),
        radial-gradient(circle at 40% 62%,
            #243827 0 14px,
            transparent 15px),
        radial-gradient(circle at 73% 38%,
            #3a2f21 0 14px,
            transparent 15px),
        radial-gradient(circle at 91% 67%,
            #2d2847 0 12px,
            transparent 13px);
}

.geneo-thumb.map::after {
    background:
        radial-gradient(circle at 26% 34%,
            rgba(93, 173, 236, .55) 0 18px,
            transparent 19px),
        radial-gradient(circle at 62% 52%,
            rgba(212, 170, 107, .55) 0 15px,
            transparent 16px),
        linear-gradient(130deg,
            transparent 0 30%,
            rgba(93, 173, 236, .35) 31% 33%,
            transparent 34% 60%,
            rgba(47, 174, 116, .35) 61% 62%,
            transparent 63%);
}

.geneo-board-body {
    min-width:
        0;

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

.geneo-board-grid .geneo-board-body {
    flex:
        1;

    display:
        flex;

    flex-direction:
        column;
}

.geneo-board-body h3 {
    min-height:
        0;
    margin:
        0 0 6px;
    overflow:
        hidden;
    display:
        -webkit-box;
    color:
        var(--text-primary);
    font-size:
        15px;
    line-height:
        1.28;
    line-clamp:
        2;
    -webkit-line-clamp:
        2;
    -webkit-box-orient:
        vertical;
}

.geneo-collection-sidebar-empty {
    padding:
        var(--space-3);

    color:
        var(--text-tertiary);

    font-size:
        12px;

    line-height:
        1.4;
}

.geneo-board-section-description {
    max-width:
        760px;

    margin:
        calc(-1 * var(--space-2)) 0 var(--space-4);

    color:
        var(--text-tertiary);

    font-size:
        13px;

    line-height:
        1.5;
}

.geneo-board-collections {
    min-width: 0;
    min-height: 24px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.geneo-board-collection-chip {
    box-sizing: border-box;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    min-height: 24px;

    padding: 0 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .055);
    color: var(--text-secondary);

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

    font-size: 11px;
    font-weight: 750;
    line-height: 24px;
}

.geneo-board-collection-chip.no-collection {
    background:
        rgba(255,
            255,
            255,
            .03);

    color:
        var(--text-tertiary);

    font-weight:
        700;
}

.geneo-board-collection-chip.count {
    flex:
        0 0 auto;

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

.geneo-board-create-modal {
    width:
        min(720px,
            calc(100vw - 32px));

    max-height:
        calc(100vh - 48px);

    overflow:
        hidden;

    display:
        grid;

    grid-template-rows:
        auto minmax(0, 1fr);
}

.geneo-board-create-modal>form {
    min-height:
        0;

    display:
        grid;

    grid-template-rows:
        minmax(0, 1fr) auto;
}

.geneo-board-create-modal .modal-body {
    min-height:
        0;

    overflow-y:
        auto;
}

.geneo-collection-chooser {
    min-width:
        0;

    display:
        grid;

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

.geneo-collection-chooser-head {
    min-width:
        0;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

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

.geneo-collection-chooser-head>label {
    margin:
        0;

    color:
        var(--text-secondary);

    font-weight:
        800;
}

.geneo-collection-chooser-head>span {
    color:
        var(--text-tertiary);

    font-size:
        11px;

    font-weight:
        700;
}

.geneo-collection-browse {
    min-width:
        0;

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

.geneo-collection-results {
    height:
        min(280px,
            34vh);

    min-height:
        164px;
}

/*
    Important:
    collection checkboxes are choice controls,
    not standard .field text inputs.
*/
.geneo-collection-chooser .album-picker-result input[type="checkbox"] {
    width:
        18px;

    min-width:
        18px;

    max-width:
        18px;

    height:
        18px;

    min-height:
        18px;

    max-height:
        18px;

    padding:
        0;

    margin:
        0;

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

.geneo-collection-create-panel {
    padding:
        var(--space-4);

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

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

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

.geneo-inline-collection-actions {
    display:
        flex;

    align-items:
        center;

    justify-content:
        flex-end;

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

@media (max-width: 620px) {
    .geneo-board-create-modal {
        width:
            min(100%,
                calc(100vw - 24px));

        max-height:
            calc(100vh - 24px);
    }

    .geneo-collection-results {
        height:
            min(260px,
                32vh);
    }
}

.geneo-board-meta {
    min-width:
        0;
    margin-bottom:
        10px;
    color:
        var(--text-tertiary);
    display:
        flex;
    align-items:
        center;
    flex-wrap:
        nowrap;
    gap:
        var(--space-2);
    overflow:
        hidden;
    font-size:
        12px;
}

.geneo-board-meta-item {
    min-width:
        0;

    flex:
        0 0 auto;

    display:
        inline-flex;

    align-items:
        center;

    gap:
        0;

    white-space:
        nowrap;
}

.geneo-board-meta-item svg {
    margin-right:
        5px;
}

.geneo-board-meta-value+.geneo-board-meta-label {
    margin-left:
        3px;
}

.geneo-board-meta-item svg {
    width:
        14px;

    height:
        14px;

    flex:
        0 0 14px;

    display:
        block;
}

.geneo-board-meta-value {
    flex:
        0 0 auto;

    font-variant-numeric:
        tabular-nums;
}

.geneo-board-meta.is-compact {
    gap:
        10px;
}

.geneo-board-meta.is-compact .geneo-board-meta-label {
    display:
        none;
}

.geneo-board-modified {
    min-width:
        0;

    color:
        var(--text-secondary);

    font-size:
        12px;

    line-height:
        1.35;
}

.geneo-board-grid .geneo-board-modified {
    margin-top:
        auto;
}

.geneo-board-footer {
    padding:
        0 var(--space-3) var(--space-3);

    display:
        flex;

    align-items:
        center;

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

.geneo-board-footer-actions {
    margin-left:
        auto;

    display:
        inline-flex;

    align-items:
        center;

    gap:
        2px;
}

.geneo-star,
.geneo-more {
    width:
        34px;

    height:
        34px;

    min-width:
        34px;

    padding:
        0;

    border:
        1px solid transparent;

    border-radius:
        8px;

    background:
        transparent;

    color:
        var(--text-secondary);

    display:
        inline-grid;

    place-items:
        center;

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

.geneo-star svg {
    width:
        16px;

    height:
        16px;

    display:
        block;
}

.geneo-more svg {
    width:
        18px;

    height:
        18px;

    display:
        block;
}

.geneo-star:hover,
.geneo-more:hover {
    border-color:
        var(--border-default);

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

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

.geneo-star:focus-visible,
.geneo-more:focus-visible {
    outline:
        2px solid var(--brand-green-500);

    outline-offset:
        2px;
}

.geneo-star.active {
    color:
        var(--amber);
}

/*
    Non-favourite stars stay quiet until
    the card is being interacted with.
*/
.geneo-board-card .geneo-star:not(.active) {
    opacity:
        0;

    pointer-events:
        none;
}

.geneo-board-card:hover .geneo-star,
.geneo-board-card:focus-within .geneo-star {
    opacity:
        1;

    pointer-events:
        auto;
}

/* Dedicated list presentation */

.geneo-board-list .geneo-board-card {
    min-height:
        104px;

    display:
        grid;

    grid-template-columns:
        104px minmax(0, 1fr) auto;

    align-items:
        stretch;
}

.geneo-board-list .geneo-thumb {
    width:
        104px;

    height:
        100%;

    min-height:
        104px;

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

    border-bottom:
        0;
}

.geneo-board-list .geneo-board-body {
    padding:
        var(--space-3);
}

.geneo-board-list .geneo-board-body h3 {
    min-height:
        0;

    margin-bottom:
        4px;

    line-clamp:
        1;

    -webkit-line-clamp:
        1;
}

.geneo-board-list .geneo-board-meta {
    margin-bottom:
        4px;
}

.geneo-board-list .geneo-board-collections {
    margin-bottom:
        4px;
}

.geneo-board-list .geneo-board-footer {
    min-width:
        182px;

    padding:
        var(--space-3);

    justify-content:
        flex-end;

    align-self:
        center;
}

/* Create / import peer tile */

.geneo-board-action-tile {
    min-width:
        0;

    min-height:
        238px;

    padding:
        var(--space-4);

    border:
        1px dashed var(--border-strong);

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

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

    color:
        var(--text-primary);

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    gap:
        var(--space-3);

    text-align:
        center;

    font:
        inherit;

    cursor:
        pointer;

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

.geneo-board-action-tile:hover {
    transform:
        translateY(-1px);

    border-color:
        rgba(98,
            217,
            154,
            .42);

    background:
        rgba(47,
            174,
            116,
            .035);
}

.geneo-board-action-tile:focus-visible {
    outline:
        2px solid var(--brand-green-500);

    outline-offset:
        2px;
}

.geneo-board-action-tile-icon {
    width:
        42px;

    height:
        42px;

    border:
        1px solid rgba(98, 217, 154, .2);

    border-radius:
        10px;

    background:
        rgba(47, 174, 116, .1);

    color:
        var(--brand-green-300);

    display:
        grid;

    place-items:
        center;
}

.geneo-board-action-tile-icon svg {
    width:
        21px;

    height:
        21px;

    display:
        block;
}

.geneo-board-action-copy {
    min-width:
        0;

    display:
        grid;

    justify-items:
        center;

    gap:
        4px;
}

.geneo-board-action-copy strong {
    color:
        var(--text-primary);

    font-size:
        15px;

    line-height:
        1.3;
}

.geneo-board-action-copy span {
    max-width:
        260px;

    color:
        var(--text-tertiary);

    font-size:
        12px;

    line-height:
        1.4;
}

.geneo-board-list .geneo-board-action-tile {
    min-height:
        104px;

    padding:
        var(--space-3);

    display:
        grid;

    grid-template-columns:
        44px minmax(0, 1fr);

    align-items:
        center;

    justify-items:
        start;

    gap:
        var(--space-3);

    text-align:
        left;
}

.geneo-board-list .geneo-board-action-tile-icon {
    width:
        44px;

    height:
        44px;
}

.geneo-board-list .geneo-board-action-copy {
    justify-items:
        start;

    text-align:
        left;
}

.geneo-board-empty {
    color:
        var(--text-tertiary);
}

@media (hover: none) {
    .geneo-board-card .geneo-star:not(.active) {
        opacity:
            1;

        pointer-events:
            auto;
    }
}

.geneo-editor {
    height: calc(100vh - var(--topbar-h));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    background: #080d0c;
}

.geneo-editor-toolbar {
    min-height: 58px;
    min-width: 0;
    padding: 8px var(--space-4);
    border-bottom: 1px solid var(--border-default);
    background: rgba(16, 22, 21, .98);

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

    overflow: hidden;
}

.geneo-editor-toolbar-left,
.geneo-editor-toolbar-right {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.geneo-editor-toolbar-left {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow: hidden;
}

.geneo-editor-toolbar-right {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.geneo-editor-toolbar .geneo-toolbar-button,
.geneo-editor-toolbar .geneo-tool {
    height: 40px;
    min-width: 0;
    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: 8px;

    line-height: 1;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 800;
}

.geneo-editor-toolbar .geneo-toolbar-button:hover,
.geneo-editor-toolbar .geneo-tool:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.geneo-editor-toolbar .geneo-toolbar-button:focus-visible,
.geneo-editor-toolbar .geneo-tool:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

.geneo-editor-toolbar .geneo-toolbar-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.geneo-editor-toolbar .geneo-toolbar-button svg,
.geneo-editor-toolbar .geneo-tool svg,
.geneo-editor-toolbar .geneo-toolbar-object svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    flex: 0 0 18px;
    display: block;
    color: currentColor;
}

/* History */

.geneo-history-group {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.geneo-editor-toolbar .geneo-icon-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    flex: 0 0 40px;
}

/* Select / Pan / Pencil */

.geneo-tool-group {
    width: 210px;
    height: 40px;
    flex: 0 0 210px;

    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;

    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .018);
}

.geneo-tool-group .geneo-tool {
    width: 38px;
    height: 34px;
    flex: 0 0 38px;
    padding: 0;
    gap: 0;

    border-color: transparent;
    background: transparent;

    transition:
        width 140ms ease,
        flex-basis 140ms ease,
        background-color 140ms ease;
}

.geneo-tool-group .geneo-tool-label {
    display: none;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geneo-tool-group .geneo-tool.active {
    width: 124px;
    flex-basis: 124px;
    padding: 0 8px;
    gap: 6px;

    background: var(--surface-selected);
    color: var(--text-primary);
    border-color: rgba(98, 217, 154, .24);
}

.geneo-tool-group .geneo-tool.active .geneo-tool-label {
    display: inline;
}

.geneo-toolbar-button.primary {
    background: var(--brand-green-500);
    color: #06110D;
    border-color: rgba(98, 217, 154, .35);
}

.geneo-editor-main {
    position: relative;
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--inspector-width);
}

.geneo-editor-main.inspector-collapsed {
    grid-template-columns: minmax(0, 1fr) var(--inspector-collapsed-width);
}

.geneo-canvas-viewport {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--geneo-canvas-background, var(--surface-main));
}

.geneo-canvas-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background: var(--geneo-canvas-background, var(--surface-main));
}

.geneo-canvas-stage {
    position: relative;
    transform-origin: 0 0;
    overflow: visible;
}

.geneo-toolbar-objects {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--border-default);
}

.geneo-toolbar-object {
    height: 40px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    white-space: nowrap;
}

.geneo-toolbar-object:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.geneo-toolbar-object[aria-pressed="true"] {
    border-color: rgba(98, 217, 154, .3);
    background: var(--surface-selected);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px rgba(98, 217, 154, .12);
}

.geneo-toolbar-object:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

.geneo-toolbar-object svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
}

.geneo-toolbar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*
* Compact mode keeps all commands visible,
* but removes labels from simple object actions.
*/
.geneo-editor-toolbar:is([data-toolbar-density="compact"],
    [data-toolbar-density="narrow"],
    [data-toolbar-density="minimal"]) .geneo-toolbar-object {
    width: 40px;
    min-width: 40px;
    padding: 0;
    justify-content: center;
}

.geneo-editor-toolbar:is([data-toolbar-density="compact"],
    [data-toolbar-density="narrow"],
    [data-toolbar-density="minimal"]) .geneo-toolbar-object .geneo-toolbar-label {
    display: none;
}

/*
* At narrow widths, less frequent commands move
* into the explicit More menu.
*/
.geneo-editor-toolbar:is([data-toolbar-density="narrow"],
    [data-toolbar-density="minimal"]) :is([data-geneo-toolbar-item="place"],
    [data-geneo-toolbar-item="image"],
    [data-geneo-toolbar-item="content"],
    [data-geneo-toolbar-item="panel"],
    [data-geneo-toolbar-item="export"]) {
    display: none;
}

/*
* At the smallest supported width, Person and
* Connect also move into More. Shapes remains
* visibly named.
*/
.geneo-editor-toolbar[ data-toolbar-density="minimal"

] :is([data-geneo-toolbar-item="person"],
    [data-geneo-toolbar-item="connect"]) {
    display: none;
}

.geneo-toolbar-overflow {
    display: none;
}

.geneo-editor-toolbar:is([data-toolbar-density="narrow"],
    [data-toolbar-density="minimal"]) .geneo-toolbar-overflow {
    display: inline-flex;
}

.geneo-editor-toolbar[ data-toolbar-density="minimal"

] {
    padding-inline: 8px;
    gap: 4px;
}

.geneo-editor-toolbar[ data-toolbar-density="minimal"
] .geneo-editor-toolbar-left,
.geneo-editor-toolbar[ data-toolbar-density="minimal"

] .geneo-editor-toolbar-right {
    gap: 4px;
}

.geneo-editor-toolbar[ data-toolbar-density="minimal"

] .geneo-tool-group {
    width: 202px;
    flex-basis: 202px;
}

.geneo-editor-toolbar[ data-toolbar-density="minimal"

] .geneo-tool-group .geneo-tool {
    width: 34px;
    flex-basis: 34px;
}

.geneo-editor-toolbar[ data-toolbar-density="minimal"

] .geneo-tool-group .geneo-tool.active {
    width: 124px;
    flex-basis: 124px;
}

.geneo-toolbar-overflow-menu {
    min-width: 220px;
}

.geneo-toolbar-overflow-menu button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.tool-split {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    flex: 0 0 auto;
}

.tool-split-main,
.tool-split-trigger {
    height: 40px;
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-split-main {
    gap: 8px;
    padding: 0 11px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-weight: 800;
}

.tool-split-trigger {
    width: 30px;
    padding: 0;
    margin-left: -1px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.tool-split-main:hover,
.tool-split-trigger:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.tool-split.active .tool-split-main,
.tool-split.active .tool-split-trigger {
    background: var(--surface-selected);
    color: var(--text-primary);
    border-color: rgba(98, 217, 154, .35);
}

.tool-split-main:focus-visible,
.tool-split-trigger:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--brand-green-300);
    outline-offset: 1px;
}

.tool-split svg {
    width: 18px;
    height: 18px;
    display: block;
}

.tool-split-trigger svg {
    width: 14px;
    height: 14px;
    transform: rotate(90deg);
}

.tool-options-menu {
    min-width: 180px;
}

.tool-options-menu button {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 750;
}

.tool-options-menu button[aria-checked="true"] {
    background: var(--surface-selected);
    color: var(--text-primary);
}

.tool-options-menu button:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: -2px;
}

.tool-options-menu svg {
    width: 18px;
    height: 18px;
    display: block;
    flex: 0 0 18px;
}

.geneo-shape-options-menu {
    min-width: 216px;
}

.geneo-shape-option-preview {
    width: 22px;
    height: 18px;
    flex: 0 0 22px;
    display: block;
    border: 2px solid currentColor;
    background: rgba(98, 217, 154, .12);
}

.geneo-shape-option-preview.shape-ellipse {
    border-radius: 50%;
}

.geneo-shape-option-preview.shape-diamond {
    transform: rotate(45deg) scale(.72);
}

.geneo-shape-option-preview.shape-triangle {
    border: 0;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: currentColor;
}

.geneo-shape-option-preview.shape-hexagon {
    border: 0;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: currentColor;
}

.geneo-zoom-overlay {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 20;
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-default);
    background: rgba(26, 32, 31, .92);
    border-radius: var(--radius-sm);
    padding: 6px;
    box-shadow: var(--shadow-soft);
}

.geneo-zoom-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
}

.geneo-zoom-button:hover {
    background: var(--surface-card-hover);
}

.geneo-minimap {
    position: sticky;
    left: 18px;
    bottom: 74px;
    z-index: 5;
    width: 160px;
    height: 112px;
    margin: 0 0 12px 18px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: rgba(10, 14, 13, .94);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.geneo-minimap::before {
    content: "";
    position: absolute;
    inset: 12px;
    background:
        linear-gradient(90deg, transparent 0 40%, rgba(47, 174, 116, .45) 41% 43%, transparent 44%),
        radial-gradient(circle at 25% 30%, rgba(47, 174, 116, .65) 0 10px, transparent 11px),
        radial-gradient(circle at 60% 28%, rgba(212, 170, 107, .65) 0 11px, transparent 12px),
        radial-gradient(circle at 68% 68%, rgba(93, 173, 236, .65) 0 9px, transparent 10px),
        radial-gradient(circle at 40% 72%, rgba(141, 108, 232, .65) 0 10px, transparent 11px);
}

.geneo-minimap::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 14px;
    width: 86px;
    height: 56px;
    border: 1px solid var(--text-secondary);
    background: rgba(255, 255, 255, .04);
}

.geneo-board-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    height: auto;
    min-height: 100%;
    overflow: visible;
}

.geneo-sidebar-section {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}

.geneo-sidebar-section.navigation {
    gap: 0;
}

.geneo-current-board-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    min-width: 0;
}

.geneo-current-board-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.geneo-current-board-copy strong {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-current-board-copy>span {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 12px;
}

.geneo-current-board-copy>span span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-current-board-copy svg {
    width: 14px;
    height: 14px;
    display: block;
    flex: 0 0 14px;
}

.geneo-board-square-action {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-secondary);
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.geneo-board-square-action svg {
    width: 16px;
    height: 16px;
}

.geneo-board-square-action:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.geneo-sidebar-disclosure {
    width: 100%;
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    font-weight: 800;
    text-align: left;
}

.geneo-sidebar-disclosure:hover {
    color: var(--text-primary);
}

.geneo-sidebar-disclosure:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
    border-radius: 5px;
}

.geneo-sidebar-disclosure-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.geneo-sidebar-disclosure-meta svg {
    width: 14px;
    height: 14px;
    transform: rotate(90deg);
    transition: transform var(--ease);
}

.geneo-sidebar-disclosure[aria-expanded="true"] .geneo-sidebar-disclosure-meta svg {
    transform: rotate(-90deg);
}

.geneo-sidebar-section-body {
    position: relative;
    display: grid;
    gap: var(--space-2);
    min-width: 0;
    overflow: visible;
}

.geneo-layers {
    min-height: auto;
}

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

.geneo-object-search {
    height: 34px;
    min-width: 0;
    flex: 1 1 auto;
    border: 1px solid var(--border-default);
    background: #111817;
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0 var(--space-3);
    outline: none;
}

.geneo-layer-list {
    display: grid;
    gap: 2px;
}

.geneo-layer-row {
    min-height: 36px;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 7px;
    text-align: left;
    min-width: 0;
}

.geneo-layer-row:hover {
    background: rgba(255, 255, 255, .035);
    color: var(--text-primary);
}

.geneo-layer-row.selected {
    background: var(--surface-selected);
    border-color: rgba(98, 217, 154, .12);
    color: var(--text-primary);
}

.geneo-layer-row .name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-layer-row .name[data-geneo-layer-rename-handle] {
    cursor: text;
}

.geneo-layer-name-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 28px;
    border: 1px solid var(--brand-green-300);
    border-radius: 6px;
    background: var(--surface-input);
    color: var(--text-primary);
    padding: 0 7px;
    font: inherit;
    outline: 0;
}

.geneo-layer-name-input:focus {
    box-shadow:
        0 0 0 2px rgba(98, 217, 154, 0.2);
}

.geneo-layer-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .05);
    color: var(--brand-green-300);
    flex: 0 0 auto;
}

.geneo-layer-icon svg,
.geneo-layer-toggle svg {
    width: 16px;
    height: 16px;
    display: block;
}

.geneo-layer-toggle {
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.geneo-layer-toggle:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.geneo-inspector {
    border-left: 1px solid var(--border-default);
    background: var(--surface-sidebar);
    width: var(--inspector-width);
    min-width: var(--inspector-width);
    overflow-y: auto;
}

.geneo-inspector.collapsed {
    width: var(--inspector-collapsed-width);
    min-width: var(--inspector-collapsed-width);
    overflow: hidden;
    display: grid;
    place-items: start center;
    padding-top: var(--space-4);
}

.geneo-inspector-body {
    min-width: 0;
    min-height: 100%;
}

.geneo-inspector-header {
    min-width: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom:
        1px solid var(--border-default);
}

.geneo-inspector-header>.people-collapse-button {
    flex: 0 0 34px;
    align-self: center;
}

.geneo-inspector-identity {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-3);
}

.geneo-inspector-identity.has-icon {
    grid-template-columns:
        20px minmax(0, 1fr);
}

.geneo-inspector-identity>.geneo-layer-icon {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}

.geneo-inspector-title {
    min-width: 0;
    grid-column: 1;
    display: grid;
    align-content: center;
    gap: 3px;
}

.geneo-inspector-identity.has-icon .geneo-inspector-title {
    grid-column: 2;
}

.geneo-inspector-title h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-inspector-title span {
    min-width: 0;
    display: block;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-inspector .panel-section {
    min-width: 0;
}

.geneo-inspector .panel-section-body {
    min-width: 0;
    display: grid;
    gap: var(--space-3);
}

.geneo-inspector .panel-section-body[hidden] {
    display: none;
}

.geneo-inspector-danger {
    display: flex;
    padding: var(--space-4);
    margin-top: var(--space-2);
}

.geneo-inspector-danger .button {
    width: 100%;
    min-width: 0;
}

.geneo-tree-link-row {
    width: 100%;
}

.geneo-tree-link-row .relation-row-copy {
    flex: 1 1 auto;
}

.geneo-tree-link-person-main {
    cursor: default;
}

.geneo-tree-link-row.is-warning {
    border-color:
        rgba(212,
            170,
            107,
            .32);

    background:
        rgba(212,
            170,
            107,
            .07);
}

.geneo-tree-link-row.is-warning:hover,
.geneo-tree-link-row.is-warning:focus-within {
    border-color:
        rgba(212,
            170,
            107,
            .52);

    background:
        rgba(212,
            170,
            107,
            .11);
}

.geneo-tree-link-warning-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;

    background:
        rgba(212,
            170,
            107,
            .12);

    color: var(--amber);
}

.geneo-tree-link-warning-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.geneo-tree-link-cta-arrow {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
}

.geneo-tree-link-cta-arrow svg {
    width: 16px;
    height: 16px;
    display: block;
}

.geneo-field {
    display: grid;
    gap: 6px;
}

.geneo-field label,
.geneo-field-label {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
}

.geneo-input,
.geneo-textarea,
.geneo-select {
    width: 100%;
    border: 1px solid var(--border-default);
    background: var(--surface-input);
    color: var(--text-primary);
    border-radius: 8px;
    min-height: 36px;
    padding: 8px 10px;
    outline: 0;
}

.geneo-textarea {
    min-height: 74px;
    resize: vertical;
}

.geneo-sticky-content-field {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.geneo-sticky-content-input {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    resize: vertical;
}

.geneo-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 700;
    min-height: 32px;
}

.geneo-check input {
    accent-color: var(--brand-green-500);
    width: 16px;
    height: 16px;
}

.geneo-person-card-options {
    display: grid;
    gap: 4px;
}

.geneo-person-card-controls {
    display: grid;
    gap: var(--space-4);
}

.geneo-person-card-inheritance-note {
    margin: 0;
}

.geneo-person-card-controls :disabled {
    cursor: default;
}

.geneo-person-card-control-group {
    display: grid;
    gap: var(--space-2);
}

.geneo-person-card-group-title {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.geneo-person-style-picker {
    display: grid;
    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 8px;
}

.geneo-person-style-option {
    min-width: 0;
    padding: 8px;

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

    border-radius: 8px;

    background:
        var(--surface-input);

    color:
        var(--text-secondary);

    display: grid;
    gap: 6px;

    font-size: 11px;
    font-weight: 800;

    text-align: left;

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

.geneo-person-style-option:hover {
    border-color:
        var(--border-strong);

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

.geneo-person-style-option.active {
    border-color:
        rgba(98,
            217,
            154,
            .62);

    background:
        var(--surface-selected);

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

.geneo-person-style-option:focus-visible {
    outline:
        2px solid var(--brand-green-300);

    outline-offset: 2px;
}

.geneo-person-style-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.geneo-person-style-copy strong {
    color: inherit;
    font-size: 11px;
    line-height: 1.2;
}

.geneo-person-style-copy>span {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-person-style-preview-stage {
    width: 100%;
    height: 66px;
    min-width: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.geneo-person-style-preview {
    position: relative;
    display: block;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 5px;
    background: rgba(255, 255, 255, .035);
}

.geneo-person-style-preview.preview-standard {
    width: 82px;
    height: 60px;
}

.geneo-person-style-preview.preview-tree {
    width: 96px;
    height: 58px;
}

.geneo-person-style-preview.preview-chart {
    width: 108px;
    height: 50px;
}

.geneo-person-style-preview.preview-portrait {
    width: 38px;
    height: 63px;
}

.geneo-person-style-preview>span {
    position: absolute;
    display: block;

    border-radius: 2px;

    background:
        rgba(255,
            255,
            255,
            .42);
}

.geneo-person-style-preview .preview-photo {
    background:
        rgba(98,
            217,
            154,
            .34);
}

.preview-standard .preview-photo {
    left: 6px;
    top: 6px;
    width: 28px;
    height: 30px;
}

.preview-standard .preview-name {
    left: 40px;
    top: 8px;
    width: 43%;
    height: 5px;
}

.preview-standard .preview-line.one {
    left: 40px;
    top: 19px;
    width: 32%;
    height: 3px;
}

.preview-standard .preview-line.two {
    left: 6px;
    top: 43px;
    width: 70px;
    height: 1px;
    background: rgba(255, 255, 255, .18);
}

.preview-standard::after {
    content: '';
    position: absolute;
    left: 40px;
    top: 50px;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .36);
}

.preview-tree .preview-photo {
    left: 7px;
    top: 7px;
    width: 25px;
    height: 28px;
}

.preview-tree .preview-name {
    left: 39px;
    top: 10px;
    width: 47%;
    height: 5px;
}

.preview-tree .preview-line.one {
    left: 39px;
    top: 21px;
    width: 36%;
    height: 3px;
}

.preview-tree .preview-line.two {
    left: 7px;
    top: 45px;
    width: 61%;
    height: 3px;
}

.preview-chart .preview-photo {
    left: 7px;
    top: 10px;
    width: 18px;
    height: 22px;
}

.preview-chart .preview-name {
    left: 31px;
    top: 9px;
    width: 59%;
    height: 5px;
}

.preview-chart .preview-line.one {
    left: 31px;
    top: 20px;
    width: 41%;
    height: 3px;
}

.preview-chart .preview-line.two {
    left: 31px;
    top: 33px;
    width: 49%;
    height: 3px;
}

.preview-portrait .preview-photo {
    left: 50%;
    top: 4px;
    width: 28px;
    height: 31px;

    transform:
        translateX(-50%);
}

.preview-portrait .preview-name {
    left: 50%;
    top: 40px;
    width: 66%;
    height: 4px;

    transform:
        translateX(-50%);
}

.preview-portrait .preview-line.one {
    left: 50%;
    top: 50px;
    width: 70%;
    height: 1px;
    background: rgba(255, 255, 255, .18);

    transform:
        translateX(-50%);
}

.preview-portrait .preview-line.two {
    left: 50%;
    top: 56px;
    width: 54%;
    height: 3px;
    transform: translateX(-50%);
}

.geneo-person-card-setting-grid {
    display: grid;
    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

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

.geneo-person-card-setting-grid .geneo-field {
    min-width: 0;
}

.geneo-person-card-field-help {
    margin:
        var(--space-2) 0 0;
}

.geneo-check.is-unavailable {
    opacity: .48;
}

.geneo-gender-color-toggle {
    align-items: start;
}

.geneo-gender-color-toggle>span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.geneo-gender-color-toggle small {
    display: block;
    font-weight: 600;
    line-height: 1.35;
}

.geneo-person-card-radius-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) 78px;
    gap: var(--space-3);
    align-items: end;
    margin-block: var(--space-2);
}

.geneo-person-card-radius-row .geneo-input {
    text-align: left;
}

.geneo-person-multi-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.geneo-layout-name {
    min-width: 0;
    display: grid;
    gap: var(--space-2);
}

.geneo-layout-grid {
    min-width: 0;
    display: grid;
    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));
    gap: var(--space-2);
}

.geneo-layout-grid .geneo-field {
    min-width: 0;
}

.geneo-person-size-controls,
.geneo-place-size-controls {
    display: grid;
    gap: 7px;
}

.geneo-person-size-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.geneo-image-source-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: var(--space-3);
    align-items: center;
}

.geneo-image-source-preview {
    position: relative;
    width: 86px;
    height: 70px;
    overflow: hidden;
    border: 1px solid var(--border-default);
    border-radius: 7px;
    background: var(--surface-input);
}

.geneo-image-source-preview>.photo-thumbnail {
    position: absolute;
    inset: 0;
}

.geneo-image-source-copy {
    min-width: 0;
    display: grid;
    justify-items: start;
    gap: 4px;
}

.geneo-image-source-copy strong,
.geneo-image-source-copy>span:not(.geneo-image-source-badge) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-image-source-copy>span:not(.geneo-image-source-badge) {
    color: var(--text-tertiary);
    font-size: 12px;
}

.geneo-image-source-badge {
    min-height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(98, 217, 154, .12);
    color: var(--brand-green-200);
    font-size: 10px;
    font-weight: 900;
}

.geneo-image-source-missing {
    padding: var(--space-3);
    border: 1px solid rgba(212, 170, 107, .26);
    border-radius: 8px;
    background: rgba(212, 170, 107, .08);
    display: grid;
    gap: 5px;
}

.geneo-image-source-missing span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.geneo-image-source-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.button.compact {
    min-height: 38px;
    padding-inline: 12px;
}

.button.icon-only {
    width: 42px;
    padding-inline: 0;
    justify-content: center;
}

.button.icon-only svg,
.button.compact svg {
    width: 16px;
    height: 16px;
}

/* Canonical Geneograph diagram editor */
.geneo-board-space {
    position: relative;
    min-width: 100%;
    min-height: 100%;
    background-color: var(--geneo-canvas-background, var(--surface-main));
}

.geneo-board-space.pattern-dots {
    background-image: radial-gradient(circle at 0 0, rgba(255, 255, 255, .16) 1px, transparent 1.5px);
    background-size: calc(20px * var(--geneo-canvas-zoom, 1)) calc(20px * var(--geneo-canvas-zoom, 1));
    background-position: var(--geneo-grid-origin-x, 0) var(--geneo-grid-origin-y, 0);
}

.geneo-board-space.pattern-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
    background-size: calc(20px * var(--geneo-canvas-zoom, 1)) calc(20px * var(--geneo-canvas-zoom, 1));
    background-position: var(--geneo-grid-origin-x, 0) var(--geneo-grid-origin-y, 0);
}

.geneo-background-pattern {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--surface-input);
}

.geneo-background-pattern button {
    min-width: 0;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 800;
}

.geneo-background-pattern button:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.geneo-background-pattern button[aria-pressed="true"] {
    background: var(--surface-selected);
    border-color: rgba(98, 217, 154, .28);
    color: var(--text-primary);
}

.geneo-background-pattern button:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 1px;
}

.geneo-selection-marquee {
    position: absolute;
    z-index: 45;
    border: 1px solid var(--brand-green-300);
    background: rgba(98, 217, 154, .12);
    pointer-events: none;
}

.geneo-canvas-stage.panel-tool {
    cursor: crosshair;
}

.geneo-canvas-stage.panel-tool .geneo-node {
    cursor: default;
}

.geneo-panel-draft {
    position: absolute;
    z-index: 44;
    min-width: 0;
    min-height: 0;
    border: 2px dashed var(--brand-green-300);
    border-radius: 8px;
    background: rgba(47, 174, 116, .08);
    box-shadow:
        0 0 0 1px rgba(8, 14, 11, .7),
        0 12px 30px rgba(0, 0, 0, .18);
    pointer-events: none;
}

.geneo-panel-draft[hidden] {
    display: none;
}

.geneo-panel-draft>span {
    position: absolute;
    left: 8px;
    top: 8px;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    background: rgba(7, 13, 10, .82);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.geneo-node {
    position: absolute;
    min-width: 0;
    border:
        var(--geneo-node-stroke-width) var(--geneo-node-stroke-style, solid) var(--geneo-node-stroke);
    background: var(--geneo-node-bg);
    color: var(--geneo-node-text);
    border-radius:
        var(--geneo-node-radius, 8px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    overflow: visible;
    cursor: move;
    outline: 0;
}

.geneo-node:focus-visible,
.geneo-node.selected {
    box-shadow: 0 0 0 2px #62d99a, 0 14px 34px rgba(0, 0, 0, .3);
}

.geneo-node.locked {
    cursor: default;
}

.geneo-node-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.geneo-node-person .geneo-node-content {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.geneo-node-person {
    container-name: geneo-person-card;
    container-type: size;
}

/* Person content responds to the node's actual dimensions. */
.geneo-person-node-content {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;

    --geneo-card-date-size: 13px;
    --geneo-card-place-size: 13px;
    --geneo-card-event-label-size: 12px;
}

.person-avatar.geneo-person-avatar {
    --person-avatar-width:
        var(--geneo-card-photo,
            var(--geneo-card-photo-target, 68px));

    --person-avatar-height:
        var(--geneo-card-photo,
            var(--geneo-card-photo-target, 68px));

    --person-avatar-radius: 7px;

    --person-avatar-font-size:
        calc(var(--geneo-card-photo,
                var(--geneo-card-photo-target, 68px)) * .36);
}

.geneo-person-name-wrap {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.geneo-person-name {
    min-width: 0;

    overflow: hidden;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp:
        2;
    overflow-wrap: anywhere;

    color: inherit;
}

.geneo-person-maiden {
    min-width: 0;
    max-width: 100%;

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

    color:
        color-mix(in srgb,
            currentColor 66%,
            transparent);

    font-weight: 700;
}

.geneo-person-life,
.geneo-person-identity-block {
    min-width: 0;
    padding-right: var(--geneo-person-action-reserve, 20px);
}

.geneo-person-life-span,
.geneo-person-life-summary {
    min-width: 0;

    display: block;

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

    color:
        color-mix(in srgb,
            currentColor 72%,
            transparent);
}

.geneo-person-life-events {
    min-width: 0;

    display: grid;
    gap: 8px;
}

.geneo-person-life-event {
    min-width: 0;

    display: grid;
    grid-template-columns:
        56px minmax(0, 1fr);

    gap: 8px;
    align-items: baseline;
}

.geneo-person-life-event-kind {
    color:
        color-mix(in srgb,
            currentColor 52%,
            transparent);

    font-size: var(--geneo-card-event-label-size);
    font-weight: 650;
    line-height: 1.35;
}

.geneo-person-life-event-value {
    min-width: 0;

    display: flex;
    align-items: baseline;
    gap: 4px;

    overflow: hidden;

    color:
        color-mix(in srgb,
            currentColor 74%,
            transparent);
}

.geneo-person-life-event-date {
    flex: 0 0 auto;
    white-space: nowrap;
}

.geneo-person-life-event-date,
.geneo-person-life-summary,
.geneo-person-life-span {
    color: color-mix(in srgb, currentColor 88%, transparent);
    font-size: var(--geneo-card-date-size);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}

.geneo-person-life-event-separator {
    flex: 0 0 auto;

    color:
        color-mix(in srgb,
            currentColor 40%,
            transparent);
}

.geneo-person-life-event-place {
    min-width: 0;

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

    font-size: var(--geneo-card-place-size);
    line-height: 1.35;
}

.geneo-person-status {
    width: max-content;
    max-width: 100%;

    color:
        color-mix(in srgb,
            currentColor 74%,
            transparent);
}

.geneo-person-status.status-dot::before {
    width: 6px;
    height: 6px;
}

.geneo-person-link-indicator {
    position: absolute;
    z-index: 8;
    top: 9px;
    right: 10px;

    width: 18px;
    height: 18px;

    color:
        var(--brand-green-300);

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

    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 5px;
    background: rgba(8, 14, 11, .68);
}

.geneo-person-link-indicator.modified {
    color: var(--amber);
}

.geneo-person-link-indicator svg {
    width: 12px;
    height: 12px;
    display: block;
}

.geneo-node-person.geneo-person-gender-male.selected,
.geneo-node-person.geneo-person-gender-female.selected,
.geneo-node-person.geneo-person-gender-male:focus-visible,
.geneo-node-person.geneo-person-gender-female:focus-visible {
    box-shadow: 0 0 0 2px var(--brand-green-300), 0 14px 34px rgba(0, 0, 0, .3);
}

/*
    * STANDARD
    * Family-tree-like horizontal research card.
    */
.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-node-content {
    --geneo-card-photo:
        min(var(--geneo-card-photo-target, 76px),
            max(56px, calc(100cqw - 203px)));
    --geneo-person-action-reserve: 16px;

    padding:
        12px clamp(14px, 5cqw, 18px);

    display: grid;

    grid-template-areas:
        "avatar identity"
        "life life";

    grid-template-columns:
        var(--geneo-card-photo) minmax(0, 1fr);

    grid-template-rows:
        auto auto;

    column-gap: clamp(12px, 4.7cqw, 18px);
    row-gap: 8px;

    align-content: start;
}

.geneo-node-person[ data-geneo-person-card-style="standard"
][ data-geneo-person-card-height-mode="auto"

] .geneo-person-node-content {
    height: max-content;
    min-height: 0;
}

.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-avatar {
    grid-area: avatar;
    align-self: start;
}

.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-identity-block {
    grid-area: identity;
    align-self: center;
}

.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-life {
    grid-area: life;
    min-height: 0;
    padding-top: 8px;
    padding-right: 30px;
    border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    display: grid;
    gap: 7px;
    align-content: start;
}

.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-name {
    font-size: 19px;
    font-weight: 850;
    line-height: 1.18;
    -webkit-line-clamp: 3;
    line-clamp:
        3;
}

.geneo-node-person[ data-geneo-person-card-style="standard"
] .geneo-person-maiden,
.geneo-node-person[ data-geneo-person-card-style="standard"
] .geneo-person-life-span,
.geneo-node-person[ data-geneo-person-card-style="standard"
] .geneo-person-life-event-value,
.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-status {
    font-size: 13px;
    line-height: 1.35;
}

.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-maiden {
    font-size: 14px;
}

.geneo-node-person[ data-geneo-person-card-style="standard"

] .geneo-person-life-event-date {
    color: color-mix(in srgb, currentColor 92%, transparent);
}

.geneo-node-person[ data-geneo-person-card-style="standard"
][ data-geneo-person-card-align="center"
] .geneo-person-identity-block,
.geneo-node-person[ data-geneo-person-card-style="standard"
][ data-geneo-person-card-align="center"

] .geneo-person-life {
    text-align: center;
}

/*
    * TREE
    * Identity row first, genealogy details
    * become a separate full-width section.
    */
.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-node-content {
    --geneo-card-photo:
        min(var(--geneo-card-photo-target, 64px),
            max(48px, calc(100cqw - 178px)));
    --geneo-person-action-reserve: 16px;

    padding:
        clamp(12px, 8cqh, 16px) clamp(14px, 5.5cqw, 18px);

    display: grid;

    grid-template-areas:
        "avatar identity"
        "life life";

    grid-template-columns:
        var(--geneo-card-photo) minmax(0, 1fr);

    grid-template-rows:
        auto auto;

    column-gap: clamp(12px, 5cqw, 16px);
    row-gap: clamp(8px, 8cqh, 16px);

    align-content: center;
}

.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-avatar {
    grid-area: avatar;
    align-self: center;
}

.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-identity-block {
    grid-area: identity;
    align-self: center;
}

.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-life {
    grid-area: life;
    min-width: 0;
    padding-right: 30px;
    align-self: center;
}

.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-name {
    font-size: 18px;
    font-weight: 850;
    line-height: 1.2;
}

.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-maiden {
    font-size: 13px;
    line-height: 1.35;
}

/*
    * CHART
    * Maximum-density reference node with an
    * optional small photo.
    */
.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-node-content {
    --geneo-card-photo:
        min(var(--geneo-card-photo-target, 42px),
            max(36px, calc(100cqw - 168px)));
    --geneo-person-action-reserve: 22px;

    padding:
        clamp(10px, 10cqh, 14px) clamp(12px, 5.5cqw, 16px);

    display: grid;

    grid-template-areas:
        "avatar identity"
        "avatar life";

    grid-template-columns:
        var(--geneo-card-photo) minmax(0, 1fr);

    grid-template-rows:
        auto auto;

    align-items: center;
    align-content: center;
    column-gap: 11px;
    row-gap: 4px;
}

.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-avatar {
    grid-area: avatar;

    --person-avatar-radius: 5px;
    --person-avatar-font-size:
        max(13px, calc(var(--geneo-card-photo) * .36));

    align-self: center;
}

.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-identity-block {
    grid-area: identity;

    align-self: end;
}

.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-life {
    grid-area: life;
    min-width: 0;
    padding-right: 26px;
    align-self: start;
}

.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-name {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.16;
}

.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-maiden {
    font-size: 12px;
    line-height: 1.3;
}

.geneo-node-person[ data-geneo-person-card-style="chart"

] .geneo-person-node-content.no-photo {
    grid-template-areas:
        "identity"
        "life";

    grid-template-columns:
        minmax(0, 1fr);
}

/*
    * PORTRAIT
    * Everything is intentionally centered.
    */
.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-node-content {
    --geneo-card-photo:
        min(var(--geneo-card-photo-target, 116px),
            calc(100cqw - 28px),
            44cqh);
    --geneo-person-action-reserve: 0px;

    padding: clamp(12px, 4.25cqw, 16px);

    display: grid;

    grid-template-areas:
        "avatar"
        "identity"
        "life";

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

    grid-template-rows:
        auto auto 1fr;

    justify-items: center;
    align-content: start;
    gap: clamp(8px, 3.6cqh, 12px);

    text-align: center;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-avatar {
    grid-area: avatar;
    justify-self: center;

    --person-avatar-radius: 10px;
    --person-avatar-height:
        calc(var(--geneo-card-photo,
                116px) * 1.08);
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-identity-block {
    grid-area: identity;

    width: 100%;
    padding-right: 0;

    text-align: center;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-life {
    grid-area: life;

    width: 100%;
    min-width: 0;
    padding: clamp(9px, 3.6cqh, 12px) 20px 0;
    border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);

    text-align: center;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-life-events {
    gap: 10px;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-life-event {
    grid-template-columns:
        44px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    text-align: left;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-life-event-value {
    display: grid;
    justify-items: start;
    gap: 1px;
    overflow: visible;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-life-event-separator {
    display: none;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-life-event-place {
    display: block;
    max-width: 100%;
    color:
        color-mix(in srgb,
            currentColor 68%,
            transparent);
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-name {
    font-size: 18px;
    font-weight: 880;
    line-height: 1.2;
    text-align: center;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-name-wrap {
    justify-items: center;
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-maiden {
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
}

.geneo-node-person[ data-geneo-person-card-style="standard"
] .geneo-person-node-content.no-photo,
.geneo-node-person[ data-geneo-person-card-style="tree"

] .geneo-person-node-content.no-photo {
    grid-template-areas:
        "identity"
        "life";
    grid-template-columns: minmax(0, 1fr);
}

.geneo-node-person[ data-geneo-person-card-style="portrait"

] .geneo-person-node-content.no-photo {
    grid-template-areas:
        "identity"
        "life";
    grid-template-rows: auto auto;
    align-content: center;
}

@container geneo-person-card (max-width: 279px) {
    .geneo-node-person[data-geneo-person-card-style="standard"] .geneo-person-name {
        font-size: 18px;
    }

    .geneo-node-person[data-geneo-person-card-style="tree"] .geneo-person-node-content {
        column-gap: 12px;
    }
}

@container geneo-person-card (max-height: 299px) {
    .geneo-node-person[data-geneo-person-card-style="portrait"] .geneo-person-node-content {
        gap: 8px;
    }

    .geneo-node-person[data-geneo-person-card-style="portrait"] .geneo-person-life {
        padding-top: 9px;
    }
}

@container geneo-person-card (min-width: 340px) {
    .geneo-person-node-content {
        --geneo-card-date-size: 14px;
        --geneo-card-place-size: 14px;
        --geneo-card-event-label-size: 13px;
    }
}

@container geneo-person-card (min-width: 420px) {
    .geneo-node-person[data-geneo-person-card-style="standard"] .geneo-person-name {
        font-size: 21px;
    }
}

@container geneo-person-card (min-width: 500px) {
    .geneo-person-node-content {
        --geneo-card-date-size: 15px;
        --geneo-card-place-size: 15px;
    }
}

@container geneo-person-card (min-width: 260px) {
    .geneo-node-person[data-geneo-person-card-style="portrait"] .geneo-person-node-content {
        --geneo-card-date-size: 14px;
        --geneo-card-place-size: 14px;
    }
}

@container geneo-person-card (min-width: 340px) {
    .geneo-node-person[data-geneo-person-card-style="portrait"] .geneo-person-node-content {
        --geneo-card-date-size: 15px;
        --geneo-card-place-size: 15px;
    }
}

/*
    * Add relative remains inside the card,
    * matching the interaction language of
    * Family Tree.
    */
.geneo-person-add-relative {
    position: absolute;
    z-index: 10;

    right: 8px;
    bottom: 8px;

    width: 27px;
    height: 27px;
    padding: 0;
    line-height: 0;

    border: 0;
    border-radius: 6px;

    background:
        rgba(8,
            14,
            11,
            .72);

    color:
        color-mix(in srgb,
            currentColor 76%,
            transparent);

    display: grid;
    place-items: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

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

.geneo-person-add-relative svg {
    width: 16px;
    height: 16px;
    display: block;
}

.geneo-node-person:hover .geneo-person-add-relative,
.geneo-node-person:focus-within .geneo-person-add-relative,
.geneo-node-person.selected .geneo-person-add-relative {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.geneo-person-add-relative:hover {
    background:
        rgba(255,
            255,
            255,
            .1);

    color: currentColor;
}

.geneo-person-add-relative:focus-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    outline:
        2px solid var(--brand-green-300);

    outline-offset: 2px;
}

@media (hover: none) {
    .geneo-node-person.selected .geneo-person-add-relative {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

.geneo-node-image .geneo-node-content {
    position: relative;
    display: block;
}

.geneo-image-node-media {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: inherit;
    background: rgba(0, 0, 0, .22);
}

.geneo-image-node-media .photo-thumbnail {
    width: 100%;
    height: 100%;
}

.geneo-image-node-media .thumb-img {
    object-fit: contain;
    background: rgba(0, 0, 0, .18);
}

.geneo-image-node-media>span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    gap: 6px;
    color: var(--text-tertiary);
}

.geneo-image-node-missing svg {
    width: 28px;
    height: 28px;
}

.geneo-image-layer-label {
    position: absolute;
    z-index: 4;
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 6px;
    background: rgba(7, 12, 10, .82);
    color: #f4f7f5;
    box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
    backdrop-filter: blur(6px);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(3px);
    pointer-events: none;
    transition:
        opacity var(--ease),
        transform var(--ease);
}

.geneo-node-image:hover .geneo-image-layer-label,
.geneo-node-image.selected .geneo-image-layer-label,
.geneo-node-image:focus-within .geneo-image-layer-label {
    opacity: 1;
    transform: translateY(0);
}

.geneo-node-sticky {
    border-radius: 4px;
    box-shadow: none;
    transition:
        box-shadow var(--ease),
        border-color var(--ease);
}

.geneo-node-sticky.has-paper-fill {
    box-shadow:
        0 3px 7px rgba(0, 0, 0, .2),
        0 12px 18px -14px rgba(0, 0, 0, .7);
}

.geneo-node-sticky.has-paper-fill:hover {
    box-shadow:
        0 4px 9px rgba(0, 0, 0, .24),
        0 14px 20px -14px rgba(0, 0, 0, .76);
}

.geneo-node-sticky.has-paper-fill.selected,
.geneo-node-sticky.has-paper-fill:focus-visible {
    box-shadow:
        0 0 0 2px #62D99A,
        0 5px 12px rgba(0, 0, 0, .28),
        0 16px 22px -15px rgba(0, 0, 0, .78);
}

.geneo-node-sticky .geneo-node-content {
    position: relative;
    isolation: isolate;
    padding: 20px;
}

.geneo-node-sticky.has-paper-fill .geneo-node-content::after {
    content: "";
    position: absolute;
    z-index: 0;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    background:
        color-mix(in srgb,
            var(--geneo-node-bg) 72%,
            #4A3518);
    clip-path:
        polygon(0 100%,
            100% 0,
            100% 100%);
    box-shadow:
        -1px -1px 0 rgba(0, 0, 0, .14);
    pointer-events: none;
}

.geneo-rich-text-copy,
.geneo-rich-text-inspector-preview {
    color: inherit;

    overflow-wrap:
        anywhere;
}

.geneo-rich-text-copy {
    position: relative;
    z-index: 1;

    width: 100%;
    height: 100%;

    overflow: hidden;
}

.geneo-rich-text-copy> :first-child,
.geneo-rich-text-inspector-preview> :first-child {
    margin-top: 0;
}

.geneo-rich-text-copy> :last-child,
.geneo-rich-text-inspector-preview> :last-child {
    margin-bottom: 0;
}

.geneo-rich-text-copy p,
.geneo-rich-text-inspector-preview p {
    margin:
        0 0 .55em;
}

.geneo-rich-text-copy ul,
.geneo-rich-text-copy ol,
.geneo-rich-text-inspector-preview ul,
.geneo-rich-text-inspector-preview ol {
    margin:
        .45em 0;

    padding-left:
        1.4em;
}

.geneo-rich-text-copy blockquote,
.geneo-rich-text-inspector-preview blockquote {
    margin:
        .55em 0;

    padding:
        5px 8px;

    border-left:
        3px solid color-mix(in srgb,
            currentColor 42%,
            transparent);

    border-radius:
        0 5px 5px 0;

    background:
        color-mix(in srgb,
            currentColor 7%,
            transparent);
}

.geneo-rich-text-copy a,
.geneo-rich-text-inspector-preview a {
    color: #8BC8F5;

    text-decoration:
        underline;

    text-underline-offset:
        2px;
}

.geneo-rich-text-placeholder {
    opacity: .56;
    font-style: italic;
}

.geneo-sticky-copy {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.geneo-sticky-copy h2 {
    margin:
        .45em 0 .25em;

    font-size: 19px;
    font-weight: 850;
    line-height: 1.25;
}

.geneo-sticky-copy h3 {
    margin:
        .4em 0 .2em;

    font-size: 17px;
    font-weight: 820;
    line-height: 1.3;
}

.geneo-rich-text-editor-shell {
    position: relative;
    z-index: 1;

    width: 100%;
    height: 100%;

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

    overflow: visible;
}

.geneo-node.is-rich-editing .geneo-node-content {
    overflow: visible;
}

.geneo-rich-text-editor-shell .ql-container.ql-snow {
    width: 100%;
    height: 100%;

    min-height: 0;

    border: 0;

    background:
        transparent;

    color: inherit;

    font-family:
        inherit;
}

.geneo-rich-text-editor-shell .ql-editor {
    width: 100%;
    height: 100%;

    min-height: 0;

    overflow:
        auto;

    color: inherit;

    caret-color:
        currentColor;

    tab-size: 4;
}

.geneo-node-sticky .geneo-rich-text-editor-shell .ql-editor {
    padding: 0;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.geneo-node-sticky .geneo-rich-text-editor-shell .ql-editor h2 {
    margin:
        .45em 0 .25em;

    font-size: 19px;
    font-weight: 850;
    line-height: 1.25;
}

.geneo-node-sticky .geneo-rich-text-editor-shell .ql-editor h3 {
    margin:
        .4em 0 .2em;

    font-size: 17px;
    font-weight: 820;
    line-height: 1.3;
}

.geneo-rich-text-editor-shell .ql-editor blockquote {
    margin:
        .55em 0;

    padding:
        5px 8px;

    border-left:
        3px solid color-mix(in srgb,
            currentColor 42%,
            transparent);

    border-radius:
        0 5px 5px 0;
}

.geneo-rich-text-editor-shell .ql-editor a {
    color: #8BC8F5;
}

.geneo-rich-text-editor-shell .ql-editor.ql-blank::before {
    left: 0;
    right: 0;

    color:
        color-mix(in srgb,
            currentColor 48%,
            transparent);

    font-style: italic;
}

.geneo-rich-text-fallback {
    width: 100%;
    height: 100%;

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

    padding: 0;

    border: 0;
    outline: 0;

    resize: none;

    background:
        transparent;

    color: inherit;

    font: inherit;

    line-height: inherit;
}

.geneo-rich-text-fallback[hidden],
.geneo-rich-text-editor-host[hidden] {
    display: none !important;
}

.geneo-rich-text-toolbar.ql-toolbar.ql-snow {
    position: absolute;
    left: 50%;
    right: auto;
    top: auto;
    bottom:
        calc(100% + 10px);
    z-index: 90;
    width: max-content;
    max-width: 620px;
    flex-wrap: wrap;
    justify-content: center;
    transform:
        translateX(-50%);

    border:
        1px solid color-mix(in srgb,
            var(--border-strong) 72%,
            transparent);

    border-radius: 8px;

    background:
        color-mix(in srgb,
            var(--surface-card) 72%,
            transparent);

    -webkit-backdrop-filter:
        blur(10px);

    backdrop-filter:
        blur(10px);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, .2);
}

.geneo-rich-text-toolbar .ql-stroke {
    stroke:
        currentColor;
}

.geneo-rich-text-toolbar .ql-fill,
.geneo-rich-text-toolbar .ql-stroke.ql-fill {
    fill:
        currentColor;
}

.geneo-rich-text-editor-shell .ql-tooltip {
    z-index: 120;

    padding: 8px;

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

    border-radius: 8px;

    background:
        var(--surface-card);

    color:
        var(--text-secondary);

    box-shadow:
        var(--shadow-soft);
}

.geneo-rich-text-editor-shell .ql-tooltip.ql-editing:not(.ql-hidden) {
    width: 320px;
    max-width:
        calc(100vw - 40px);

    display: grid;

    grid-template-columns:
        auto minmax(0, 1fr) auto;

    align-items: center;

    gap: 8px;

    white-space: normal;
}

.geneo-rich-text-editor-shell .ql-tooltip.ql-hidden {
    display: none !important;
}

.geneo-rich-text-inspector {
    display: grid;
    gap: 10px;
}

.geneo-rich-text-inspector-editor-shell {
    min-width: 0;

    overflow: visible;

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

    border-radius: 8px;

    background:
        var(--surface-input);

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

.geneo-rich-text-inspector-editor-shell:focus-within {
    border-color:
        rgba(98,
            217,
            154,
            .42);

    box-shadow:
        0 0 0 1px rgba(47,
            174,
            116,
            .08);
}

.geneo-rich-text-inspector-toolbar.ql-toolbar.ql-snow {
    min-height: 42px;

    padding: 5px;

    flex-wrap: wrap;

    border: 0;

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

    border-radius:
        7px 7px 0 0;

    background:
        rgba(255,
            255,
            255,
            .025);
}

.geneo-rich-text-inspector-editor-shell .ql-container.ql-snow {
    height: auto;

    border: 0;

    background:
        transparent;

    color:
        var(--text-secondary);

    font-family:
        inherit;
}

.geneo-rich-text-inspector-editor-shell .ql-editor {
    min-height: 150px;
    max-height: 320px;

    padding: 12px;

    overflow-y: auto;

    color:
        var(--text-secondary);

    font-size: 14px;
    line-height: 1.55;
}

.geneo-rich-text-inspector-editor-shell .ql-editor h2 {
    margin:
        .65em 0 .25em;

    color:
        var(--text-primary);

    font-size: 19px;
    font-weight: 850;
    line-height: 1.3;
}

.geneo-rich-text-inspector-editor-shell .ql-editor h3 {
    margin:
        .55em 0 .22em;

    color:
        var(--text-primary);

    font-size: 16px;
    font-weight: 820;
    line-height: 1.35;
}

.geneo-rich-text-inspector-editor-shell .ql-editor> :first-child {
    margin-top: 0;
}

.geneo-rich-text-inspector-editor-shell .ql-editor blockquote {
    margin:
        .55em 0;

    padding:
        6px 9px;

    border-left:
        3px solid rgba(98,
            217,
            154,
            .48);

    border-radius:
        0 5px 5px 0;
}

.geneo-rich-text-inspector-editor-shell .ql-editor a {
    color: #8BC8F5;
}

.geneo-rich-text-inspector-fallback {
    width: 100%;
    min-height: 150px;

    padding: 12px;

    border: 0;
    outline: 0;

    resize: vertical;

    background:
        transparent;

    color:
        var(--text-secondary);

    font: inherit;
    line-height: 1.55;
}

.geneo-rich-text-inspector-fallback[hidden] {
    display: none !important;
}

.geneo-rich-text-inspector-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.geneo-rich-text-inspector-preview {
    max-height: 180px;

    padding: 10px;

    overflow: auto;

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

    border-radius: 8px;

    background:
        var(--surface-input);

    color:
        var(--text-secondary);

    font-size: 14px;
    line-height: 1.5;
}

.geneo-rich-text-inspector-preview h2 {
    margin:
        .5em 0 .25em;

    color:
        var(--text-primary);

    font-size: 18px;
    line-height: 1.3;
}

.geneo-rich-text-inspector-preview h3 {
    margin:
        .45em 0 .2em;

    color:
        var(--text-primary);

    font-size: 16px;
    line-height: 1.35;
}

.geneo-canvas-stage.sticky-tool,
.geneo-canvas-stage.text-tool {
    cursor: crosshair;
}

.geneo-canvas-stage.sticky-tool .geneo-node,
.geneo-canvas-stage.text-tool .geneo-node {
    cursor: default;
}

.geneo-canvas-stage.sticky-tool .geneo-node-panel,
.geneo-canvas-stage.text-tool .geneo-node-panel {
    cursor: crosshair;
}

.geneo-node-text {
    box-shadow: none;
}

.geneo-text-copy {
    width: 100%;
    height: 100%;

    padding: 8px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
}

.geneo-text-copy h2 {
    margin:
        .3em 0 .18em;

    font-size: 26px;
    font-weight: 850;
    line-height: 1.15;
}

.geneo-text-copy h3 {
    margin:
        .3em 0 .18em;

    font-size: 22px;
    font-weight: 820;
    line-height: 1.2;
}

.geneo-node-text .geneo-rich-text-editor-shell .ql-editor {
    padding: 8px;

    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
}

.geneo-node-text .geneo-rich-text-editor-shell .ql-editor h2 {
    margin:
        .3em 0 .18em;

    font-size: 26px;
    font-weight: 850;
    line-height: 1.15;
}

.geneo-node-text .geneo-rich-text-editor-shell .ql-editor h3 {
    margin:
        .3em 0 .18em;

    font-size: 22px;
    font-weight: 820;
    line-height: 1.2;
}

.geneo-node-text .geneo-rich-text-fallback {
    padding: 8px;

    font-size: 18px;
    line-height: 1.35;
}

.geneo-node-panel {
    background: var(--geneo-node-bg);
    box-shadow: none;
}

.geneo-node-panel .geneo-node-content {
    padding: 12px 14px;
    pointer-events: none;
}

.geneo-panel-title {
    display: inline-flex;
    max-width: calc(100% - 24px);
    font-size: 13px;
    font-weight: 900;
    color: var(--geneo-node-text);
}

.geneo-node-shape {
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.geneo-node-shape:focus-visible,
.geneo-node-shape.selected {
    box-shadow: 0 0 0 2px var(--brand-green-300);
}

.geneo-node-shape .geneo-node-content {
    overflow: visible;
}

.geneo-shape-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.geneo-shape-svg :is(rect, ellipse, polygon, path) {
    fill: var(--geneo-node-bg);
    stroke: var(--geneo-node-stroke);
    stroke-width: var(--geneo-node-stroke-width);
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.geneo-node-shape.stroke-dashed .geneo-shape-svg :is(rect, ellipse, polygon, path) {
    stroke-dasharray: 8 7;
}

.geneo-node-shape.stroke-none .geneo-shape-svg :is(rect, ellipse, polygon, path) {
    stroke: none;
}

.geneo-node-drawing {
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.geneo-node-drawing .geneo-node-content {
    overflow: visible;
    pointer-events: none;
}

.geneo-node-drawing .geneo-resize-handle {
    pointer-events: auto;
}

.geneo-drawing-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    pointer-events: none;
}

.geneo-drawing-line {
    fill: none;
    stroke: var(--geneo-node-stroke);
    stroke-width: var(--geneo-node-stroke-width);
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.geneo-drawing-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 14px;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: stroke;
}

.geneo-node-drawing.stroke-dashed .geneo-drawing-line {
    stroke-dasharray: 8 7;
}

.geneo-node-drawing.stroke-none .geneo-drawing-line {
    stroke: none;
}

.geneo-node-drawing.selected .geneo-drawing-line {
    filter: drop-shadow(0 0 3px var(--brand-green-300));
}

.geneo-pencil-preview {
    fill: none;
    stroke: #D9E5E1;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.geneo-node-place {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.geneo-node-place .geneo-node-content {
    display: flex;
    align-items: stretch;
}

.geneo-place-node-content {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: var(--geneo-node-text);
}

.geneo-place-node-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: grid;
    place-items: center;
    color: var(--brand-green-300);
}

.geneo-place-node-icon svg {
    width: 19px;
    height: 19px;
    display: block;
}

.geneo-place-node-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 750;
}

.geneo-place-inspector-summary {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.geneo-place-inspector-summary>span {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--surface-selected);
    color: var(--brand-green-300);
}

.geneo-place-inspector-summary svg {
    width: 18px;
    height: 18px;
    display: block;
}

.geneo-place-inspector-summary div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.geneo-place-inspector-summary strong,
.geneo-place-inspector-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-place-inspector-summary span {
    color: var(--text-tertiary);
    font-size: 12px;
}

.geneo-place-inspector-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.geneo-place-inspector-actions .button.ghost {
    color: var(--text-secondary);
    background: transparent;
    border-color: var(--border-default);
}

.geneo-place-inspector-actions .button.ghost:hover {
    color: var(--text-primary);
    background: var(--surface-card-hover);
    border-color: var(--border-strong);
}

.geneo-place-inspector-actions .button.ghost:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

.geneo-stroke-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-3);
}

.geneo-stroke-settings .geneo-field {
    align-content: start;
}

.geneo-number-unit {
    position: relative;
    min-width: 0;
}

.geneo-number-unit .geneo-input {
    width: 100%;
    height: 42px;
    min-height: 42px;
    box-sizing: border-box;
    padding-right: 34px;
}

.geneo-number-unit span {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 12px;
    pointer-events: none;
}

.geneo-shape-kind-value {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-input);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    font-weight: 750;
}

.geneo-place-modal {
    width: min(790px,
            calc(100vw - 48px));

    height: min(600px,
            calc(100vh - 48px));

    max-height:
        calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.geneo-place-picker-form {
    width: 100%;
    height: 100%;

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

    display: flex;
    flex-direction: column;
}

.geneo-place-modal .modal-header {
    flex: 0 0 auto;

    padding:
        20px var(--space-6);
}

.geneo-place-picker-body {
    flex: 1 1 auto;

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

    padding:
        20px var(--space-6) 16px;

    display: grid;

    grid-template-rows:
        auto minmax(0, 1fr) auto auto auto;

    gap: 14px;

    overflow: hidden;
}

.geneo-place-picker-search {
    min-width: 0;
}

.geneo-place-picker-search label {
    margin-bottom:
        var(--space-2);
}

.geneo-place-picker-results-section {
    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.geneo-place-picker-results-heading {
    min-height: 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

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

.geneo-place-picker-results-heading h3 {
    margin: 0;

    color:
        var(--text-secondary);

    font-size: 13px;
    font-weight: 850;

    letter-spacing: .02em;
}

.geneo-place-picker-count {
    min-width: 26px;
    height: 24px;

    padding:
        0 8px;

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

    border-radius:
        999px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color:
        var(--text-tertiary);

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

    font-size: 12px;
    font-weight: 800;
}

.geneo-place-picker-results {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 112px;

    overflow-x: hidden;
    overflow-y: auto;

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

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

    background:
        rgba(10, 16, 14, .44);

    scrollbar-gutter:
        stable;
}

.geneo-place-picker-option {
    width: 100%;
    min-height: 60px;

    padding:
        10px 12px;

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

    border-radius: 0;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr) 24px;

    align-items: center;

    gap: var(--space-3);

    color:
        var(--text-primary);

    background:
        transparent;

    text-align: left;

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

.geneo-place-picker-option:last-child {
    border-bottom: 0;
}

.geneo-place-picker-option:hover {
    background:
        var(--surface-card-hover);
}

.geneo-place-picker-option:focus-visible {
    position: relative;
    z-index: 1;

    outline:
        2px solid var(--brand-green-300);

    outline-offset:
        -2px;
}

.geneo-place-picker-option.selected {
    background:
        var(--surface-selected);
}

.geneo-place-picker-option-copy {
    min-width: 0;

    display: grid;

    gap: 3px;
}

.geneo-place-picker-option-copy strong {
    overflow: hidden;

    color:
        var(--text-primary);

    font-size: 14px;
    font-weight: 850;

    line-height: 1.3;

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

.geneo-place-picker-option-copy span {
    overflow: hidden;

    color:
        var(--text-tertiary);

    font-size: 12px;

    line-height: 1.35;

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

.geneo-place-picker-check {
    width: 22px;
    height: 22px;

    display: grid;
    place-items: center;

    border-radius:
        50%;

    color:
        #06110d;

    background:
        var(--brand-green-300);
}

.geneo-place-picker-check[hidden] {
    display: none;
}

.geneo-place-picker-check svg {
    width: 14px;
    height: 14px;

    display: block;
}

.geneo-place-picker-empty {
    min-height: 112px;

    padding:
        var(--space-5);

    display: grid;
    place-items: center;

    color:
        var(--text-tertiary);

    text-align: center;
}

.geneo-place-picker-empty div {
    max-width: 420px;

    display: grid;

    gap: 5px;
}

.geneo-place-picker-empty strong {
    color:
        var(--text-secondary);

    font-size: 14px;
}

.geneo-place-picker-empty span {
    font-size: 12px;

    line-height: 1.45;
}

.geneo-place-board-choice-host:empty {
    display: none;
}

.geneo-place-board-choice {
    width: 100%;
    min-height: 68px;

    padding:
        10px 12px;

    border:
        1px solid rgba(98, 217, 154, .22);

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

    display: grid;

    grid-template-columns:
        minmax(0, 1fr) 24px;

    align-items: center;

    gap: var(--space-3);

    color:
        var(--text-primary);

    background:
        rgba(47, 174, 116, .045);

    text-align: left;

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

.geneo-place-board-choice:hover {
    border-color:
        rgba(98, 217, 154, .42);

    background:
        rgba(47, 174, 116, .09);
}

.geneo-place-board-choice:focus-visible {
    outline:
        2px solid var(--brand-green-300);

    outline-offset:
        2px;
}

.geneo-place-board-choice.selected {
    border-color:
        rgba(98, 217, 154, .6);

    background:
        var(--surface-selected);
}

.geneo-place-board-choice-copy {
    min-width: 0;

    display: grid;

    gap: 2px;
}

.geneo-place-board-choice-copy strong {
    color:
        var(--brand-green-300);

    font-size: 13px;
}

.geneo-place-board-choice-name {
    overflow: hidden;

    color:
        var(--text-primary);

    font-size: 14px;
    font-weight: 850;

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

.geneo-place-board-choice-meta {
    color:
        var(--text-tertiary);

    font-size: 12px;
}

.geneo-place-modal-help {
    margin: 0;

    color:
        var(--text-tertiary);

    font-size: 12px;

    line-height: 1.45;
}

.geneo-place-picker-error:empty {
    display: none;
}

.geneo-place-modal .modal-footer {
    flex: 0 0 auto;

    min-height: 76px;

    padding:
        16px var(--space-6);

    align-items: center;
}

@media (max-width: 700px) {
    .geneo-place-modal {
        width:
            calc(100vw - 24px);

        height:
            calc(100vh - 24px);

        max-height:
            calc(100vh - 24px);
    }

    .geneo-place-modal .modal-header {
        padding:
            var(--space-4);
    }

    .geneo-place-picker-body {
        padding:
            var(--space-4);

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

    .geneo-place-modal .modal-footer {
        min-height: 68px;

        padding:
            12px var(--space-4);
    }
}

.geneo-canvas-stage.shape-tool,
.geneo-canvas-stage.shape-tool .geneo-node-panel {
    cursor: crosshair;
}

.geneo-canvas-stage.pencil-tool {
    cursor: crosshair;
    touch-action: none;
}

.geneo-inline-editor {
    width: 100%;
    height: 100%;
    min-height: 0;
    resize: none;
    border: 0;
    outline: 0;
    background: rgba(3, 8, 7, .5);
    color: inherit;
    padding: 10px;
    font: inherit;
}

.geneo-port {
    position: absolute;
    z-index: 33;
    width: 14px;
    height: 14px;
    padding: 0;
    border: 2px solid #0b1210;
    border-radius: 50%;
    background: #62d99a;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    scale: .82;
    transition: opacity var(--ease), visibility var(--ease), scale var(--ease), background-color var(--ease);
}

.geneo-node:hover .geneo-port,
.geneo-node:focus-within .geneo-port,
.geneo-node.selected .geneo-port,
.geneo-canvas-stage.connection-tool .geneo-port,
.geneo-canvas-stage.is-connecting .geneo-port,
.geneo-canvas-stage.show-sockets .geneo-port {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    scale: 1;
}

.geneo-port:hover,
.geneo-port:focus-visible,
.geneo-port.active {
    scale: 1.22;
    background: #fff;
    outline: 2px solid #62d99a;
    outline-offset: 2px;
}

.geneo-port[data-geneo-port="top"] {
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
}

.geneo-port[data-geneo-port="bottom"] {
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
}

.geneo-port[data-geneo-port="left"] {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
}

.geneo-port[data-geneo-port="right"] {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
}

.geneo-resize-handle {
    position: absolute;
    z-index: 31;
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid #0b1210;
    border-radius: 3px;
    background: #f5faf7;
}

.geneo-resize-handle.nw {
    left: -7px;
    top: -7px;
    cursor: nwse-resize;
}

.geneo-resize-handle.ne {
    right: -7px;
    top: -7px;
    cursor: nesw-resize;
}

.geneo-resize-handle.se {
    right: -7px;
    bottom: -7px;
    cursor: nwse-resize;
}

.geneo-resize-handle.sw {
    left: -7px;
    bottom: -7px;
    cursor: nesw-resize;
}

.geneo-resize-edge {
    position: absolute;
    z-index: 29;
    padding: 0;
    border: 0;
    background: transparent;
}

.geneo-resize-edge.n,
.geneo-resize-edge.s {
    left: 14px;
    right: 14px;
    height: 10px;
    cursor: ns-resize;
}

.geneo-resize-edge.n {
    top: -5px;
}

.geneo-resize-edge.s {
    bottom: -5px;
}

.geneo-resize-edge.e,
.geneo-resize-edge.w {
    top: 14px;
    bottom: 14px;
    width: 10px;
    cursor: ew-resize;
}

.geneo-resize-edge.e {
    right: -5px;
}

.geneo-resize-edge.w {
    left: -5px;
}

.geneo-resize-edge:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 1px;
    background: rgba(98, 217, 154, .12);
}

.geneo-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    overflow: visible;
    pointer-events: none;
}

.geneo-connection-line {
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}

.geneo-export-host {
    position: fixed;
    left: -100000px;
    top: 0;
    z-index: -1;
    visibility: visible;
    pointer-events: none;
}

.geneo-export-snapshot {
    position: relative;
    overflow: hidden;
}

.geneo-export-snapshot .geneo-canvas-stage {
    transform: none !important;
}

.geneo-connection-selection-guide {
    display: none;
    fill: none;
    stroke: var(--brand-green-300);
    stroke-width: 2;
    stroke-dasharray: 5 5;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}

.geneo-connection.no-stroke.selected .geneo-connection-selection-guide {
    display: block;
}

.geneo-connection-hit {
    fill: none;
    stroke: transparent;
    stroke-width: var(--geneo-connection-hit-width, 14px);
    pointer-events: stroke;
    cursor: pointer;
}

.geneo-segment-hit {
    stroke: transparent;
    stroke-width: var(--geneo-segment-hit-width, 18px);
    pointer-events: stroke;
    cursor: move;
}

.geneo-connection-preview {
    fill: none;
    stroke: #8ce9b9;
    stroke-width: 2;
    stroke-dasharray: 7 6;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(98, 217, 154, .52));
}

.geneo-connection.selected .geneo-connection-line {
    filter: drop-shadow(0 0 3px #62d99a);
}

.geneo-waypoint {
    fill: #0d1513;
    stroke: #62d99a;
    stroke-width: 2;
    pointer-events: all;
    cursor: move;
}

.geneo-waypoint.selected {
    fill: #62d99a;
}

.geneo-family-junction {
    fill: #62d99a;
    stroke: #0a100e;
    stroke-width: 3;
    opacity: 0;
    pointer-events: none;
    cursor: crosshair;
    transition: opacity var(--ease);
}

.geneo-connection:hover .geneo-family-junction,
.geneo-connection.selected .geneo-family-junction,
.geneo-canvas-stage.connection-tool .geneo-family-junction,
.geneo-canvas-stage.is-connecting .geneo-family-junction,
.geneo-canvas-stage.show-sockets .geneo-family-junction,
.geneo-family-junction:focus-visible {
    opacity: 1;
    pointer-events: all;
}

.geneo-family-junction:focus {
    outline: none;
}

.geneo-family-junction:focus-visible {
    filter: drop-shadow(0 0 4px #62d99a);
}

.geneo-relationship-date {
    pointer-events: none;
}

.geneo-relationship-date rect {
    fill: rgba(15, 20, 19, .94);
    stroke: rgba(98, 217, 154, .35);
    stroke-width: 1;
}

.geneo-relationship-date text {
    fill: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.geneo-relationship-editor {
    gap: var(--space-3);
}

.geneo-relationship-storage,
.geneo-selection-help,
.geneo-selection-more {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.45;
}

.geneo-selection-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
}

.geneo-person-summary {
    margin: 0;
    display: grid;
    gap: 8px;
}

.geneo-person-summary>div {
    min-width: 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.geneo-person-summary dt {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.geneo-person-summary dd {
    margin: 0;
    min-width: 0;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.geneo-person-modal {
    width: min(940px, 100%);
}

.geneo-person-grid.is-editing {
    grid-template-columns: minmax(0, 1fr);
}

.geneo-person-form {
    display: grid;
    gap: var(--space-6);
    min-width: 0;
}

.geneo-person-match-rail {
    min-width: 0;
}

.geneo-person-modal .genealogy-date-field {
    width: 100%;
    --genealogy-date-input-column: minmax(260px, 1fr);
}

.geneo-person-modal .add-person-match-list {
    padding: var(--space-2);
}

.geneo-person-modal .add-person-match-action {
    width: calc(100% - (var(--space-3) * 2));
    margin: 0 var(--space-3) var(--space-3);
}

.geneo-person-modal .add-person-match-empty {
    min-height: 132px;
}

[data-geneo-maiden-name][hidden] {
    display: none !important;
}

.geneo-person-modal .place-combobox-list {
    z-index: 180;
}

/* Canonical Geneograph paint controls */
.geneo-paint-row {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.geneo-paint-row-heading {
    min-width: 0;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.geneo-paint-heading-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.geneo-paint-label {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geneo-paint-state {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: rgba(255, 255, 255, .025);
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.geneo-paint-state[hidden] {
    display: none;
}

.geneo-paint-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 72px;
    gap: 8px;
    align-items: center;
}

.geneo-paint-controls.is-color-only {
    grid-template-columns: 36px minmax(0, 1fr);
}

.geneo-paint-swatch,
.geneo-paint-suggestions button {
    position: relative;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--border-strong);
    background:
        conic-gradient(#8A9692 25%,
            #505B57 0 50%,
            #8A9692 0 75%,
            #505B57 0) 0 0 / 8px 8px;
}

.geneo-paint-swatch {
    width: 36px;
    height: 36px;
    border-radius: 7px;
}

.geneo-paint-swatch>span {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: var(--geneo-paint-rendered);
}

.geneo-paint-swatch:hover:not(:disabled) {
    border-color: var(--brand-green-300);
}

.geneo-paint-swatch:disabled {
    opacity: 1;
    cursor: default;
}

.geneo-paint-row.is-none .geneo-paint-swatch>span {
    opacity: .14;
}

.geneo-paint-row.is-none .geneo-paint-swatch::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 2px;
    border-radius: 999px;
    background: var(--red);
    box-shadow: 0 0 0 1px rgba(7, 16, 13, .55);
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

.geneo-paint-swatch:focus-visible,
.geneo-paint-action:focus-visible,
.geneo-paint-popover button:focus-visible,
.geneo-paint-popover input:focus-visible,
.geneo-paint-sv:focus-visible {
    outline: 2px solid var(--brand-green-300);
    outline-offset: 2px;
}

.geneo-paint-hex,
.geneo-paint-opacity-number input,
.geneo-paint-popover-fields input {
    min-width: 0;
    width: 100%;
    height: 36px;
    border: 1px solid var(--border-default);
    border-radius: 7px;
    background: rgba(255, 255, 255, .025);
    color: var(--text-primary);
    padding: 0 10px;
    font: inherit;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    outline: 0;
}

.geneo-paint-hex:focus,
.geneo-paint-opacity-number input:focus,
.geneo-paint-popover-fields input:focus {
    border-color: var(--brand-green-300);
}

.geneo-paint-hex.invalid,
.geneo-paint-popover-fields input.invalid {
    border-color: var(--red);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent);
}

.geneo-paint-opacity-number,
.geneo-paint-percent-input {
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.geneo-paint-opacity-number input,
.geneo-paint-percent-input input {
    padding-right: 24px;
}

.geneo-paint-opacity-number>span,
.geneo-paint-percent-input>span:last-child {
    position: absolute;
    right: 8px;
    color: var(--text-tertiary);
    font-size: 11px;
    pointer-events: none;
}

.geneo-paint-action {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.geneo-paint-action:hover {
    border-color: var(--border-default);
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.geneo-paint-row.is-none .geneo-paint-action {
    color: var(--brand-green-300);
}

.geneo-paint-row input:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.geneo-appearance-group {
    min-width: 0;
    display: grid;
    gap: 9px;
}

.geneo-appearance-group+.geneo-appearance-group {
    padding-top: 13px;
    border-top: 1px solid var(--border-default);
}

.geneo-appearance-subfield {
    min-width: 0;
    margin-left: 0;
}

.common-select.geneo-pattern-select:disabled,
.common-select.geneo-pattern-select:disabled:hover {
    border-color: var(--border-default);
    background: var(--surface-input);
    color: var(--text-tertiary);
    opacity: .55;
    cursor: not-allowed;
}

.geneo-pattern-select:disabled+.common-select-chevron {
    opacity: .45;
}

.geneo-paint-popover {
    position: fixed;
    z-index: 220;
    max-width: calc(100vw - 16px);
    overflow: auto;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface-sidebar);
    color: var(--text-primary);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .46);
    animation: geneo-paint-open 110ms ease-out;
}

@keyframes geneo-paint-open {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.geneo-paint-popover-header {
    position: sticky;
    z-index: 2;
    top: 0;
    min-height: 42px;
    padding: 0 8px 0 12px;
    border-bottom: 1px solid var(--border-default);
    background: var(--surface-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.geneo-paint-popover-header strong {
    font-size: 13px;
}

.geneo-paint-popover-header button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    display: grid;
    place-items: center;
}

.geneo-paint-popover-header button:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.geneo-paint-popover-header svg {
    width: 16px;
    height: 16px;
    display: block;
}

.geneo-paint-popover-body {
    padding: 12px;
    display: grid;
    gap: 12px;
}

.geneo-paint-sv {
    position: relative;
    width: 100%;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 7px;
    overflow: hidden;
    cursor: crosshair;
    background:
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, transparent),
        hsl(var(--geneo-hue) 100% 50%);
    touch-action: none;
}

.geneo-paint-sv>span {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #07100D, 0 2px 6px rgba(0, 0, 0, .45);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.geneo-paint-popover.is-none .geneo-paint-sv {
    opacity: .48;
    cursor: not-allowed;
}

.geneo-paint-slider-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.geneo-paint-slider-row input[type="range"] {
    appearance: none;
    width: 100%;
    height: 14px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: linear-gradient(to right, #F00, #FF0, #0F0, #0FF, #00F, #F0F, #F00);
}

.geneo-paint-slider-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #101817;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
}

.geneo-paint-slider-row input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #101817;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
}

.geneo-paint-slider-row input[type="range"].geneo-paint-alpha {
    --geneo-paint-opacity: 100%;
    --geneo-alpha-preview:
        color-mix(in srgb,
            var(--geneo-paint-color) var(--geneo-paint-opacity),
            transparent);

    background:
        linear-gradient(to right,
            transparent,
            var(--geneo-paint-color)),
        conic-gradient(#8A9692 25%,
            #505B57 0 50%,
            #8A9692 0 75%,
            #505B57 0) 0 0 / 8px 8px;
}

.geneo-paint-slider-row input[type="range"].geneo-paint-alpha::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 50%;
    background:
        linear-gradient(var(--geneo-alpha-preview),
            var(--geneo-alpha-preview)),
        conic-gradient(#8A9692 25%,
            #505B57 0 50%,
            #8A9692 0 75%,
            #505B57 0) 0 0 / 6px 6px;
    box-shadow:
        0 0 0 1px rgba(7, 16, 13, .75),
        0 2px 6px rgba(0, 0, 0, .5);
}

.geneo-paint-slider-row input[type="range"].geneo-paint-alpha::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background:
        linear-gradient(var(--geneo-alpha-preview),
            var(--geneo-alpha-preview)),
        conic-gradient(#8A9692 25%,
            #505B57 0 50%,
            #8A9692 0 75%,
            #505B57 0) 0 0 / 6px 6px;
    box-shadow:
        0 0 0 1px rgba(7, 16, 13, .75),
        0 2px 6px rgba(0, 0, 0, .5);
}

.geneo-paint-popover-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 10px;
}

.geneo-paint-popover-fields label {
    min-width: 0;
    display: grid;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
}

.geneo-paint-suggestions {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

.geneo-paint-suggestions button {
    min-width: 0;
    min-height: 30px;
    aspect-ratio: 1;
    border-radius: 6px;
}

.geneo-paint-suggestions button::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: var(--geneo-suggestion);
}

.geneo-paint-suggestions button::before {
    content: "✓";
    position: absolute;
    z-index: 1;
    inset: 0;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, .9),
        0 0 4px rgba(0, 0, 0, .55);
    opacity: 0;
    transform: scale(.78);
    transition:
        opacity var(--ease),
        transform var(--ease);
}

.geneo-paint-suggestions button[aria-pressed="true"] {
    border-color: var(--brand-green-300);
    box-shadow:
        inset 0 0 0 2px rgba(15, 20, 19, .78),
        0 0 0 1px var(--brand-green-300);
}

.geneo-paint-suggestions button[aria-pressed="true"]::before {
    opacity: 1;
    transform: scale(1);
}

.geneo-paint-suggestions button:hover {
    border-color: #fff;
    transform: translateY(-1px);
}

.geneo-paint-suggestions button:disabled {
    opacity: .45;
    transform: none;
    cursor: not-allowed;
}

.geneo-paint-popover-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
}

.geneo-paint-none {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 800;
}

.geneo-paint-none:hover {
    background: var(--surface-card-hover);
    color: var(--text-primary);
}

.geneo-contrast-warning {
    margin: 0;
    padding: 8px 9px;
    border: 1px solid rgba(212, 170, 107, .28);
    border-radius: 6px;
    background: rgba(212, 170, 107, .08);
    color: #E4C797;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    font-size: 11px;
    line-height: 1.4;
}

.geneo-contrast-warning[hidden] {
    display: none;
}

.geneo-contrast-warning svg {
    width: 16px;
    height: 16px;
}

.geneo-layer-paint-status {
    flex: 0 0 auto;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 800;
}

.geneo-layer-paint-status[hidden] {
    display: none;
}

@media (max-width:480px) {
    .geneo-paint-controls {
        grid-template-columns: 36px minmax(0, 1fr) 68px;
        gap: 7px;
    }

    .geneo-paint-controls.is-color-only {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .geneo-paint-suggestions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .geneo-paint-suggestions button {
        min-height: 34px;
    }

    .geneo-paint-sv {
        height: 132px;
    }
}

.geneo-layer-panel {
    min-width: 0;
}

.geneo-layer-panel-head {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
}

.geneo-layer-panel-head .geneo-layer-row {
    min-width: 0;
}

.geneo-layer-disclosure {
    width: 24px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
}

.geneo-layer-disclosure svg {
    width: 14px;
    height: 14px;
    transform: rotate(-90deg);
    transition: transform var(--ease);
}

.geneo-layer-disclosure[aria-expanded="false"] svg {
    transform: rotate(90deg);
}

.geneo-layer-row {
    padding-left: calc(7px + var(--layer-depth, 0) * 18px);
}

.geneo-person-picker {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 480px;
    overflow: auto;
}

.geneo-person-picker>button {
    min-width: 0;
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    text-align: left;
}

.geneo-person-picker>button:hover {
    border-color: var(--brand-green-300);
    background: var(--surface-card-hover);
}

.geneo-person-picker small {
    display: block;
    margin-top: 3px;
    color: var(--text-tertiary);
}

.geneo-image-picker>button,
.geneo-person-picker>button {
    min-width: 0;
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 8px;
    text-align: left;
}

.geneo-image-picker>button:hover,
.geneo-person-picker>button:hover {
    border-color: var(--brand-green-300);
    background: var(--surface-card-hover);
}

.geneo-person-picker>button {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
}

.geneo-person-picker small {
    display: block;
    margin-top: 3px;
    color: var(--text-tertiary);
}

@media (max-width: 900px) {
    .geneo-editor-main,
    .geneo-editor-main.inspector-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    .geneo-inspector {
        position: absolute;
        z-index: 50;
        right: 0;
        top: 0;
        bottom: 0;
        width: min(var(--inspector-width), 90vw);
        min-width: 0;
        box-shadow: -14px 0 36px rgba(0, 0, 0, .35);
    }

    .geneo-inspector.collapsed {
        width: var(--inspector-collapsed-width);
        min-width: var(--inspector-collapsed-width);
    }
}
