
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
        }
        :root {
            --primary: #4a6fa5;
            --primary-dark: #3a5985;
            --secondary: #e76f51;
            --light: #f8f9fa;
            --dark: #343a40;
            --gray: #6c757d;
            --light-gray: #e9ecef;
            --success-bg: #d4edda;
            --success-border: #28a745;
            --warning-bg: #fff3cd;
            --warning-border: #ffc107;
            --border-radius: 16px;
            --box-shadow: 0 10px 25px rgba(0, 20, 40, 0.08);
            --transition: all 0.25s ease;
            --compare-bg: #f0f4fa;
        }
        body {
            background: #f5f7fb;
            color: var(--dark);
            line-height: 1.5;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        .title-block{
            text-align: center;
            margin-bottom: 30px;
        }
        h1 {
            font-size: 2.2rem;
            font-weight: 700;
            background: linear-gradient(145deg, var(--primary), var(--primary-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -0.5px;
        }
        .subhead {
            font-size: 1.1rem;
            color: var(--gray);
            max-width: 1150px;
            margin: 8px auto 0;
        }
        .card {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 30px;
            margin-bottom: 30px;
            transition: var(--transition);
        }
        .card-title {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--primary);
            border-bottom: 2px solid var(--light-gray);
            padding-bottom: 18px;
            margin-bottom: 28px;
        }
        .card-title i { font-size: 1.7rem; }

        /* form */
        .form-row {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            margin-bottom: 10px;
        }
        .form-group {
            flex: 1 1 240px;
            margin-bottom: 20px;
        }
        label {
            font-weight: 600;
            display: block;
            margin-bottom: 8px;
            color: var(--dark);
        }
        .label-help {
            font-size: 0.85rem;
            color: var(--gray);
            font-style: italic;
            margin-top: 5px;
        }
        select, input {
            width: 100%;
            padding: 14px 16px;
            border: 1.5px solid var(--light-gray);
            border-radius: 12px;
            font-size: 1rem;
            background: white;
            transition: var(--transition);
        }
        select:focus, input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(74,111,165,0.15);
            outline: none;
        }
        .input-with-icon {
            position: relative;
        }
        .input-with-icon i {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
            font-size: 1.1rem;
        }
        .input-with-icon input {
            padding-left: 45px;
        }
        .range-slider-container {
            padding: 8px 0;
        }
        .range-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            font-weight: 500;
        }
        .range-value {
            color: var(--primary);
            font-weight: 700;
        }
        .range-slider {
            width: 100%;
            height: 8px;
            background: var(--light-gray);
            border-radius: 10px;
            -webkit-appearance: none;
        }
        .range-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 26px;
            height: 26px;
            background: var(--primary);
            border-radius: 50%;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
            border: 3px solid white;
            cursor: pointer;
        }
        .radio-group {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .radio-option {
            flex: 1 1 120px;
        }
        .radio-option input { display: none; }
        .radio-option label {
            background: var(--light-gray);
            padding: 14px 8px;
            border-radius: 40px;
            text-align: center;
            font-weight: 600;
            font-size: 0.95rem;
            cursor: pointer;
            transition: var(--transition);
            margin-bottom: 0;
        }
        .radio-option input:checked + label {
            background: var(--primary);
            color: white;
        }
        .toggle-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--light-gray);
            padding: 16px 20px;
            border-radius: 40px;
            margin-bottom: 20px;
        }
        .toggle-label {
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .tooltip {
            position: relative;
            display: inline-block;
        }
        .tooltip i { color: var(--primary); font-size: 0.95rem; }
        .tooltip-text {
            visibility: hidden;
            width: 240px;
            background: var(--dark);
            color: white;
            font-size: 0.85rem;
            padding: 12px;
            border-radius: 8px;
            position: absolute;
            bottom: 150%;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
            z-index: 100;
        }
        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 30px;
            flex-shrink: 0;
        }
        .toggle-switch input { opacity:0; width:0; height:0; }
        .toggle-slider {
            position: absolute;
            inset: 0;
            background: #ccc;
            border-radius: 30px;
            transition: .3s;
        }
        .toggle-slider:before {
            content: "";
            position: absolute;
            height: 22px;
            width: 22px;
            left: 4px;
            bottom: 4px;
            background: white;
            border-radius: 50%;
            transition: .3s;
        }
        input:checked + .toggle-slider {
            background: var(--primary);
        }
        input:checked + .toggle-slider:before {
            transform: translateX(30px);
        }
        .calculate-btn {
            background: linear-gradient(135deg, var(--secondary), #d45c3d);
            border: none;
            color: white;
            font-weight: 700;
            font-size: 1.2rem;
            padding: 18px 24px;
            width: 100%;
            border-radius: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            cursor: pointer;
            transition: var(--transition);
            margin-top: 15px;
            box-shadow: 0 8px 18px rgba(231,111,81,0.25);
        }
        .calculate-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 22px rgba(231,111,81,0.35);
        }

        /* results */
        .results-card {
            background: linear-gradient(145deg, #ffffff, #f9fcff);
            border-left: 5px solid var(--primary);
            display: none;
        }
        .results-card.active { display: block; animation: fadeUp 0.4s; }
        @keyframes fadeUp { 0%{ opacity:0; transform:translateY(10px); } 100%{ opacity:1; transform:Y(0); } }

        .estimate-box {
            background: white;
            border: 2px solid var(--primary);
            border-radius: 30px;
            padding: 28px 20px;
            text-align: center;
            margin: 30px 0;
            box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
        }
        .estimate-amount {
            font-size: 3.5rem;
            font-weight: 800;
            color: var(--primary);
            line-height: 1.2;
        }
        .estimate-duration {
            font-size: 1.3rem;
            color: var(--secondary);
            font-weight: 500;
        }
        .detail-section {
            margin: 28px 0;
        }
        .detail-title {
            font-weight: 700;
            font-size: 1.2rem;
            color: var(--primary-dark);
            border-bottom: 2px dashed var(--light-gray);
            padding-bottom: 10px;
            margin-bottom: 18px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .detail-item {
            display: flex;
            justify-content: space-between;
            padding: 12px 0;
            border-bottom: 1px solid rgba(0,0,0,0.04);
        }
        .detail-value {
            font-weight: 700;
            color: var(--dark);
        }
        .tax-impact {
            background: #e6f3f9;
            border-radius: 18px;
            padding: 20px;
            margin: 25px 0;
            border-left: 4px solid var(--primary);
        }
        .tax-impact h4 { display: flex; gap: 10px; color: var(--primary-dark); }

        /* COMPARE PANEL (integrated) */
        .compare-panel {
            background: var(--compare-bg);
            border-radius: 24px;
            padding: 25px;
            margin: 30px 0 20px;
            border: 1px solid #bdd3e8;
        }
        .compare-title {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--primary-dark);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .compare-row {
            display: flex;
            flex-wrap: wrap;
            gap: 18px;
            margin-bottom: 25px;
        }
        .compare-col {
            flex: 1 1 200px;
            background: white;
            border-radius: 20px;
            padding: 18px 15px;
            box-shadow: 0 5px 12px rgba(0,0,0,0.04);
            text-align: center;
        }
        .compare-col h4 {
            color: var(--primary);
            font-size: 1.1rem;
            border-bottom: 1px dashed var(--light-gray);
            padding-bottom: 8px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            flex-wrap: wrap;
        }
        .link-badge {
            background: var(--primary);
            color: white;
            padding: 4px 10px;
            border-radius: 30px;
            font-size: 0.7rem;
            font-weight: 600;
        }
        .compare-scenario-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--secondary);
            margin: 10px 0 5px;
        }
        .compare-label {
            font-size: 0.85rem;
            color: var(--gray);
        }
        .compare-slider-link {
            background: white;
            border-radius: 40px;
            padding: 20px 20px;
            display: flex;

            flex-wrap: wrap;
            align-items: center;
            gap: 25px;
            margin-top: 10px;
        }
        .slider-link-item {
            flex: 3 1 280px;
        }
        .slider-link-item label {
            font-weight: 600;
            display: flex;
            justify-content: space-between;
        }
        #sliderValueLabel {
            color: var(--secondary);
            background: #fff0e6;
            padding: 3px 14px;
            border-radius: 30px;
        }

        /* action buttons */
        .action-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin: 30px 0 20px;
        }
        .action-btn {
            flex: 1 1 140px;
            background: white;
            border: 2px solid var(--light-gray);
            padding: 14px 18px;
            border-radius: 50px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            cursor: pointer;
            transition: var(--transition);
            color: var(--dark);
        }
        .action-btn:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            transform: scale(1.02);
        }
        #saveResults { background: #dcfce7; border-color: #86efac; }
        #saveResults:hover { background: #86efac; color: #14532d; }
        #copySummary { background: #fff9c4; border-color: #ffe55c; }
        #copySummary:hover { background: #ffe55c; color: #3b3b00; }
        #startOver { background: #ffecdb; border-color: #ffb58a; }
        #startOver:hover { background: #ffb58a; color: #5c2e00; }

        .disclaimer {
            background: var(--warning-bg);
            border-left: 4px solid var(--warning-border);
            border-radius: 16px;
            padding: 22px;
            font-size: 0.9rem;
            margin: 30px 0 10px;
        }

        footer {
            text-align: center;
            color: var(--gray);
            font-size: 0.85rem;
            margin-top: 40px;
        }
        @media (max-width: 650px) {
            .card { padding: 20px; }
            .compare-row { flex-direction: column; }
            .compare-slider-link { flex-direction: column; align-items: stretch; }
        }
   