body { font-family: Segoe UI, Arial, sans-serif; margin: 20px; background-color: #f0f2f5; color: #333; }
        h1, h2, h3 { margin-top: 0; color: #1a1a1a; }
        .main-layout { display: flex; gap: 20px; height: 85vh; }
        .control-panel { width: 38%; background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); overflow-y: auto; }
        .display-panel { width: 62%; display: flex; flex-direction: column; gap: 15px; }
        #mynetwork { flex-grow: 1; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border: 1px solid #e0e0e0; min-height: 600px; }
        
        .tab-buttons { display: flex; gap: 5px; margin-bottom: 15px; border-bottom: 2px solid #ddd; padding-bottom: 5px; }
        .tab-btn { background: #e4e6eb; color: #050505; border: none; padding: 8px 12px; cursor: pointer; border-radius: 6px; font-weight: bold; }
        .tab-btn.active { background: #008CBA; color: white; }
        .tab-content { display: none; }
        .tab-content.active { display: block; }

        .form-group { margin-bottom: 12px; }
        .form-row { display: flex; gap: 10px; }
        .form-row .form-group { flex: 1; }
        label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
        input, select, button, textarea { width: 100%; padding: 9px; box-sizing: border-box; border-radius: 6px; border: 1px solid #ccd0d5; font-size: 14px; }
        
        .search-input { background-color: #fafafa; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: none; font-style: italic; }
        .search-input:focus { background-color: #fff; }
        .select-with-search { border-top-left-radius: 0; border-top-right-radius: 0; }

        button.primary-btn { background-color: #008CBA; color: white; border: none; cursor: pointer; font-weight: bold; }
        button.primary-btn:hover { background-color: #007B9A; }
        button.danger-btn { background-color: #d32f2f; color: white; border: none; cursor: pointer; }
        button.warning-btn { background-color: #f57c00; color: white; border: none; cursor: pointer; font-weight: bold; }
        
        .list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; background: #f8f9fa; border: 1px solid #eee; margin-bottom: 5px; border-radius: 4px; }
        .list-actions { display: flex; gap: 5px; }
        .mini-btn { width: auto; padding: 4px 8px; font-size: 12px; cursor: pointer; border-radius: 4px; border: 1px solid #ccc; background: white; }
        .info-box { background: #e7f3f5; padding: 10px; border-right: 4px solid #008CBA; font-size: 13px; border-radius: 4px; margin-bottom: 15px; }
        .status-box { background: #fff3cd; border-right: 4px solid #ffc107; padding: 10px; font-size: 13px; border-radius: 4px; margin-bottom: 15px; font-weight: bold; }
        .status-connected { background: #d4edda; border-right: 4px solid #28a745; color: #155724; }

        .modal-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }
        .modal-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 25px rgba(0,0,0,0.3); z-index: 1000; width: 340px; }

        .view-controls { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: flex; gap: 20px; align-items: center; justify-content: space-between; }
        .view-controls-group { display: flex; align-items: center; gap: 10px; }
        .view-controls-group label { display: inline; font-weight: bold; margin: 0; }
        .view-controls-group input[type="checkbox"] { width: auto; cursor: pointer; }
        .view-controls-group select { width: 220px; }
        .legend-box { font-size: 12px; color: #555; background: #eee; padding: 4px 8px; border-radius: 4px; font-weight: normal; }

.empty-list-message {
    padding: 12px;
    text-align: center;
    color: #777;
    background: #fafafa;
    border: 1px dashed #d5d5d5;
    border-radius: 6px;
}

.version-badge {
    position: fixed;
    left: 12px;
    bottom: 10px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    z-index: 50;
}

.list-item small {
    color: #666;
    line-height: 1.6;
}

.relation-warning {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    background: #fff3cd;
    color: #8a5a00;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}


/* חלוקה התחלתית: 20% ניהול, 80% אילן */
.main-layout {
    display: grid;
    grid-template-columns: minmax(260px, 20%) 8px minmax(0, 80%);
    gap: 0;
    height: 85vh;
}

.control-panel {
    width: auto;
    min-width: 0;
    margin-left: 8px;
}

.display-panel {
    width: auto;
    min-width: 0;
    margin-right: 8px;
}

.layout-splitter {
    width: 8px;
    cursor: col-resize;
    position: relative;
    background: transparent;
    touch-action: none;
}

.layout-splitter::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 3px;
    width: 2px;
    border-radius: 2px;
    background: #c7ccd1;
}

.layout-splitter:hover::before,
.layout-splitter.dragging::before,
.layout-splitter:focus-visible::before {
    left: 2px;
    width: 4px;
    background: #008CBA;
}

body.layout-resizing {
    cursor: col-resize;
    user-select: none;
}

@media (max-width: 900px) {
    .main-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        gap: 15px;
    }

    .control-panel,
    .display-panel {
        width: 100%;
        margin: 0;
    }

    .layout-splitter {
        display: none;
    }
}


.graph-error-message {
    margin: 40px;
    padding: 20px;
    text-align: center;
    line-height: 1.8;
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
}


.layout-fallback-warning {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    max-width: 420px;
    padding: 8px 12px;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 13px;
}

#mynetwork {
    position: relative;
}


.family-tree-svg {
    width: 100%;
    height: 100%;
    display: block;
    background: #fff;
}

.svg-person-node {
    cursor: pointer;
}

.svg-fallback-notice {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 5px 9px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #d7dce1;
    border-radius: 5px;
    color: #5c6770;
    font-size: 12px;
}

#mynetwork {
    position: relative;
}


.svg-tree-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}

.svg-tree-viewport.dragging {
    cursor: grabbing;
}

.svg-tree-toolbar {
    position: absolute;
    left: 14px;
    bottom: 42px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #d7dce1;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.svg-tree-toolbar button {
    width: 34px;
    height: 32px;
    border: 1px solid #c8d0d7;
    border-radius: 6px;
    background: #fff;
    color: #263238;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.svg-tree-toolbar button:hover {
    background: #eef7fb;
    border-color: #008cba;
}

.svg-zoom-label {
    min-width: 52px;
    text-align: center;
    font-size: 13px;
    color: #455a64;
}


.person-context-menu {
    position: fixed;
    z-index: 1000;
    display: none;
    min-width: 190px;
    padding: 6px;
    background: #fff;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.person-context-menu.visible {
    display: block;
}

.person-context-menu button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    text-align: right;
    font-size: 14px;
    color: #263238;
    cursor: pointer;
}

.person-context-menu button:hover,
.person-context-menu button:focus {
    background: #eef7fb;
    outline: none;
}


.person-info-card {
    position: fixed;
    top: 90px;
    left: 24px;
    z-index: 900;
    display: none;
    width: min(360px, calc(100vw - 48px));
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.20);
    direction: rtl;
}

.person-info-card.visible {
    display: block;
}

.person-info-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #f4fbfe;
    border-bottom: 1px solid #dbe7ec;
}

.person-info-header h3 {
    margin: 0;
    font-size: 18px;
    color: #183642;
}

.person-info-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #546e7a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.person-info-close:hover {
    background: #e7f2f6;
}

.person-info-body {
    padding: 14px 16px 4px;
}

.person-info-section {
    margin-bottom: 16px;
}

.person-info-section h4 {
    margin: 0 0 8px;
    padding-bottom: 5px;
    color: #006b8f;
    border-bottom: 1px solid #e5ecef;
    font-size: 15px;
}

.person-info-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    padding: 5px 0;
}

.person-info-label {
    color: #607d8b;
    font-weight: 600;
}

.person-info-value {
    color: #263238;
}

.person-info-list {
    margin: 0;
    padding-right: 18px;
}

.person-info-list li {
    margin-bottom: 7px;
}

.person-info-list small {
    display: block;
    color: #78909c;
}

.person-info-status {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #edf5f8;
    color: #45636f;
    font-size: 11px;
}

.person-info-empty {
    color: #90a4ae;
    font-style: italic;
}

.person-info-notes {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

.person-info-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e3eaed;
}

.person-info-actions button {
    width: 100%;
}

@media (max-width: 700px) {
    .person-info-card {
        top: 70px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}


.person-context-separator {
    height: 1px;
    margin: 5px 3px;
    background: #e2e8eb;
}

.person-context-menu button.context-danger {
    color: #b42318;
}

.person-context-menu button.context-danger:hover,
.person-context-menu button.context-danger:focus {
    background: #fff0f0;
}


.person-info-actions {
    grid-template-columns: 1fr 1fr;
}

.person-info-actions #addParentsFromInfo {
    grid-column: 1 / -1;
}


.parents-wizard-modal {
    width: min(520px, calc(100vw - 36px));
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    direction: rtl;
}

.wizard-person-summary {
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #eef8fc;
    border-right: 4px solid #008cba;
    border-radius: 6px;
}

.wizard-note {
    margin: 12px 0 16px;
    padding: 10px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    color: #6d4c00;
    font-size: 13px;
    line-height: 1.6;
}


.child-wizard-modal {
    width: min(500px, calc(100vw - 36px));
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    direction: rtl;
}

.child-wizard-modal select,
.child-wizard-modal input {
    width: 100%;
}


.spouse-wizard-modal {
    width: min(520px, calc(100vw - 36px));
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    direction: rtl;
}

.spouse-wizard-modal input,
.spouse-wizard-modal select,
.spouse-wizard-modal textarea {
    width: 100%;
}

.hidden {
    display: none !important;
}

.app-toast {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 2000;
    min-width: 260px;
    max-width: min(440px, calc(100vw - 48px));
    padding: 12px 16px;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #fff;
    direction: rtl;
    text-align: right;
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.success {
    background: #2e7d32;
}

.app-toast.error {
    background: #b42318;
}

.app-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    .app-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        min-width: 0;
        max-width: none;
    }
}


.svg-relationship,
.svg-relationship-node {
    cursor: pointer;
}

.svg-relationship:hover line:not(.svg-relationship-hit),
.svg-relationship-node:hover {
    filter: brightness(0.82);
}

.relationship-end-btn {
    border-color: #8d6e63;
    color: #6d4c41;
}

.relationship-delete-btn {
    border-color: #c62828;
    color: #b71c1c;
}

.relationship-delete-btn:hover {
    background: #ffebee;
}


.tree-action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.tree-action-btn {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #b8c5cc;
    border-radius: 6px;
    background: #ffffff;
    color: #264653;
    font-size: 13px;
    cursor: pointer;
}

.tree-action-btn:hover:not(:disabled) {
    background: #eef8fc;
    border-color: #008cba;
}

.tree-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .tree-action-buttons {
        width: 100%;
    }

    .tree-action-btn {
        flex: 1 1 auto;
    }
}


#undoBtn:not(:disabled),
#redoBtn:not(:disabled) {
    border-color: #7e57c2;
    color: #5e35b1;
}

#undoBtn:hover:not(:disabled),
#redoBtn:hover:not(:disabled) {
    background: #f3eefe;
    border-color: #5e35b1;
}


.compact-tree-controls {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -8px -8px 12px;
    padding: 8px;
    background: #f6fbfd;
    border: 1px solid #d7e5eb;
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(0,0,0,0.06);
}

.compact-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 7px;
}

