:root {
    font-family: "Inter", system-ui, sans-serif;
    color: #222;
    background: #f5f2ef;
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    min-height: 100vh;
}

main {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    max-width: 420px;
    width: min(420px, 100%);
}

h1 {
    margin: 2rem 0 2.5rem 0;
    text-align: center;
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #4b2e19;
    line-height: 1.15;
}

h1 small {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 400;
    color: #a67c52;
    letter-spacing: 0;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

label {
    font-weight: 600;
}

input {
    padding: 0.75rem;
    border: 1px solid #d5d0cb;
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    margin-bottom: 1rem;
}

.input-group input[type="number"] {
    flex: 1 1 auto;
    margin-bottom: 0;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.input-with-suffix input[type="number"] {
    flex: 1 1 auto;
    margin-bottom: 0;
}

.input-suffix {
    color: #555;
    font-size: 1rem;
    margin-left: 0.2em;
    white-space: nowrap;
}

button {
    background: #6b4b3e;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.9rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: #52392f;
}

.result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #f9ece1;
}

.error {
    color: #b3261e;
    font-weight: 600;
}

.api {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #555;
}

.row-fields {
    display: flex;
    gap: 2rem;
}

.row-fields > .input-group {
    flex: 1 1 0;
    min-width: 0;
}

.centered-field {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.ratio-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
}

.ratio-row .input-group {
    margin-bottom: 0; /* siden de står på samme "rad" */
}

.ratio-row .ratio-group {
    width: 200px;
}

.ratio-row .coffee-group {
    width: 160px;
}

.centered-field .input-group {
    min-width: 0;
    width: 200px; /* juster bredden etter ønske */
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    main {
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    input,
    button {
        font-size: 1rem;
        padding: 0.95rem;
    }

        .ratio-row {
        flex-direction: column;
        width: 100%;
    }

    .ratio-row .ratio-group,
    .ratio-row .coffee-group {
        width: 100%;
    }

}