body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        h1 {
            color: #1a5490;
            text-align: center;
        }
        .calculator-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 30px;
        }
        .calculator {
            background-color: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 25px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .calculator h2 {
            color: #1a5490;
            margin-top: 0;
            text-align: center;
        }
        .input-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            color: #495057;
        }
        input, select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button {
            background-color: #1a5490;
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            margin-right: 10px;
            font-size: 16px;
            width: 100%;
            margin-bottom: 10px;
        }
        button:hover {
            background-color: #144a7a;
        }
        .button-group {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 15px;
        }
        .results {
            background-color: #e8f4f8;
            border: 1px solid #b8e0d2;
            border-radius: 8px;
            padding: 25px;
            margin-top: 20px;
        }
        .result-item {
            background-color: white;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
            border-left: 4px solid #1a5490;
        }
        .result-item h3 {
            margin: 0 0 10px 0;
            color: #1a5490;
            font-size: 16px;
        }
        .result-item .value {
            font-size: 1.3em;
            font-weight: bold;
            color: #2c3e50;
            font-family: monospace;
            word-break: break-all;
        }
        .formula-display {
            background-color: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 4px;
            padding: 15px;
            margin: 15px 0;
            font-family: monospace;
            text-align: center;
            font-size: 1.1em;
        }
        .calculation-steps {
            background-color: white;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 15px;
            margin-top: 15px;
        }
        .calculation-steps h4 {
            margin-top: 0;
            color: #1a5490;
        }
        .step {
            margin-bottom: 8px;
            font-family: monospace;
            font-size: 0.9em;
        }
        .factorial-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
        }
        .factorial-table th,
        .factorial-table td {
            border: 1px solid #dee2e6;
            padding: 8px;
            text-align: center;
            font-family: monospace;
        }
        .factorial-table th {
            background-color: #f8f9fa;
        }
        .info-section {
            background-color: #fff3cd;
            border: 1px solid #ffeaa7;
            border-radius: 8px;
            padding: 20px;
            margin-top: 20px;
        }
        .info-section h3 {
            color: #856404;
            margin-top: 0;
        }
        .formula {
            background-color: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 4px;
            padding: 15px;
            margin: 10px 0;
            font-family: monospace;
            text-align: center;
            font-size: 1.1em;
        }
        .examples-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }
        .example-card {
            background-color: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 15px;
        }
        .example-card h5 {
            margin-top: 0;
            color: #1a5490;
        }
        .back-link {
            display: inline-block;
            margin-top: 20px;
            color: #1a5490;
            text-decoration: none;
        }
        .back-link:hover {
            text-decoration: underline;
        }
        @media (max-width: 768px) {
            .calculator-container {
                grid-template-columns: 1fr;
            }
            .button-group {
                grid-template-columns: 1fr;
            }
        }