.compact-tool-btn {
    min-height: 31px;
    padding: 4px 5px;
    border: 1px solid #b7c7ce;
    border-radius: 5px;
    background: #fff;
    color: #29434e;
    font-size: 12px;
    cursor: pointer;
}

.compact-tool-btn:hover:not(:disabled) {
    background: #eaf6fa;
    border-color: #008cba;
}

.compact-tool-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.excel-tool-btn {
    border-color: #2e7d32;
    color: #1b5e20;
}

.compact-focus-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.compact-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    white-space: nowrap;
    font-size: 12px;
}

.compact-checkbox-label input {
    width: auto;
    margin: 0;
}

.compact-focus-select {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 5px;
}

.compact-focus-select label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
}

.compact-focus-select select {
    width: 100%;
    min-width: 0;
    padding: 5px;
    font-size: 12px;
}

.display-panel {
    position: relative;
}

.panel-toggle-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 60;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid #aebdc4;
    border-radius: 6px;
    background: rgba(255,255,255,0.94);
    color: #37474f;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(0,0,0,0.09);
}

.main-layout.settings-collapsed {
    display: block !important;
    width: 100%;
    height: 85vh;
}

.main-layout.settings-collapsed .control-panel,
.main-layout.settings-collapsed .layout-splitter {
    display: none !important;
}

