body {
    font-family: monospace;
    background-color: #111;
    color: #ddd;
    padding: 2rem;
    margin: 0 auto;
    box-sizing: border-box;
}
a, a:visited {
    color: #5af;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0ef;
    text-decoration: underline;
}

a:active {
    color: #f50;
}
#input {
    width: 100%;
    font-size: 1.5rem;
    background: #222;
    color: #fff;
    border: none;
    padding: 0.5rem;
    outline: none;
}
#result {
    font-size: 1.25rem;
    margin-top: 0.5rem;
}
.result-success {
    color: #0e7;
}
.error {
    color: #f14;
}
#controls {
    margin-top: 1rem;
}
button {
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
    padding: 0.3rem 0.6rem;
    margin-right: 0.5rem;
    cursor: pointer;
}
#storage {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    border-top: 1px solid gray;
    padding-top: 1rem;
    align-items: flex-start;
    height: 59vh;
}
#variables,
#history {
    flex: 1;
    min-width: 0;
    background: #181818;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.5em;
    overflow-y: auto;
    max-height: 100%;
    height: 100%;
}
button:hover {
    background-color: #444;
}
.history-item {
    cursor: pointer;
    padding: 0.3rem 0;
    color: #ccc;
}
.history-item:hover span {
    color: #0ef;
}
.history-expression {
    color: #fff;
}
.history-result {
    color: #8c8;
}
.variable {
    color: #fd4;
}
.var-name {
    color: #fc8;
}
.var-value {
    color: #bf5;
}
@media (max-width: 600px) {
    html, body {
        height: 100%;
        min-height: 100vh;
        overflow-x: hidden;
    }
    body {
        display: flex;
        flex-direction: column;
        height: 90vh;
        padding: 0.5em;
        font-size: 0.95rem;
        max-width: 100vw;
        box-sizing: border-box;
    }
    h1 {
        flex: 0 0 5vh;
        font-size: 1.2em;
        display: flex;
        align-items: center;
        min-height: 0;
    }
    #storage {
        flex: 1 1 80vh;
        display: flex;
        flex-direction: column;
        height: 90vh;
        margin-top: 0;
        border-top: none;
        padding-top: 0;
    }
    #variables,
    #history {
        width: 100%;
        max-height: none;
        font-size: 1em;
        flex: 1 1 25vh;
        min-height: 0;
        overflow-y: auto;
    }
    #input {
        font-size: 1.1em;
    }
    #result {
        font-size: 1em;
    }
}