
        :root {
            /* Modern color palette */
            --primary: #274c77;
            --primary-dark: #3a56d4;
            --secondary: #6096ba;
            --success: #4cc9f0;
            --warning: #f72585;
            --danger: #ef476f;
            --info: #06d6a0;
            
            /* Light theme */
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-tertiary: #f1f5f9;
            --text-primary: #1e293b;
            --text-secondary: #475569;
            --text-muted: #64748b;
            --accent-primary: #274c77;
            --accent-secondary: #6096ba;
            --accent-success: #020202;
            --accent-warning: #f59e0b;
            --accent-danger: #ef4444;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
        }

        [data-theme="dark"] {
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --bg-tertiary: #334155;
            --text-primary: #f1f5f9;
            --text-secondary: #cbd5e1;
            --text-muted: #94a3b8;
            --accent-primary: #60a5fa;
            --accent-secondary: #a78bfa;
            --accent-success: #34d399;
            --accent-warning: #fbbf24;
            --accent-danger: #f87171;
            --border-light: #334155;
            --border-medium: #475569;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html {
            scroll-behavior: smooth;
            font-size: 16px;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            transition: background-color 0.3s ease, color 0.3s ease;
            min-height: 100vh;padding-top: 70px;
        }

        /* Typography */
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Poppins', sans-serif;
            font-weight: 600;
            line-height: 1.2;
        }

        .container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 1rem;
        }

        /* Header */
        .headernew {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            position: relative;
        }

        .logo-text h1 {
            font-size: 1.25rem;
            font-weight: 700;
            line-height: 1.2;
        }

        .logo-text p {
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        @media (min-width: 640px) {
            
            .logo-text h1 {
                font-size: 1.5rem;
            }
            
            .logo-text p {
                display: block;
                font-size: 0.875rem;
            }
        }

        .theme-toggle {
            background: transparent;
            border: none;
            border-radius: var(--radius-md);
            padding: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--text-secondary);
        }

        .theme-toggle:hover {
            color: var(--accent-primary);
            transform: translateY(-1px);
        }

        .theme-toggle svg {
            width: 1.25rem;
            height: 1.25rem;
        }

        /* Mobile menu toggle */
        .mobile-menu-toggle {
            display: none;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-size: 1.25rem;
            cursor: pointer;
        }

        @media (max-width: 768px) {
            .mobile-menu-toggle {
                display: block;
            }
            
            .headernew {
                padding: 0.75rem 0;
            }
        }

        /* Main Grid Layout - Mobile First */
        .main-grid {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            margin: 1.5rem 0 2rem;
        }

        @media (min-width: 1024px) {
            .main-grid {
                display: grid;
                grid-template-columns: 2fr 1fr;
                gap: 2rem;
            }
        }

        /* Cards */
        .card {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-md);
            padding: 1.25rem;
            margin-bottom: 1.25rem;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        @media (min-width: 640px) {
            .card {
                padding: 1.5rem;
            }
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.25rem;
        }

        .card-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-primary);
			margin: 1rem;
        }

        .card-subtitle {
            font-size: 0.875rem;
            color: var(--text-muted);
            margin-bottom: 1rem;
        }

        /* Goal Type Selector - Mobile Optimized */
        .goal-type-selector {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }

        @media (min-width: 640px) {
            .goal-type-selector {
                grid-template-columns: repeat(4, 1fr);
                gap: 0.75rem;
            }
        }

        @media (min-width: 1024px) {
            .goal-type-selector {
                grid-template-columns: repeat(8, 1fr);
            }
        }

        .goal-type-btn {
            padding: 0.75rem 0.5rem;
            border: 2px solid var(--border-light);
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            color: var(--text-secondary);
            font-weight: 500;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.75rem;
            min-height: 70px;
        }

        .goal-type-btn:hover {
            border-color: var(--accent-primary);
            transform: translateY(-2px);
        }

        .goal-type-btn.active {
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            color: white;
            border-color: transparent;
            box-shadow: var(--shadow-md);
        }

        .goal-icon {
            font-size: 1.25rem;
            margin-bottom: 0.25rem;
        }

        @media (min-width: 640px) {
            .goal-type-btn {
                font-size: 0.875rem;
                padding: 0.875rem 0.5rem;
                min-height: 80px;
            }
            
            .goal-icon {
                font-size: 1.5rem;
            }
        }

        /* Form Grid - Responsive */
        .form-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        @media (min-width: 640px) {
            .form-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.25rem;
            }
        }

        .form-group {
            margin-bottom: 0;
        }

        .form-label {
            display: block;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
        }

        .form-input {
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            font-size: 1rem;
            color: var(--text-primary);
            transition: all 0.2s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
        }

        .input-group {
            display: flex;
            gap: 0.5rem;
            flex-direction: column;
        }

        @media (min-width: 640px) {
            .input-group {
                flex-direction: row;
            }
        }

        .input-group .form-input {
            flex: 1;
        }

        .input-group .form-select {
            width: 100%;
            min-width: 120px;
        }

        @media (min-width: 640px) {
            .input-group .form-select {
                width: auto;
            }
        }

        .form-select {
            padding: 0.75rem 1rem;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            font-size: 1rem;
            color: var(--text-primary);
            cursor: pointer;
        }

        .form-select:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
        }

        .form-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
            line-height: 1.4;
        }

        /* Range Slider - Mobile Friendly */
        .range-slider {
            width: 100%;
            margin-top: 0.5rem;
            -webkit-appearance: none;
            height: 6px;
            background: var(--border-light);
            border-radius: 3px;
            outline: none;
        }

        .range-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--accent-primary);
            cursor: pointer;
            border: 2px solid var(--bg-primary);
            box-shadow: var(--shadow-md);
        }

        .range-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 0.25rem;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Buttons - Touch Friendly */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.875rem 1.5rem;
            border-radius: var(--radius-md);
            font-weight: 600;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            min-height: 44px; /* Touch target size */
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            box-shadow: var(--shadow-md);
        }

        .btn-primary:hover, .btn-primary:active {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .btn-secondary {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }

        .btn-secondary:hover, .btn-secondary:active {
            background: var(--border-light);
        }

        .btn-group {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        @media (min-width: 640px) {
            .btn-group {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* Results Summary - Mobile Stacked */
        .results-summary {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-bottom: 2rem;
        }

        @media (min-width: 640px) {
            .results-summary {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1024px) {
            .results-summary {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        .summary-card {
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            text-align: center;
            position: relative;
            box-shadow: var(--shadow-sm);
        }

        .summary-card.highlight {
            background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), transparent);
            border: 2px solid var(--accent-primary);
        }

        .summary-label {
            font-size: 0.875rem;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
        }

        .summary-value {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--accent-primary);
            margin-bottom: 0.5rem;
        }

        @media (min-width: 768px) {
            .summary-value {
                font-size: 1.2rem;
            }
        }

        .summary-card.highlight .summary-value {
            color: var(--accent-primary);
        }

        .summary-subvalue {
            font-size: 0.6rem;
            color: var(--text-muted);
        }

        /* Progress Visualization */
        .progress-section {
            margin-bottom: 2rem;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .progress-bar-container {
            height: 10px;
            background: var(--bg-tertiary);
            border-radius: 5px;
            overflow: hidden;
            margin-bottom: 0.5rem;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: 5px;
            transition: width 1s ease-in-out;
        }

        .progress-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Charts - Mobile Responsive */
        .chart-container {
            position: relative;
            height: 250px;
            margin-bottom: 1.5rem;
        }

        @media (min-width: 768px) {
            .chart-container {
                height: 300px;
            }
        }

        /* Savings Timeline - Mobile Optimized */
        .timeline-container {
            margin-top: 2rem;
            overflow-x: auto;
        }

        .timeline {
            position: relative;
            padding-left: 2rem;
            min-width: 300px;
        }

        .timeline::before {
            content: '';
            position: absolute;
            left: 7px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--border-light);
        }

        .timeline-item {
            position: relative;
           
            padding-bottom: 1rem;
        }

        .timeline-item:last-child {
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .timeline-marker {
            position: absolute;
            left: -2rem;
            top: 0;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--accent-primary);
            border: 3px solid var(--bg-secondary);
        }

        .timeline-content {
            background: var(--bg-primary);
            padding: 1rem;
            border-radius: var(--radius-md);
        }

        .timeline-year {
            font-weight: 600;
            color: var(--accent-primary);
            margin-bottom: 0.25rem;
        }

        .timeline-amount {
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }

        .timeline-note {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Table Container - Mobile Scrollable */
        .table-container {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin: 1rem 0;
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
        }

        /* Savings Table */
        .savings-table {
            width: 100%;
            min-width: 700px;
            border-collapse: collapse;
        }

        .savings-table th,
        .savings-table td {
            padding: 0.75rem 1rem;
            text-align: left;
            border-bottom: 1px solid var(--border-light);
            font-size: 0.875rem;
        }

        .savings-table th {
            background: var(--bg-tertiary);
            font-weight: 600;
            color: var(--text-primary);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .savings-table tr:hover td {
            background: var(--bg-primary);
        }

        /* Sidebar - Mobile Hidden by Default */
        .sidebar-column {
            display: none;
        }

        @media (min-width: 1024px) {
            .sidebar-column {
                display: block;
            }
        }

        .sidebar-section {
            margin-bottom: 1.5rem;
        }

        .history-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .history-item {
            padding: 0.875rem;
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border-left: 3px solid var(--accent-primary);
        }

        .history-item:hover {
            background: var(--bg-tertiary);
        }

        .history-title {
            font-weight: 600;
            margin-bottom: 0.25rem;
            font-size: 0.875rem;
        }

        .history-details {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* Ad Container - Responsive AdSense */
        .ad-container {
            background: var(--bg-tertiary);
            border-radius: var(--radius-lg);
            padding: 1.5rem;
            text-align: center;
            color: var(--text-muted);
            margin-bottom: 1.5rem;
            min-height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border: 1px dashed var(--border-medium);
        }

        .ad-container .ad-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 0.5rem;
            color: var(--text-muted);
        }

        .ad-container .ad-text {
            font-size: 0.875rem;
            margin-bottom: 1rem;
        }

        .ad-container .ad-placeholder {
            width: 100%;
            max-width: 300px;
            height: 250px;
            background: linear-gradient(135deg, var(--border-light) 25%, var(--bg-primary) 25%, var(--bg-primary) 50%, var(--border-light) 50%, var(--border-light) 75%, var(--bg-primary) 75%, var(--bg-primary));
            background-size: 20px 20px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 0.875rem;
        }

        /* Mobile Ad Placement */
        .mobile-ad {
            display: block;
            margin: 1.5rem 0;
            text-align: center;
        }

        @media (min-width: 1024px) {
            .mobile-ad {
                display: none;
            }
        }

        /* Tips & Common Goals */
        .tips-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        @media (min-width: 768px) {
            .tips-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .tip-card {
            background: var(--bg-primary);
            border-radius: var(--radius-md);
            padding: 1rem;
        }

        .tip-title {
            font-weight: 600;
            font-size: 0.875rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .tip-content {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        /* Tooltips */
        .tooltip {
            position: relative;
            display: inline-block;
        }

        .tooltip .tooltip-text {
            visibility: hidden;
            width: 280px;
            background-color: var(--bg-secondary);
            color: var(--text-primary);
            text-align: left;
            border-radius: var(--radius-md);
            padding: 0.75rem;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.3s;
            box-shadow: var(--shadow-lg);
            font-size: 0.875rem;
            line-height: 1.5;
        }

        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }

        .info-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--bg-tertiary);
            color: var(--text-muted);
            font-size: 0.75rem;
            margin-left: 0.25rem;
            cursor: help;
        }

        /* Goal Achievability Indicator */
        .achievability-indicator {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem;
            border-radius: var(--radius-md);
            margin: 1rem;
            font-weight: 500;
            font-size: 0.875rem;
        }

        .achievable {
            background: rgba(16, 185, 129, 0.1);
            color: var(--accent-success);
            border-left: 4px solid var(--accent-success);
        }

        .challenging {
            background: rgba(245, 158, 11, 0.1);
            color: var(--accent-warning);
            border-left: 4px solid var(--accent-warning);
        }

        .difficult {
            background: rgba(239, 68, 68, 0.1);
            color: var(--accent-danger);
            border-left: 4px solid var(--accent-danger);
        }

        .achievability-icon {
            font-size: 1.25rem;
        }

        /* Mobile Menu Overlay */
        .mobile-menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .mobile-menu-content {
            background: var(--bg-primary);
            border-radius: var(--radius-xl);
            padding: 2rem;
            width: 90%;
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .mobile-menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .mobile-menu-close {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
        }

        /* Loading Spinner */
        .spinner {
            display: none;
            width: 40px;
            height: 40px;
            border: 3px solid var(--border-light);
            border-top-color: var(--accent-primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Print Styles */
        @media print {
           .header .headernew, .sidebar-column, .footer, .btn-group, .mobile-ad {
                display: none !important;
            }
            
            .card {
                box-shadow: none;
                border: 1px solid #ddd;
            }
            
            .main-grid {
                display: block;
            }
        }