.main-layout.settings-collapsed .display-panel {
    display: flex;
    width: 100% !important;
    height: 100%;
    min-width: 0;
    margin: 0 !important;
}

.main-layout.settings-collapsed #mynetwork {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
}

@media (max-width: 900px) {
    .compact-tree-controls {
        position: static;
    }

    .panel-toggle-btn {
        display: none;
    }
}


.media-manager-modal {
    width: min(620px, calc(100vw - 36px));
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    direction: rtl;
}

.media-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.media-manager-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 18px;
}

.media-list-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: start;
    padding: 10px;
    border: 1px solid #dbe4e8;
    border-radius: 8px;
    background: #f9fcfd;
}

.media-list-icon {
    font-size: 24px;
}

.media-list-content {
    display: grid;
    gap: 3px;
}

.media-list-content small {
    color: #78909c;
}

.media-list-content p {
    margin: 3px 0 0;
    line-height: 1.5;
}

.media-delete-btn {
    border: 1px solid #ef9a9a;
    border-radius: 5px;
    background: #fff;
    color: #b71c1c;
    cursor: pointer;
}

.media-empty-state {
    padding: 18px;
    text-align: center;
    color: #78909c;
    border: 1px dashed #b0bec5;
    border-radius: 8px;
}

.media-form-heading {
    margin: 0 0 10px;
    color: #006b8f;
}

.media-primary-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
}

.media-primary-label input {
    width: auto;
}

.media-action-btn {
    grid-column: 1 / -1;
}

.person-media-summary {
    display: grid;
    gap: 5px;
}

.person-media-summary-item {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 5px 7px;
    background: #f4f8fa;
    border-radius: 5px;
}


.media-upload-help {
    display: block;
    margin-top: 5px;
    color: #607d8b;
    font-size: 12px;
}

.media-image-preview {
    display: grid;
    gap: 8px;
    justify-items: start;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    background: #f8fbfc;
}

.media-image-preview img {
    display: block;
    max-width: 240px;
    max-height: 180px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.media-list-thumbnail {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #cfd8dc;
}

#mediaImageFile {
    padding: 7px;
    border: 1px dashed #90a4ae;
    border-radius: 6px;
    background: #fff;
}


.media-thumbnail-button,
.person-primary-photo-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.media-thumbnail-button:hover img,
.person-primary-photo-button:hover img {
    filter: brightness(0.92);
}

.person-primary-photo-button {
    display: block;
    width: 100%;
    margin-bottom: 14px;
}

.person-primary-photo {
    display: block;
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    border-radius: 9px;
    background: #eef3f5;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.image-lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.88);
}

.image-lightbox-backdrop.visible {
    display: flex;
}

.image-lightbox-dialog {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(1100px, 96vw);
    height: min(850px, 92vh);
    color: #fff;
}

