:root {
    --nri-blue: #004182;
    --nri-green: #27ae60;
    --nri-red: #e74c3c;
    --nri-bg: #f4f7f9;
}

body { background: var(--nri-bg); font-family: 'Outfit', sans-serif; margin: 0; }

#exportArea {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    max-width: 1200px; width: 95%;
    margin: 0 auto;
}

/* Branded Ad Header */
.branded-ad-header {
    background: linear-gradient(135deg, #f8faff, #ffffff);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.ad-logo-section { display: flex; align-items: center; gap: 20px; }
.ad-logo-section img { height: 50px; }
.ad-logo-section h2 { margin: 0; color: var(--nri-blue); font-size: 1.4rem; font-weight: 800; }
.ad-logo-section p { margin: 5px 0 0 0; color: #666; font-size: 0.95rem; font-weight: 600; }

.ad-services { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.service-item { 
    font-size: 0.85rem; font-weight: 700; color: var(--nri-blue); 
    display: flex; align-items: center; gap: 10px;
    background: #ffffff; padding: 10px 15px; border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Legal Notice Box */
.legal-notice-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 20px;
    border-radius: 10px;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 40px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.legal-notice-box i { font-size: 1.5rem; }

/* Visual Tree Re-fix for consistency */
.visual-tree { position: relative; padding-bottom: 120px; display: flex; justify-content: center; }
.node-stack { display: flex; flex-direction: column; align-items: center; }
.tree-node {
    width: 210px; background: white; border: 2px solid #e0e6ed; border-radius: 18px;
    padding: 18px; text-align: center; position: relative; z-index: 10;
    box-shadow: 0 8px 15px rgba(0,0,0,0.04); margin: 0 30px;
}
.tree-node.student-root { border-color: var(--nri-blue); border-width: 4px; }
.tree-node.node-eligible { border-color: var(--nri-green); background: #f0fff4; }
.tree-node.node-ineligible { border-color: var(--nri-red); background: #fff5f5; }

.n-title { font-size: 0.7rem; font-weight: 800; color: var(--nri-blue); margin-bottom: 8px; }
.n-input { 
    width: 90%; border: 1px solid #eee; border-radius: 6px;
    text-align: center; font-family: inherit; font-size: 0.9rem; 
    font-weight: 600; padding: 6px; margin-bottom: 8px;
}
.n-badge { padding: 4px 12px; border-radius: 50px; font-size: 0.65rem; font-weight: 900; color: white; display: inline-block; }
.bg-green { background: var(--nri-green); }
.bg-red { background: var(--nri-red); }

/* SVG */
#tree-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* Legal List */
.legal-documentation-list { margin-top: 60px; background: #ffffff; padding: 20px; border-radius: 25px; border: 2px solid #f0f4f8; }
.legal-entry { margin-bottom: 30px; padding: 25px; border-left: 10px solid #ddd; background: #fafbfc; border-radius: 0 15px 15px 0; }
.legal-entry.border-green { border-color: var(--nri-green); background: #f0fff4; }
.legal-entry.border-red { border-color: var(--nri-red); background: #fff5f5; }
.legal-entry h4 { margin: 0 0 12px 0; color: var(--nri-blue); font-size: 1.2rem; font-weight: 800; }
.legal-entry p { margin: 0; font-size: 1rem; line-height: 1.7; color: #333; }

/* Branded Footer */
.branded-footer {
    margin-top: 60px; padding-top: 30px; border-top: 2px solid #f0f4f8;
    text-align: center; font-size: 0.85rem; color: #999; font-weight: 600;
}

/* Controls Fix */
.add-controls { margin-top: 12px; display: flex; justify-content: center; gap: 6px; border-top: 1px solid #f0f4f8; padding-top: 12px; }
.add-btn-mini { width: 32px; height: 26px; background: #f8fbff; border: 2px solid #004182; color: #004182; border-radius: 6px; font-size: 0.7rem; font-weight: 900; cursor: pointer; }
.add-btn-mini:hover { background: #004182; color: white; }
.del-btn { position: absolute; top: -10px; right: -10px; background: #ff4d4d; color: white; width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.node-children { display: flex; justify-content: center; margin-top: 100px; gap: 40px; }

/* Mobile Responsiveness for NRI Tool */
@media (max-width: 768px) {
    #exportArea { padding: 15px; }
    .branded-ad-header { flex-direction: column; text-align: center; gap: 20px; }
    .ad-logo-section { flex-direction: column; gap: 10px; }
    .ad-services { grid-template-columns: 1fr; }
    .tree-node { width: 160px; margin: 0 10px; padding: 12px; }
    .n-title { font-size: 0.6rem; }
    .n-input { font-size: 0.8rem; }
    .node-children { margin-top: 60px; gap: 20px; }
}

/* Enhanced Mobile Responsiveness for NRI Tool Tree Nodes */
@media (max-width: 768px) {
    .tree-node { 
        width: 140px !important; 
        margin: 0 5px !important; 
        padding: 10px !important; 
        border-radius: 12px !important;
    }
    .n-title { font-size: 0.55rem !important; margin-bottom: 4px !important; }
    .n-input { font-size: 0.75rem !important; padding: 4px !important; margin-bottom: 4px !important; }
    .n-badge { font-size: 0.55rem !important; padding: 2px 8px !important; }
    .node-children { gap: 10px !important; margin-top: 40px !important; }
    .branded-ad-header { padding: 15px !important; }
    .ad-logo-section img { height: 40px !important; }
    .ad-logo-section h2 { font-size: 1.1rem !important; }
    .ad-services { display: none !important; } /* Hide services on mobile export for clarity */
}

/* --- NRI Report Export Styling Fixes --- */
.tree-wrapper {
    background: #ffffff;
    padding: 40px;
}

.tree-header {
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 30px;
}

.tree-header img {
    height: 80px; /* Controlled logo size */
    width: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.tree-header h2 {
    color: var(--nri-blue);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 10px 0;
    letter-spacing: 1px;
}

.tree-header p {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.factors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 60px;
}

.factor-card {
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #eee;
}

.f-eligible { background: #f0fff4; border-color: #c6f6d5; }
.f-ineligible { background: #fff5f5; border-color: #fed7d7; }

.factor-card h4 {
    margin-top: 0;
    color: var(--nri-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.factor-card ul {
    margin: 15px 0 0 0;
    padding-left: 20px;
    font-size: 0.9rem;
}

.educational-disclaimer {
    margin-top: 50px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

@media (max-width: 768px) {
    .tree-header h2 { font-size: 1.3rem; }
    .tree-header img { height: 60px; }
    .factors-grid { grid-template-columns: 1fr; }
    .tree-wrapper { padding: 20px; }
}
