* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eef2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

h2 {
    margin-top: 0;
    color: #333;
}

h3 {
    color: #2c3e50;
    line-height: 1.4;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
}

input:focus {
    border-color: #007BFF;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.split-entry {
    background-color: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #444;
}

button {
    width: 100%;
    padding: 14px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #0056b3;
}

button:active {
    transform: scale(0.98);
}

#resultOutput {
    margin-top: 25px;
}

@media (max-width: 480px) {
    body {
        padding: 15px;
        align-items: flex-start;
    }
    
    .container {
        padding: 25px 15px;
        margin-top: 20px;
    }
    
    input, button {
        font-size: 16px; 
    }
}

.equation-legend {
    margin: 20px auto;
    border-collapse: collapse;
}

.equation-legend td {
    padding: 2px 4px;
    vertical-align: middle;
}

.equation-legend .var {
    text-align: left;
    white-space: nowrap;
}

.equation-legend .desc {
    text-align: left;
}