.image-lightbox-image {
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-lightbox-close {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

.image-lightbox-nav {
    width: 48px;
    height: 64px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.13);
    color: #fff;
    font-size: 44px;
    cursor: pointer;
}

.image-lightbox-nav:hover,
.image-lightbox-close:hover {
    background: rgba(255,255,255,0.25);
}

.image-lightbox-prev {
    grid-column: 1;
    grid-row: 1;
}

.image-lightbox-next {
    grid-column: 3;
    grid-row: 1;
}

.image-lightbox-caption {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    gap: 4px;
    text-align: center;
}

.image-lightbox-caption strong {
    font-size: 18px;
}

.image-lightbox-caption span {
    color: #cfd8dc;
    font-size: 13px;
}

.image-lightbox-caption p {
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 650px) {
    .image-lightbox-backdrop {
        padding: 10px;
    }

    .image-lightbox-dialog {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        width: 100%;
        height: 94vh;
    }

    .image-lightbox-nav {
        width: 36px;
        height: 50px;
        font-size: 34px;
    }
}


.photo-tree-toggle {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #dbe7ec;
}

.svg-person-node image {
    pointer-events: none;
}

.svg-person-node text {
    pointer-events: none;
}


:root {
    --modern-bg: #eef3f7;
    --modern-surface: #ffffff;
    --modern-soft: #f6f9fb;
    --modern-border: #dbe5ea;
    --modern-text: #203038;
    --modern-muted: #64777f;
    --modern-accent: #0b8fbd;
    --modern-accent-dark: #076d91;
    --modern-shadow: 0 10px 30px rgba(32, 48, 56, 0.08);
}

body {
    background: linear-gradient(
        180deg,
        #f8fafc 0%,
        var(--modern-bg) 100%
    );
    color: var(--modern-text);
}

.control-panel {
    background: var(--modern-surface);
    border: 1px solid var(--modern-border);
    border-radius: 16px;
    box-shadow: var(--modern-shadow);
    padding: 12px;
}

.compact-tree-controls {
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        #eef9fd 0%,
        #ffffff 100%
    );
    border: 1px solid #d4eaf2;
    box-shadow: 0 7px 20px rgba(11, 143, 189, 0.08);
}

.tab-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
}

.tab-btn {
    min-height: 44px;
    border: 1px solid var(--modern-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #3f535c !important;
    font-weight: 700;
}

.tab-btn.active {
    background: linear-gradient(
        135deg,
        var(--modern-accent),
        var(--modern-accent-dark)
    ) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 7px 16px rgba(11,143,189,0.22);
}

.side-accordion {
    margin: 8px 0;
    overflow: hidden;
    border: 1px solid var(--modern-border);
    border-radius: 12px;
    background: var(--modern-surface);
    box-shadow: 0 4px 14px rgba(32,48,56,0.045);
}

.side-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 0;
    background: #fff;
    color: var(--modern-text);
    text-align: right;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.side-accordion-header:hover {
    background: #f1f7f9;
}

.side-accordion-header[aria-expanded="true"] {
    background: linear-gradient(
        135deg,
        #e8f6fb,
        #f7fcfe
    );
    color: var(--modern-accent-dark);
    border-bottom: 1px solid #d6eaf2;
}

.side-accordion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #edf3f5;
    color: var(--modern-accent-dark);
    font-size: 18px;
    line-height: 1;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.side-accordion-header[aria-expanded="true"]
.side-accordion-icon {
    transform: rotate(45deg);
    background: #d9eff7;
}

.side-accordion-body {
    padding: 15px;
    background: var(--modern-soft);
}

.side-accordion-body[hidden] {
    display: none !important;
}

input,
select,
textarea {
    border-radius: 9px !important;
    border: 1px solid #cbd9df !important;
    background: #fff !important;
    min-height: 39px;
    padding: 8px 10px !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--modern-accent) !important;
    box-shadow: 0 0 0 3px rgba(11,143,189,0.12);
}

.primary-btn,
.mini-btn,
.compact-tool-btn,
.tree-action-btn {
    border-radius: 9px !important;
    font-weight: 700;
}

.primary-btn {
    background: linear-gradient(
        135deg,
        var(--modern-accent),
        var(--modern-accent-dark)
    ) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 7px 17px rgba(11,143,189,0.22);
}

.status-box {
    border-radius: 10px !important;
    background: #f7fafb !important;
    border: 1px solid var(--modern-border) !important;
}

.display-panel {
    background: #fff;
    border: 1px solid var(--modern-border);
    border-radius: 16px;
    box-shadow: var(--modern-shadow);
    overflow: hidden;
}


/* 5.0.4 – ensure the parents wizard always receives input */
#parentsWizardBackdrop.active-parent-wizard {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 5000 !important;
    pointer-events: auto !important;
}

#parentsWizardBackdrop .parents-wizard-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
    z-index: 5001 !important;
    pointer-events: auto !important;
}

#parentsWizardBackdrop input,
#parentsWizardBackdrop select,
#parentsWizardBackdrop textarea,
#parentsWizardBackdrop button,
#parentsWizardBackdrop label {
    pointer-events: auto !important;
}

#parentsWizardBackdrop input:not([type="hidden"]),
#parentsWizardBackdrop select {
    opacity: 1 !important;
    user-select: text !important;
    cursor: text;
}

