:root {
    --primary-color: #556B2F; /* unchanged: text on white ≈5.95:1 */
    --secondary-color: #8FBC8F; /* decorative only */
    --background-color: #F5F5DC; /* unchanged: text on this ≈10.3:1 */
    --text-color: #3a3a3a; /* unchanged */
    --card-bg: #ffffff; /* unchanged */
    --border-color: #D2B48C; /* decorative only */
    --error-color: #c62828; /* was #f44336; now ≈4.92:1 on #ffebee */
    --button-text-color: #ffffff; /* unchanged */
    --donate-button-bg: #bb4e00; /* new: white on this ≈5.0:1 */
    --donate-button-hover-bg: #aa4500; /* new: white on this ≈5.9:1 */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --header-height: 70px;
    --footer-height: 50px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    position: relative;
}

header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.8rem 0;
    text-align: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

header p {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
}


main {
    flex-grow: 1;
    display: flex;
    min-height: calc(100% - var(--header-height) - var(--footer-height));
}

canvas#the_canvas_id {
    width: 100%;
    height: 100%;
    display: block;
}

section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

label {
    font-weight: bold;
    margin-right: 0.5rem;
    flex-basis: 150px;
}

input[type="number"], select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    flex-grow: 1;
    min-width: 80px;
}

button, .button {
    background-color: var(--primary-color);
    color: var(--button-text-color);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover, .button:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

#result-area h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

#visualisation canvas {
    border: 1px solid var(--border-color);
    display: block;
    margin: 1rem auto 0.5rem;
    max-width: 100%;
    background-color: #fff;
}

footer {
    text-align: center;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    height: var(--footer-height);
    box-sizing: border-box;
    position: relative;
}

footer img {
    vertical-align: middle;
    margin: 0 0.2rem;
}

@media (max-width: 600px) {
    body {
        min-height: 100%;
    }

    main {
        flex-grow: 1;
        max-height: calc(100vh - var(--header-height) - var(--footer-height));
    }


    footer {
        position: relative;
        bottom: 0;
    }

    label {
        flex-basis: auto;
        margin-bottom: 0.2rem;
    }

    input[type="number"], select, button {
        width: 100%;
        box-sizing: border-box;
    }
}
