* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Amharic (Ethiopic) – Noto Sans Ethiopic loaded via Google Fonts in HTML */
.person-name-amharic,
.person-card.center .person-name-amharic,
.lineage-card-name-amharic,
.lineage-person-card .lineage-card-name-amharic,
#correction-current-amharic,
#correction-suggested-amharic,
#edit-name-amharic,
#add-name-amharic,
#page-title {
    font-family: 'Noto Sans Ethiopic', sans-serif;
}

:root {
    --primary-color: #1a202c;
    --secondary-color: #4a5568;
    --accent-color: #078930; /* Ethiopian Green */
    --accent-color-2: #FCDD09; /* Ethiopian Yellow */
    --accent-color-3: #DA121A; /* Ethiopian Red */
    --background: linear-gradient(135deg, #078930 0%, #FCDD09 50%, #DA121A 100%);
    --background-solid: #f0f8f4;
    --card-background: rgba(13, 184, 72, 0.85);
    --card-background-hover: rgba(13, 184, 72, 0.95);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: rgba(7, 137, 48, 0.4);
    --border-color-hover: rgba(7, 137, 48, 0.7);
    --error-color: #e53e3e;
    --success-color: #38a169;
    --spacing-unit: 1rem;
    --shadow-sm: 0 2px 8px rgba(7, 137, 48, 0.2);
    --shadow-md: 0 4px 16px rgba(7, 137, 48, 0.3);
    --shadow-lg: 0 8px 24px rgba(7, 137, 48, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem;
}

.site-footer {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
}

.site-footer .acknowledgement {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.site-footer .acknowledgement .ack-line {
    display: block;
}

.site-footer .acknowledgement .ack-line-2 {
    margin-top: 0.5rem;
    font-weight: 700;
    line-height: 1.45;
}

.site-footer .acknowledgement .ack-line-3 {
    margin-top: 0.5rem;
}

/* Mobile: stack English, Amharic author line, and acknowledgement on separate lines */
@media (max-width: 640px) {
    /* already stacked */
}

/* Suggest correction modal */
.correction-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.correction-modal.hidden {
    display: none;
}

.correction-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.correction-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.correction-modal-dialog h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.correction-modal-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tree-request-billing-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tree-request-billing-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.tree-request-plan-option {
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

.tree-request-billing-note {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.correction-field {
    margin-bottom: 0.75rem;
}

.correction-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.correction-field .required {
    color: var(--error-color);
}

.correction-readonly {
    font-size: 0.9rem;
    padding: 0.35rem 0;
    color: var(--text-secondary);
}

.correction-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.25rem;
    font-size: 1rem;
}

.correction-message {
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.correction-message.success {
    color: var(--success-color);
}

.correction-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.correction-actions .btn-primary,
.correction-actions .btn-secondary {
    padding: 0.5rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 1.75rem;
    color: #FF6600;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

#page-title .title-english-name {
    font-size: 1.5rem;
    color: #000;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-btn {
    padding: 0.75rem 2rem;
    background: var(--accent-color-2);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background: #FEE500;
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn.active {
    background: var(--accent-color-2);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fed7d7;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Tree Container */
.tree-container {
    position: relative;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    border-radius: 1rem;
    min-height: 400px;
    padding: 0.5rem 0.5rem 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.tree-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* Behind everything */
}

.section {
    position: relative;
    z-index: 2;
    margin: 0.5rem 0;
}

.parent-section {
    display: flex;
    justify-content: center;
    min-height: 0;
}

.center-section {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.children-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 columns */
    gap: 0.75rem;
    min-height: 200px;
    width: 100%; /* Full width for mobile */
    margin: 0 auto;
    justify-items: center;
    padding: 0.5rem;
}

/* Safety fallback: if exactly one child card is rendered, keep it centered */
.children-section > .person-card.child:only-child {
    justify-self: center;
    grid-column: 1 / -1;
}

/* Mobile: Center single child */
.children-section.children-1 {
    grid-template-columns: 200px !important; /* 1 column for 1 card */
    width: 200px !important; /* Fit single card */
    max-width: 200px !important;
}

/* Person Cards - Uniform sizing for all card types */
.person-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    width: 100%;
    max-width: 200px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
    justify-self: center; /* Center within grid cell */
    position: relative;
    z-index: 10; /* Ensure cards are well above tree lines (z-index: 0) */
    isolation: isolate; /* Create new stacking context */
}

.person-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color-hover);
    background: var(--card-background-hover);
}

.person-card.parent,
.person-card.child {
    cursor: pointer;
}

.person-card.center {
    cursor: pointer;
    border-color: transparent;
    border-width: 2px;
    font-weight: 600;
    background: linear-gradient(135deg, #DA121A 0%, #c81018 100%);
    color: white;
    box-shadow: var(--shadow-md);
    transform: none; /* Remove scale for uniform sizing */
    max-width: 200px; /* Same as other cards */
}

/* Previous center person - lighter green */
.person-card.previous-center {
    background: rgba(13, 184, 72, 0.3) !important; /* Lighter green for previous center */
}

.person-card.previous-center:hover {
    background: rgba(13, 184, 72, 0.4) !important; /* Slightly darker on hover */
}

.person-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.person-name-english {
    font-size: 0.9rem;
    font-weight: 400;
    color: #000;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-style: italic;
}

.person-name-amharic {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-color-2);
    margin-bottom: 0.25rem;
    direction: ltr; /* Amharic (Ge'ez script) is LTR, same as English */
    text-align: center; /* Center align for better appearance */
}

.person-card.center .person-name-english {
    color: #000;
    font-size: 0.9rem;
    font-weight: 400;
    font-style: italic;
}

.person-card.center .person-name-amharic {
    color: var(--accent-color-2);
    font-size: 1.2rem;
    font-weight: 800; /* Bold for emphasis */
}

.person-card.center .correction-hint {
    font-size: 0.75rem;
    color: #fff;
    text-decoration: underline;
    margin-top: 0.25rem;
    font-weight: 400;
}

.person-card.center .full-tree-link {
    display: inline-block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
    color: #fff;
    text-decoration: underline;
}

.person-card.center .full-tree-link:hover {
    opacity: 0.9;
}

.person-card.center .full-tree-cta {
    margin-top: 0.25rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #000;
    background: var(--accent-color-2);
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    cursor: pointer;
}

.person-card.center .full-tree-cta:hover {
    background: #FEE500;
}

.parent-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.empty-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-message.leaf-indicator {
    background: #e6fffa;
    border: 2px dashed var(--accent-color);
    border-radius: 0.5rem;
    color: var(--accent-color);
    font-weight: 500;
}

/* Responsive Grid for Children - Max 4 per row, always centered */
@media (min-width: 480px) {
    .children-section {
        grid-template-columns: repeat(2, 1fr); /* Still 2 columns on small tablets */
        gap: 1rem;
    }
    
    /* Small tablets: Center single child */
    .children-section.children-1 {
        grid-template-columns: 200px !important;
        width: 200px !important;
        max-width: 200px !important;
    }
}

@media (min-width: 768px) {
    .children-section {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablets */
        gap: 1rem;
        width: 100%; /* Full width for tablets */
        margin: 0 auto;
        justify-items: center;
    }
    
    /* Override width and grid columns for specific child counts on tablets too */
    .children-section.children-1 {
        grid-template-columns: 200px !important;
        width: 200px !important;
    }
    
    .children-section.children-2 {
        grid-template-columns: repeat(2, 200px) !important;
        width: calc(2 * 200px + 1 * 1rem) !important;
    }
}

@media (min-width: 1024px) {
    .section.children-section,
    .children-section {
        display: grid !important;
        grid-template-columns: repeat(4, 200px) !important; /* 4 columns, fixed 200px width */
        gap: 1rem !important;
        width: calc(4 * 200px + 3 * 1rem) !important; /* Default width: 4 cards + 3 gaps = 863px */
        max-width: calc(4 * 200px + 3 * 1rem) !important; /* Max width: 4 cards + 3 gaps = 863px */
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
        justify-items: center !important;
        justify-content: center !important; /* Center grid tracks when fewer than 4 children */
        padding: 0.5rem !important;
        box-sizing: border-box !important;
    }
    
    /* Dynamic width AND grid columns based on number of children - must be more specific */
    .section.children-section.children-1,
    .children-section.children-1 {
        grid-template-columns: 200px !important; /* 1 column for 1 card */
        width: 200px !important; /* 1 card */
    }
    
    .section.children-section.children-2,
    .children-section.children-2 {
        grid-template-columns: repeat(2, 200px) !important; /* 2 columns for 2 cards */
        width: calc(2 * 200px + 1 * 1rem) !important; /* 2 cards + 1 gap = 431px */
    }
    
    .section.children-section.children-3,
    .children-section.children-3 {
        grid-template-columns: repeat(3, 200px) !important; /* 3 columns for 3 cards */
        width: calc(3 * 200px + 2 * 1rem) !important; /* 3 cards + 2 gaps = 632px */
    }
    
    .section.children-section.children-4,
    .section.children-section.children-many,
    .children-section.children-4,
    .children-section.children-many {
        grid-template-columns: repeat(4, 200px) !important; /* 4 columns for 4+ cards */
        width: calc(4 * 200px + 3 * 1rem) !important; /* 4 cards + 3 gaps = 863px */
    }
}

/* Relationship View */
.relationship-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.relationship-container h2 {
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

.relationship-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.selector-group {
    display: flex;
    flex-direction: column;
}

.selector-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.autocomplete-wrap {
    position: relative;
    width: 100%;
}

.person-input,
.person-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.person-input {
    cursor: text;
}

.person-input:focus,
.person-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-list .item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.autocomplete-list .item:last-child {
    border-bottom: none;
}

.autocomplete-list .item:hover,
.autocomplete-list .item.active {
    background: rgba(7, 137, 48, 0.12);
}

.person-select option {
    padding: 0.5rem;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #2c5aa0;
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* Relationship Visualization */
.relationship-visualization {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.relationship-graph {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 2rem;
    min-height: 300px;
    position: relative;
}

/* Connection bridge between the two lineages */
.connection-bridge {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    padding: 0 1rem;
    min-width: 80px;
}

.connection-bridge:not(:empty) {
    display: flex;
}

.bridge-line {
    width: 4px;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(to bottom, 
        var(--accent-color-2) 0%, 
        var(--accent-color) 50%, 
        var(--accent-color-2) 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(252, 221, 9, 0.5);
    position: relative;
}

.bridge-meeting-point {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-25px);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.meeting-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FCDD09 0%, #FEE500 100%);
    border: 4px solid var(--accent-color-3);
    box-shadow: 0 4px 12px rgba(218, 18, 26, 0.3), 
                0 0 20px rgba(252, 221, 9, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(218, 18, 26, 0.3), 
                    0 0 20px rgba(252, 221, 9, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(218, 18, 26, 0.4), 
                    0 0 30px rgba(252, 221, 9, 0.7);
    }
}

.relationship-person-card {
    display: flex;
    justify-content: center;
    position: relative;
}

.lineage-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}


.lineage-person-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    width: 100%;
    max-width: 280px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
    position: relative;
    transition: all 0.3s ease;
}

.lineage-person-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.lineage-person-card.selected-person-card {
    background: linear-gradient(135deg, #DA121A 0%, #c81018 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.lineage-person-card.common-ancestor-card {
    background: linear-gradient(135deg, #FCDD09 0%, #FEE500 100%);
    color: var(--text-primary);
    border-color: var(--accent-color-3);
    border-width: 3px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    transform: scale(1.08);
    position: relative;
    z-index: 10;
}

.lineage-person-card.sibling-card {
    background: linear-gradient(135deg, #0db848 0%, #078930 100%);
    color: white;
    border-color: var(--accent-color-2);
    border-width: 3px;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    position: relative;
}

.lineage-person-card.cousin-card {
    background: linear-gradient(135deg, #0db848 0%, #078930 100%);
    color: white;
    border-color: var(--accent-color-2);
    border-width: 3px;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    position: relative;
}

.sibling-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: linear-gradient(135deg, #FCDD09 0%, #FEE500 100%);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--accent-color-3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.relationship-label-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: linear-gradient(135deg, #FCDD09 0%, #FEE500 100%);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--accent-color-3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
    white-space: nowrap;
}

.lineage-person-card.sibling-card .lineage-card-name-amharic,
.lineage-person-card.cousin-card .lineage-card-name-amharic {
    color: var(--accent-color-2);
    font-weight: 800;
}

.lineage-person-card.sibling-card .lineage-card-name,
.lineage-person-card.cousin-card .lineage-card-name {
    color: #000;
}

.lineage-card-name-amharic {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--accent-color-2);
}

.lineage-person-card.selected-person-card .lineage-card-name-amharic {
    color: var(--accent-color-2);
    font-weight: 800;
}

.lineage-person-card.selected-person-card .lineage-card-name {
    color: #000;
}

.lineage-person-card.common-ancestor-card .lineage-card-name-amharic {
    color: var(--accent-color-2);
    font-weight: 800;
}

.lineage-card-name {
    font-size: 0.95rem;
    font-weight: 400;
    font-style: italic;
    color: #000;
}

.lineage-person-card.selected-person-card .lineage-card-name {
    color: #000;
}

.lineage-connector {
    width: 2px;
    height: 40px;
    background: var(--border-color);
    margin: 0 auto;
    position: relative;
}

.lineage-connector::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--border-color);
}

.relationship-path-container {
    display: none; /* Not used in new design */
}

.no-relationship,
.same-person {
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.75rem;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    grid-column: 1 / -1;
}

.relationship-info {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.common-ancestor-info {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.common-ancestor-info strong {
    color: var(--accent-color);
    font-weight: 600;
}

.relationship-type {
    color: var(--text-primary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.relationship-type strong {
    color: var(--accent-color-3);
    font-weight: 600;
}

.siblings-info,
.cousins-info {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: rgba(13, 184, 72, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid var(--accent-color);
}

.siblings-info strong,
.cousins-info strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* Mobile responsive for relationship view */
@media (max-width: 768px) {
    .relationship-selectors {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .relationship-graph {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .lineage-column {
        width: 100%;
    }
    
    .lineage-person-card {
        max-width: 100%;
    }
}

/* Additional mobile adjustments (base is already mobile-first) */
@media (min-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .person-card {
        padding: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
}

@media (min-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .tree-container {
        padding: 0.75rem 1rem 1.5rem;
        min-height: 600px;
    }
    
    .section {
        margin: 0.75rem 0;
    }
    
    .center-section {
        margin: 0.75rem 0;
    }
    
    .relationship-container {
        padding: 2rem;
    }
}