#parentsWizardBackdrop select {
    cursor: pointer;
}


.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin: 8px 0 16px;
    direction: rtl;
}

.brand-header h1 {
    margin: 0;
    color: #1f4f3a;
    font-size: 34px;
    font-weight: 850;
    letter-spacing: -0.7px;
}

.brand-header p {
    margin: 2px 0 0;
    color: #60766c;
    font-size: 14px;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(
        145deg,
        #e7f5e9,
        #d6eef4
    );
    box-shadow: 0 8px 20px rgba(46, 125, 80, 0.14);
    font-size: 31px;
}

.version-badge {
    color: #60766c;
    font-weight: 600;
}


/* Shorashim 5.1.1 – reliable text entry */
.side-accordion-body input,
.side-accordion-body select,
.side-accordion-body textarea,
#spouseWizardBackdrop input,
#spouseWizardBackdrop select,
#spouseWizardBackdrop textarea {
    pointer-events: auto !important;
    opacity: 1 !important;
}

#manageRelationsSearch,
#focusPersonSearch,
#spouseWizardName {
    user-select: text !important;
    cursor: text !important;
    position: relative;
    z-index: 2;
}

#spouseWizardBackdrop.active-spouse-wizard {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 5000 !important;
    pointer-events: auto !important;
}

#spouseWizardBackdrop .spouse-wizard-modal {
    position: relative !important;
    z-index: 5001 !important;
    pointer-events: auto !important;
}

.focus-search-stack {
    display: grid;
    gap: 5px;
    min-width: 0;
}

#focusPersonSearch {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 5px 8px !important;
    font-size: 12px;
}


/* Shorashim 6.0.0 Beta - release feedback tools */
.version-tools {
    position: fixed;
    left: 12px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    z-index: 50;
    direction: ltr;
}
.version-tools .version-badge {
    position: static;
    left: auto;
    bottom: auto;
}
#reportBugBtn {
    border: 1px solid #a9b9b0;
    border-radius: 6px;
    background: rgba(255,255,255,0.94);
    color: #365c49;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
#reportBugBtn:hover { background: #edf6f0; }


/* Shorashim 5.2 RC1 - release information in the header */
.brand-copy {
    display: grid;
    justify-items: center;
}
.header-release-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    direction: rtl;
}
.header-release-tools .version-badge {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    padding: 2px 7px;
    border: 0;
    background: transparent;
    color: #6b7f75;
    font-size: 11px;
    font-weight: 600;
    z-index: auto;
}
.header-release-tools #reportBugBtn {
    border: 0;
    background: transparent;
    color: #47705d;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.header-release-tools #reportBugBtn:hover {
    color: #1f6f4b;
    background: transparent;
}
.version-tools { display: none !important; }


/* Shorashim 6.0 evaluation usability update */
.system-actions-box,
.direct-file-panel {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #d9e1e7;
    border-radius: 8px;
    background: #fff;
}
.system-actions-title {
    margin-bottom: 10px;
    font-weight: 700;
}
.system-actions-note {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}
.system-actions-box .danger-btn,
.direct-file-panel button {
    width: 100%;
}
.file-secondary-action {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}


/* Shorashim 6.0 evaluation update 2: release tools moved to the side panel */
.brand-header {
    padding-top: 8px;
    padding-bottom: 8px;
}
.brand-copy p {
    margin-bottom: 0;
}
.sidebar-release-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e1e6e9;
    direction: rtl;
}
.sidebar-release-tools .version-badge {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    z-index: auto;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #6b7f75;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.sidebar-release-tools #reportBugBtn {
    width: auto;
    border: 0;
    background: transparent;
    color: #47705d;
    padding: 2px 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.sidebar-release-tools #reportBugBtn:hover {
    color: #1f6f4b;
    background: transparent;
}
.header-release-tools { display: none !important; }

/* Version 6.1 - tree-first interface */
.legacy-workflow { display: none !important; }
.tree-action-guide {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef7ee;
    border: 1px solid #cfe3cf;
    display: grid;
    gap: 4px;
    font-size: 13px;
    line-height: 1.45;
}
.tree-action-guide span { color: #455a45; }
.duplicate-warning {
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    background: #fff3cd;
    border: 1px solid #ffe08a;
    color: #6b5200;
    line-height: 1.45;
}
#treeContextMenu, #relationshipContextMenu { min-width: 190px; }

/* 6.2: three sidebar subjects are always visible; no tab hierarchy. */
.sidebar-fixed-title {
    margin: 14px 0 7px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #eef8fb;
    border: 1px solid #d4eaf2;
    color: #214c5a;
    font-weight: 800;
    font-size: 0.96rem;
}

.fixed-sidebar-section {
    display: block !important;
}

#tab-files,
#tab-system,
#tab-gedcom {
    margin-bottom: 8px;
}

.gedcom-always-open .side-accordion-body {
    display: block !important;
    padding-top: 12px;
}

.gedcom-section-label {
    margin-bottom: 9px;
    font-weight: 700;
    color: #425b65;
}


