@media (prefers-color-scheme: dark) {
          .metric-card, .math-box, .case-study, .author-bio, .testimonial-box {
                background-color: #1e1e1e !important;
                border-color: #333 !important;
                color: #e0e0e0;
            }
            .math-equation, .property-table td, .form-control, .form-control:focus {
                background-color: #2a2a2a !important;
                color: #e0e0e0 !important;
            }
            .form-text, .text-muted {
                color: #aaa !important;
            }
            .result-row .text-muted {
                color: #aaa !important;
            }
            .metric-card .number {
                color: #4caf50;
            }
            .metric-card .label, .metric-card .sub {
                color: #aaa;
            }
            .result-value-blue {
                color: #64b5f6;
            }
            .legend-item .legend-color.green { background-color: #4caf50; }
            .legend-item .legend-color.blue { background-color: #64b5f6; }
            .legend-item .legend-color.orange { background-color: #ffb74d; }
            .legend-item .legend-color.gray { background-color: #888; }
            .legend-item .legend-line.green { background-color: #4caf50; }
            .legend-item .legend-line.blue { background-color: #64b5f6; }
            .legend-item .legend-line.orange { background-color: #ffb74d; }
            .legend-item .legend-line.dashed { border-top-color: #888; }
            .retirement-timeline .milestone {
                border-bottom-color: #333;
            }
            .retirement-timeline .milestone .year {
                color: #4caf50;
            }
            .accordion-item, .accordion-header, .accordion-button {
                background-color: #1e1e1e !important;
                color: #e0e0e0 !important;
                border-color: #333 !important;
            }
            .accordion-button:not(.collapsed) {
                background-color: #2a3a2a !important;
                color: #e0e0e0 !important;
            }
            .accordion-.footer a {
                color: #88b0e0 !important;
            }
            .navbar .nav-link, .breadcrumb {
                background-color: transparent !important;
            }
            .breadcrumb-item a {
                color: #88b0e0 !important;
            }
            .breadcrumb-item.active {
                color: #aaa !important;
            }
            .page-header {
                background-color: #1a1a1a !important;
                border-bottom: 1px solid #333;
            }
            .finance-canvas {
                background-color: #1a1a1a !important;
                border-color: #333 !important;
            }
            .progress-bar-custom {
                background-color: #333 !important;
            }
            .progress-bar-custom .fill {
                background: linear-gradient(90deg, #2e7d32, #1b8c5e) !important;
                color: #fff !important;
            }
            .badge-fire {
                background-color: #2e7d32 !important;
            }
            .badge-coast {
                background-color: #e65100 !important;
            }
            .badge-barista {
                background-color: #5e35b1 !important;
            }
            .related-tool .related-name a {
                color: #88b0e0 !important;
            }
            .related-tool .related-desc {
                color: #aaa !important;
            }
            .social-icons .social-icon {
                color: #aaa !important;
            }
            .social-icons .social-icon:hover {
                color: #fff !important;
            }
        }
        .input-group-custom {
            margin-bottom: 1rem;
        }
        .result-value-blue {
            font-weight: 600;
            color: #0d6efd;
            font-size: 1.8rem;
        }
        .deep-dive {
            margin: 1.8rem 0;
        }
        .deep-dive p {
            text-align: justify;
        }
        .unit-note {
            font-size: 0.9rem;
            color: #6c757d;
        }
        .coord-input {
            margin-bottom: 0.5rem;
        }
        .finance-canvas {
            width: 100%;
            height: auto;
            background-color: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin-top: 1.5rem;
            display: block;
        }
        .canvas-container {
            text-align: center;
            margin-top: 1rem;
        }
        .legend {
            display: flex;
            justify-content: center;
            gap: 2rem;
            margin: 0.5rem 0;
            font-size: 0.9rem;
            flex-wrap: wrap;
        }
        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }
        .legend-color {
            width: 16px;
            height: 16px;
            border-radius: 50%;
        }
        .legend-color.green { background-color: #28a745; }
        .legend-color.blue { background-color: #0d6efd; }
        .legend-color.orange { background-color: #fd7e14; }
        .legend-color.purple { background-color: #6f42c1; }
        .legend-color.gray { background-color: #6c757d; }
        .legend-line {
            width: 20px;
            height: 3px;
            border-radius: 2px;
        }
        .legend-line.green { background-color: #28a745; }
        .legend-line.blue { background-color: #0d6efd; }
        .legend-line.orange { background-color: #fd7e14; }
        .legend-line.dashed {
            height: 0;
            border-top: 2px dashed #6c757d;
            width: 20px;
        }
        .progress-bar-custom {
            height: 24px;
            border-radius: 12px;
            background-color: #e9ecef;
            overflow: hidden;
            margin: 0.5rem 0;
        }
        .progress-bar-custom .fill {
            height: 100%;
            border-radius: 12px;
            background: linear-gradient(90deg, #28a745, #20c997);
            transition: width 0.6s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 0.8rem;
            min-width: 30px;
        }
        .metric-card {
            background: white;
            border-radius: 8px;
            padding: 1rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            border: 1px solid #e9ecef;
            height: 100%;
            text-align: center;
        }
        .metric-card .number {
            font-size: 1.5rem;
            font-weight: 700;
            color: #28a745;
        }
        .metric-card .label {
            font-size: 0.85rem;
            color: #6c757d;
        }
        .metric-card .sub {
            font-size: 0.75rem;
            color: #adb5bd;
        }
        .slider-value {
            font-weight: 600;
            color: #28a745;
            min-width: 50px;
            display: inline-block;
        }
        .form-range::-webkit-slider-thumb {
            background: #28a745;
        }
        .form-range::-moz-range-thumb {
            background: #28a745;
        }
        .financial-glossary dt {
            font-weight: 600;
            color: #1a3c34;
        }
        .financial-glossary dd {
            margin-bottom: 0.75rem;
            padding-left: 0.5rem;
            border-left: 2px solid #28a745;
            padding-left: 1rem;
        }
        .retirement-timeline {
            position: relative;
            padding: 1rem 0;
        }
        .retirement-timeline .milestone {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.5rem 0;
            border-bottom: 1px solid #f0f0f0;
        }
        .retirement-timeline .milestone .year {
            font-weight: 700;
            min-width: 60px;
            color: #28a745;
        }
        .retirement-timeline .milestone .desc {
            flex: 1;
        }
        .retirement-timeline .milestone .value {
            font-weight: 600;
        }
        .badge-fire {
            background-color: #28a745;
            color: white;
            font-weight: 500;
            padding: 0.35rem 0.7rem;
            border-radius: 20px;
            font-size: 0.75rem;
        }
        .badge-coast {
            background-color: #fd7e14;
            color: white;
            font-weight: 500;
            padding: 0.35rem 0.7rem;
            border-radius: 20px;
            font-size: 0.75rem;
        }
        .badge-barista {
            background-color: #6f42c1;
            color: white;
            font-weight: 500;
            padding: 0.35rem 0.7rem;
            border-radius: 20px;
            font-size: 0.75rem;
        }
        .inline-icon {
            margin-right: 0.4rem;
        }
        .testimonial-box {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 1.2rem 1.5rem;
            margin: 0.8rem 0;
            border-left: 3px solid #28a745;
            font-style: italic;
        }
        .testimonial-box .attribution {
            font-style: normal;
            font-weight: 500;
            margin-top: 0.5rem;
            color: #1a3c34;
        }
        @media (max-width: 768px) {
            .metric-card .number {
                font-size: 1.5rem;
            }
        }