
body {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
}
Wrap the calculator in a scope to avoid conflicts with theme styles,
  especially for Tailwind.
  
.tailwind-scope {
    font-family: 'Inter', sans-serif;
}

/* Custom styling for range sliders */
.tailwind-scope input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0; /* bg-gray-200 */
    border-radius: 9999px;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.tailwind-scope input[type="range"]:hover {
    opacity: 1;
}
.tailwind-scope input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2563eb; /* bg-blue-600 */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tailwind-scope input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2563eb; /* bg-blue-600 */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Styles for the amortization table */
.tailwind-scope .table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}
.tailwind-scope .table-container table,
#print-report .table-container table {
    width: 100%;
    border-collapse: collapse;
}
.tailwind-scope .table-container th, 
.tailwind-scope .table-container td,
#print-report .table-container th,
#print-report .table-container td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.tailwind-scope .table-container th,
#print-report .table-container th {
    background-color: #f8fafc; /* bg-gray-50 */
    position: sticky;
    top: 0;
    z-index: 10;
}
.tailwind-scope .table-container td:nth-child(1),
#print-report .table-container td:nth-child(1) {
    text-align: center;
    font-weight: 500;
}
.tailwind-scope .table-container td:not(:nth-child(1)),
#print-report .table-container td:not(:nth-child(1)) {
    text-align: right;
}

/* Print-specific styles */
@media print {
    /* Hide the main calculator UI */
    .tailwind-scope {
        display: none !important;
    }

    body {
        /* Ensure print styles apply even if theme adds margin */
        margin: 0;
        padding: 0;
        font-family: 'Inter', sans-serif;
    }
    /* Show only the print report */
    #print-report {
        display: block !important;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1in; /* Add printer margins */
        box-shadow: none;
        border: none;
    }
    #print-report h1 {
        font-size: 2rem;
        font-weight: bold;
        margin-bottom: 1.5rem;
        color: #000;
    }
    #print-report h2 {
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 2rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid #e2e8f0;
        padding-bottom: 0.5rem;
        color: #000;
    }
    #print-report .print-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    #print-report .print-summary-item {
        background-color: #f8fafc !important; /* Ensure bg prints */
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        padding: 1rem;
    }
    #print-report .print-summary-item p {
        font-size: 1rem;
        color: #475569;
    }
    #print-report .print-summary-item div {
        font-size: 1.75rem;
        font-weight: 600;
        color: #1e293b;
    }
    #print-report .print-chart-container {
        width: 100%;
        max-width: 600px;
        margin: 2rem auto;
        page-break-inside: avoid;
    }
    #print-report img {
        width: 100%;
        height: auto;
    }
    /* Ensure table prints correctly */
    #print-report .table-container {
        max-height: none;
        overflow: visible;
        border: none;
        page-break-inside: auto;
    }
    #print-report .table-container table, 
    #print-report .table-container tr, 
    #print-report .table-container td, 
    #print-report .table-container th {
        page-break-inside: avoid;
    }
    #print-report .table-container th {
        background-color: #f8fafc !important; /* Ensure bg prints */
        position: static;
    }
    #print-report .table-container td.text-green-600 {
        color: #16a34a !important;
    }
    #print-report .table-container td.text-red-600 {
        color: #dc2626 !important;
    }
}
/* Hidden by default, only shown for printing */
#print-report {
    display: none;
}