/* Impresión compartida: independiente del tema y de imprimir fondos. */
@media print {
    :root,html[data-theme="dark"],html[data-theme="light"] {
        color-scheme:light !important;
        --canvas:#fff; --surface:#fff; --surface-2:#f4f4f4; --surface-3:#e6e6e6;
        --text:#111; --muted:#444; --muted-2:#555;
        --line:#ccc; --line-strong:#888;
        --data-accent:#333; --data-accent-line:#333;
        --sticky-surface:#fff; --sticky-surface-solid:#fff;
    }
    html,body,.app-shell,.workspace { min-width:0 !important; background:#fff !important; }
    .workspace,.main-content { width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; }
    main *,footer * { color:#111 !important; text-shadow:none !important; box-shadow:none !important; }
    main svg text:not(.history-axis-label) { fill:#111 !important; }
    .hero-reading,.definition-panel,.period-kpis article,.pos-kpis article,.transversal-kpis article,
    .comparison-pos-kpis article,.period-card,.period-total,.period-overlap,.funnel-stage,
    .open-funnel-row,.counting-stat,.route-signal,.table-region,.chart-empty {
        background:#fff !important; border-color:#aaa !important;
    }
    .hero-reading::before,.definition-panel::before,.hero-reading::after,.definition-panel::after { display:none !important; }
    .comparison-controls,.comparison-controls button { background:#fff !important; border-color:#ccc !important; }
    .gender-segment { background:#eee !important; color:#111 !important; border:1px solid #777; }
    .gender-segment.male { background:#ccc !important; }
    .lead-records-track,.lead-stage-track,.pos-lead-records-track,.pos-lead-stage-track,
    .gender-chart,.chart-direct-labels,.distribution-track,.histogram-column i,
    .stage-path-row,.delta-row,.mix-row,.profile-stack,.age-pair-chart,.country-pair-chart,
    .modality-stack,.modality-pair-row,.comparison-pos-legend,main svg {
        -webkit-print-color-adjust:exact; print-color-adjust:exact;
    }
    .definition-panel { break-inside:avoid !important; }
    .route-flow-list,.sankey-chart,.gender-chart,.distribution-chart,.histogram { break-inside:avoid; }
    .period-hero,.comparison-hero,.comparison-pos-hero { min-height:0 !important; padding:18px 0 !important; }
    .panel,.period-kpis,.pos-kpis,.transversal-kpis,.comparison-pos-kpis { break-inside:auto !important; }
    .period-kpis,.pos-kpis,.transversal-kpis,.comparison-pos-kpis { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
    .period-kpis article,.pos-kpis article,.transversal-kpis article,.comparison-pos-kpis article { min-height:0 !important; padding:14px !important; break-inside:avoid; }
    .panel-header,.section-heading,h2,h3,caption { break-after:avoid; }
    tr,.open-funnel-row,.history-chart-card,.period-hero,.comparison-pos-hero { break-inside:avoid; }
    .panel,.panel-body,.table-region,.chart-scroll,.comparison-pos-chart-scroll,.sankey-chart-scroll { min-width:0 !important; max-width:100% !important; overflow:visible !important; }
    .table-region table { min-width:0 !important; width:100% !important; table-layout:fixed; }
    .table-region th,.table-region td { padding:6px 4px !important; font-size:10px !important; white-space:normal !important; overflow-wrap:anywhere; }
    thead { display:table-header-group; }
    .period-close-page .open-funnel-row { grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) minmax(0,1fr); }
    .period-close-page .funnel-stage { min-width:min(180px,100%); }
    .period-close-page .funnel-stage > em { overflow-wrap:anywhere; }
    .period-close-page .funnel-stage::after { display:none !important; }
    .period-close-page .funnel-output { grid-template-columns:1fr; justify-items:start; justify-content:start; }
    .period-close-page .sankey-chart { min-width:0 !important; }
    main svg { max-width:100%; }
    .history-point-hit { display:none; }
    .breadcrumb,.breadcrumbs,.comparison-pos-data-status,.program-scroll-note { display:none !important; }
    .institutional-footer { break-inside:avoid; }
}
