* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f4f4f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    background: #4CAF50;
}

.title h1{
    color: white;
}

.tables {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 20px;
}

sup {
    margin-bottom: 15px;
}

sub {
    margin-top: 15px;
}

.main-column {
    flex: 2;
}

.secondary-column {
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

caption {
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    text-align: left;
}

th, td {
    padding: 10px 15px;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background-color: #f8f8f8;
    font-weight: bold;
}

td input[type="number"] {
    padding: 5px;
    width: 80px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    text-align: center;
}

td input[type="number"]:focus {
    border-color: #4CAF50;
    outline: none;
}

.equation{
    display: flex;
    row-gap: 10px;
    flex-wrap: wrap;
    align-items: center
}

button {
    background-color: #4fc3ee;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

#results{
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    width: 100%;
    padding: 10px;
    display: flex;
    flex-direction: row;
    gap: 40px;

    background: #bbc5de;
    border-radius: 20px;
}

.result-item img {
    flex: 1;
    object-fit: contain;
    height: auto;
    min-width: 0;
    max-width: 100%;
    border-radius: 10px;
}

#random{
    background-color: #f18902;
}

#random:hover{
    background-color: #ad5f00;
}

button:hover {
    background-color: #3689a6;
}

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

#random, #saveValuesToJson, #loadValuesFromJson {
    margin-bottom: 10px;
}

#calculate {
    height: 50px;
    font-weight: bold;
    background-color: #5882ff;
}

#calculate:hover {
    background-color: #3a5abb;
}

div {
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    table {
        width: 90%;
        margin: 10px auto;
    }

    button {
        width: auto;
    }

    div {
        margin-right: 0;
    }
}