/* 6.3: fixed export section and single system heading. */
.compact-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.export-actions-box {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #d9e1e7;
    border-radius: 8px;
    background: #fff;
}
.export-action-btn {
    width: 100%;
    min-height: 35px;
    padding: 7px 9px;
    border: 1px solid #b7c7ce;
    border-radius: 6px;
    background: #fff;
    color: #29434e;
    font-size: 13px;
    cursor: pointer;
}
.export-action-btn:hover {
    background: #eaf6fa;
    border-color: #008cba;
}
#tab-export { margin-bottom: 8px; }


/* 6.4: unified sidebar language and visual hierarchy. */
.sidebar-fixed-title {
    margin: 14px 0 7px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #eef8fb;
    border: 1px solid #d4eaf2;
    color: #214c5a;
    font-weight: 800;
    font-size: 0.96rem;
}
.direct-file-panel,
.export-actions-box,
.system-actions-box,
.gedcom-always-open {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #d9e1e7;
    border-radius: 8px;
    background: #fff;
}
.direct-file-panel .info-box {
    margin-bottom: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #52656d;
    font-size: 12px;
    line-height: 1.45;
}
.sidebar-action-btn {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #9fb8c2;
    border-radius: 6px;
    background: #f7fbfc;
    color: #214c5a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.sidebar-action-btn:hover,
.sidebar-action-btn:focus {
    background: #e7f4f8;
    border-color: #4f91a6;
}
.sidebar-danger-btn {
    color: #8b2f2f;
    border-color: #d6aaaa;
    background: #fff8f8;
}
.sidebar-danger-btn:hover,
.sidebar-danger-btn:focus {
    background: #fdeaea;
    border-color: #bf6c6c;
}
.export-actions-box { display: grid; gap: 7px; }
#tab-gedcom .side-accordion-body { padding: 0 !important; }
#tab-gedcom textarea { margin-top: 2px; }


/* 6.5: compact, uniform sidebar spacing. */
.sidebar-fixed-title {
    margin: 6px 0 4px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}
.fixed-sidebar-section,
#tab-files, #tab-export, #tab-system, #tab-gedcom {
    margin: 0 0 5px !important;
}
.direct-file-panel,
.export-actions-box,
.system-actions-box,
.gedcom-always-open {
    margin: 0 !important;
    padding: 7px !important;
    border-radius: 6px;
}
.direct-file-panel .info-box {
    margin-bottom: 5px;
    line-height: 1.3;
}
.direct-file-panel .form-group { margin-bottom: 4px; }
.direct-file-panel .form-group:last-child { margin-bottom: 0; }
.export-actions-box { gap: 4px; }
.system-actions-note { margin-top: 4px; }
.sidebar-action-btn {
    min-height: 32px;
    padding: 6px 8px;
}
.gedcom-section-label { margin-bottom: 5px; }
#tab-gedcom textarea { margin-top: 0; }
#tab-gedcom #importGedcomBtn { margin-top: 5px !important; }
.tree-action-guide { margin-bottom: 6px; padding: 7px; }
.compact-tree-controls { margin-bottom: 6px; }
#fileStatusBox[hidden] { display: none !important; }


/* 6.6: one spacing rhythm throughout the permanent sidebar. */
.control-panel {
    --sidebar-gap: 5px;
}
.compact-tree-controls,
.tree-action-guide,
.sidebar-fixed-title,
.fixed-sidebar-section,
#tab-files,
#tab-export,
#tab-system,
#tab-gedcom {
    margin-top: 0 !important;
    margin-bottom: var(--sidebar-gap) !important;
}
.sidebar-fixed-title {
    padding: 6px 8px !important;
}
.direct-file-panel,
.export-actions-box,
.system-actions-box,
.gedcom-always-open {
    padding: 6px !important;
}
.direct-file-panel .form-group,
.export-actions-box,
.system-actions-box,
#tab-gedcom .side-accordion-body {
    gap: var(--sidebar-gap) !important;
}
.direct-file-panel .form-group {
    margin: 0 0 var(--sidebar-gap) !important;
}
.direct-file-panel .form-group:last-child {
    margin-bottom: 0 !important;
}
.sidebar-action-btn,
#tab-gedcom #importGedcomBtn {
    margin: 0 !important;
}
.direct-file-panel .info-box,
.gedcom-section-label,
.system-actions-note {
    margin: 0 0 var(--sidebar-gap) !important;
}
.system-actions-note {
    margin-top: var(--sidebar-gap) !important;
    margin-bottom: 0 !important;
}


