/* --- PRINT MEDIA QUERY --- */
@media print {
    @page {
        margin: 0.4in; 
        size: letter portrait;
    }

    body {
        overflow: visible !important;
        height: auto !important;
        background-color: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .main-wrapper, .landing-area {
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    /* HIDE non-printable elements */
    .app-header, 
    .chart-header-screen,
    .resources-grid,
    .legal-footer,
    .app-splash,
    .header-controls,
    .bottom-nav,        /* Hide Mobile Nav */
    .pwa-install-card   /* Hide Install Banner */
    {
        display: none !important;
    }

    /* HIDE all cards by default */
    .card {
        display: none !important;
    }

    /* SHOW ONLY the Chart Card (Target by ID) */
    #chart-card {
        display: block !important;
        border: 2px solid #D9E2EC !important; /* var(--c-grey-100) */
        box-shadow: none !important;
        margin: 0 auto !important;
        padding: 0.5rem !important; 
        width: 100% !important;
        page-break-inside: avoid;
    }

    /* HEADER STYLING - Parent Container */
    .print-only-header {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 1rem; 
        color: #102A43; /* var(--text-main) */
    }
    
    /* BESPOKE TITLE STYLE */
    .print-chart-title-text {
        font-size: 16pt;
        font-weight: 800;
        margin: 0 auto 0.25rem auto !important; /* Force margin auto to center block if needed */
        line-height: 1.1;
        text-align: center !important; /* Force text center */
        color: #000;
        width: 100% !important; /* Ensure it takes full space */
        display: block !important;
    }

    /* FOOTER STYLING */
    .print-only-footer {
        display: block !important;
        text-align: center !important;
        margin-top: 1rem; 
        font-size: 9pt;
        color: #627D98; /* var(--text-muted) */
        width: 100% !important;
        padding-top: 0.5rem;
    }

    /* GRID TWEAKS */
    .syllabics-grid {
        gap: 4px !important;
    }
    
    .grid-item {
        border: 1px solid #D9E2EC !important; /* var(--c-grey-100) */
        break-inside: avoid;
        box-shadow: none !important;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}