.working-directory-dialog { text-align: right; direction: rtl; }
.working-directory-dialog h3 { margin: 0 0 10px; }
.working-directory-dialog p { margin: 0 0 8px; line-height: 1.45; }
.working-directory-note { font-size: 13px; color: #555; }
.working-directory-actions { display: flex; gap: 8px; margin-top: 14px; }
.working-directory-actions button { flex: 1; margin: 0; }


/* Version 7.1 - tree guidance and view controls in the header */
.brand-header {
    position: relative;
    min-height: 64px;
}
.header-tree-guide {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    gap: 2px;
    text-align: right;
    color: #455a45;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}
.header-tree-guide span:first-child {
    font-weight: 700;
}
.header-pan-guide {
    color: #60766c;
}
.svg-tree-toolbar {
    position: fixed !important;
    top: 13px !important;
    right: 18px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 200 !important;
    transform: translateY(0);
}
.header-tree-guide {
    right: 205px;
}
.svg-fallback-notice {
    display: none !important;
}
@media (max-width: 1050px) {
    .brand-header {
        justify-content: flex-start;
        padding-right: 14px;
    }
    .header-tree-guide {
        position: static;
        transform: none;
        margin-right: auto;
        white-space: normal;
    }
    .svg-tree-toolbar {
        top: 76px !important;
        right: auto !important;
        left: 12px !important;
    }
}

.person-edit-modal{width:min(680px,calc(100vw - 32px));max-height:88vh;overflow-y:auto;}
.person-edit-modal .form-row{gap:10px;}


/* Version 7.8: draggable editing windows */
.draggable-modal-handle {
    cursor: move;
    user-select: none;
    touch-action: none;
}
.draggable-modal-handle:active, .draggable-modal-handle.dragging { cursor: grabbing; }


/* Version 7.11: compact, consistent editing dialogs */
.edit-dialog-modal,
.person-edit-modal,
.parents-wizard-modal,
.child-wizard-modal,
.spouse-wizard-modal {
    width: min(500px, calc(100vw - 32px)) !important;
    max-width: 500px;
    padding: 20px !important;
    border-radius: 10px;
    box-sizing: border-box;
}
.person-edit-modal {
    max-height: 88vh;
    overflow-y: auto;
}
.edit-dialog-modal h3,
.person-edit-modal h3,
.parents-wizard-modal h3,
.child-wizard-modal h3,
.spouse-wizard-modal h3 {
    margin-top: 0;
    margin-bottom: 12px !important;
}
.edit-dialog-modal .form-group,
.person-edit-modal .form-group,
.parents-wizard-modal .form-group,
.child-wizard-modal .form-group,
.spouse-wizard-modal .form-group {
    margin-bottom: 10px;
}
.person-info-card .person-info-actions { display: none !important; }

/* Version 7.13: stable modal pointer dragging */
body.modal-is-dragging, body.modal-is-dragging * { user-select: none !important; }
.draggable-modal-handle { touch-action: none; }


/* Version 7.14: consistent modal dimensions, headers and actions */
.modal-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin: -4px 0 12px;
    cursor: move;
    user-select: none;
}
.modal-dialog-header h2, .modal-dialog-header h3 { margin: 0 !important; }
.spouse-wizard-modal,
.media-manager-modal {
    width: min(500px, calc(100vw - 32px)) !important;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px !important;
    border-radius: 10px;
    box-sizing: border-box;
}
.modal-dialog-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.modal-dialog-actions > button { width: 100%; }
#cancelMediaManagerBtn { padding: 8px; }


/* Version 7.16: spouse and parents use the same positioning rules as all dialogs */
#spouseWizardBackdrop .spouse-wizard-modal,
#parentsWizardBackdrop .parents-wizard-modal {
    position: fixed !important;
    top: 50%;
    left: 50%;
    right: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
}
#spouseWizardBackdrop .spouse-wizard-modal.modal-dragged,
#parentsWizardBackdrop .parents-wizard-modal.modal-dragged {
    transform: none;
}


/* Version 7.17: parents dialog uses a dedicated fixed drag surface */
#parentsWizardBackdrop.active-parent-wizard .parents-wizard-modal {
    position: fixed !important;
    top: 50%;
    left: 50%;
    right: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
}
#parentsWizardBackdrop.active-parent-wizard .parents-wizard-modal.modal-dragged {
    transform: none !important;
}
#parentsWizardDragHandle {
    cursor: move !important;
    touch-action: none;
}

.birthdays-report-modal{width:min(620px,calc(100vw - 32px));max-height:85vh;overflow:auto}.birthdays-range-row{align-items:end}.birthdays-range-row .primary-btn{margin-bottom:0}.birthdays-table-wrap{max-height:46vh;overflow:auto;margin:10px 0}.birthdays-table{width:100%;border-collapse:collapse}.birthdays-table th,.birthdays-table td{border:1px solid #d7dde3;padding:7px;text-align:right}.birthdays-table th{position:sticky;top:0;background:#f3f6f8}.birthdays-report-actions{display:flex;gap:8px}.birthdays-report-actions .mini-btn{flex:1}

#birthdaysDaysInput{width:110px;min-width:110px;direction:ltr;text-align:center;font-variant-numeric:tabular-nums}
.birthdays-range-row .form-group{flex:0 0 auto}


/* Birthday report printing */
#birthdaysPrintArea{display:none;direction:rtl}
@media print{
  body.printing-birthdays-report > *{display:none !important}
  body.printing-birthdays-report #birthdaysPrintArea{display:block !important;position:static!important;width:auto!important;height:auto!important;margin:0!important;padding:0!important;font-family:Arial,sans-serif;color:#111;background:#fff}
  body.printing-birthdays-report #birthdaysPrintArea h1{font-size:22px;margin:0 0 8px}
  body.printing-birthdays-report #birthdaysPrintArea p{margin:0 0 14px}
  body.printing-birthdays-report #birthdaysPrintArea table{border-collapse:collapse;width:100%}
  body.printing-birthdays-report #birthdaysPrintArea th,
  body.printing-birthdays-report #birthdaysPrintArea td{border:1px solid #777;padding:7px;text-align:right}
  body.printing-birthdays-report #birthdaysPrintArea th{background:#eee!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}


.focus-select-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    align-items: center;
}

.focus-apply-btn {
    min-height: 30px;
    padding-inline: 10px;
    white-space: nowrap;
}

.media-image-drop-zone {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 18px 12px;
    border: 2px dashed #90a4ae;
    border-radius: 9px;
    background: #f8fbfc;
    color: #455a64;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease,
                background 0.15s ease,
                transform 0.15s ease;
}

.media-image-drop-zone:hover,
.media-image-drop-zone:focus-visible {
    border-color: #0288d1;
    background: #eef8fc;
    outline: none;
}

.media-image-drop-zone.drag-over {
    border-color: #0288d1;
    background: #e1f5fe;
    transform: scale(1.01);
}

.media-image-drop-zone span {
    font-size: 12px;
    color: #607d8b;
}

.media-drop-icon {
    font-size: 28px;
    line-height: 1;
}

.media-image-drop-zone #mediaImageFile {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* 7.46.7 - internal confirmation dialog; avoids blocking native browser confirm. */
.app-confirm-modal { width:min(460px, calc(100vw - 32px)); text-align:right; }
.app-confirm-message { white-space:pre-line; line-height:1.6; margin:12px 0 20px; }
.app-confirm-modal .modal-dialog-actions { display:flex; gap:10px; }
.app-confirm-modal .modal-dialog-actions button { flex:1; }


/* 7.47.3 – permanent linked-file and last-save display */
#fileStatusBox { display: block; font-weight: normal !important; line-height: 1.45; overflow-wrap: anywhere; }
#fileStatusBox .file-status-title { font-weight: 700; }
#fileStatusBox .file-status-path { display: inline-block; margin-top: 4px; direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: 11px; font-weight: 400; }
#fileStatusBox .file-status-time { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 400; }
#fileStatusBox.status-saving { background: #fff8df !important; border-color: #e2b93b !important; }

.wizard-selected-person {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #f7f9fa;
    min-height: 20px;
}
.wizard-selected-person strong {
    font-weight: 700;
}


/* 7.47.14: tree title, relationship legend, parent picker and file status placement */
.tree-title-row { display:flex; align-items:center; gap:8px; }
.tree-title-edit-btn { border:0; background:rgba(255,255,255,.18); color:inherit; width:28px; height:28px; border-radius:6px; cursor:pointer; font-size:16px; }
.tree-title-edit-btn:hover { background:rgba(255,255,255,.3); }
.header-relationship-guide { display:flex; align-items:center; gap:5px; flex-wrap:wrap; font-size:12px; }
.legend-line { display:inline-block; width:28px; height:0; border-top:3px solid; vertical-align:middle; }
.legend-line.married { border-color:#ff4081; }
.legend-line.partnered { border-color:#fb8c00; border-top-style:dashed; }
.legend-line.divorced { border-color:#78909c; border-top-style:dashed; }
.sidebar-file-status { margin-top:auto; margin-bottom:8px; max-height:120px; overflow:auto; }
.parent-change-selection-btn { display:none; width:auto !important; margin-inline-start:8px; padding:3px 8px !important; font-size:11px; }
.tree-title-dialog { width:min(420px, calc(100vw - 32px)); }

/* 7.47.16: title on the right; zoom controls and guidance on the left */
.brand-header {
    justify-content: flex-start;
    padding-right: 18px;
    padding-left: 18px;
}
.header-tree-guide {
    right: auto;
    left: 205px;
    text-align: right;
}
.svg-tree-toolbar {
    right: auto !important;
    left: 18px !important;
}
@media (max-width: 1050px) {
    .brand-header {
        justify-content: flex-start;
        padding-right: 14px;
        padding-left: 14px;
    }
    .header-tree-guide {
        position: static;
        transform: none;
        margin-right: auto;
        margin-left: 80px;
        white-space: normal;
    }
    .svg-tree-toolbar {
        top: 76px !important;
        right: auto !important;
        left: 12px !important;
    }
}
/* 7.47.18 */
.svg-person-detail { font-size: 13px !important; font-weight: 600; }
.extended-person-fields textarea { min-height: 62px; }
.parents-wizard-modal,.child-wizard-modal,.spouse-wizard-modal{width:min(760px,calc(100vw - 32px));max-height:90vh;overflow:auto}
.media-open-btn{margin-top:8px;width:max-content;font-size:15px;font-weight:700}.media-file-missing{margin-top:7px;font-size:13px;color:#8a5a00;background:#fff4d6;padding:6px 8px;border-radius:6px;width:max-content}

#appConfirmBackdrop{z-index:20000!important;align-items:center;justify-content:center}#appConfirmBackdrop .modal-content{z-index:20001!important}


/* 7.47.25: keep the working-folder action visible as the first file action. */
.directory-select-btn {
    min-height: 42px !important;
    background: #e7f4f8 !important;
    border: 2px solid #4f91a6 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}
.directory-select-btn:hover,
.directory-select-btn:focus {
    background: #d7edf4 !important;
}
