
/* Base settings remain */
body {
    margin: 0 auto;
    padding: 0;
    background-color: #F9F5EB;
    font-size: 14px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    overflow-x: hidden;
}

.parent {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: auto;
    box-sizing: border-box;
}

.div1, .div2, .div3, .div4, .div5, .div6 {
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
}

/* Header */
.div1 {
    background-color: #1C3879;
    text-align: center;
    color: white;
    border-radius: 20px 20px 0 0;
}

.div2 {
    background-color: #607EAA;
}

.div3 {
    background-color: #EAE3D2;
    text-align: center;
}

.div4 {
    background-color: #607EAA;
}

.div5 {
    background-color: #EAE3D2;
    border-bottom: 8px #607EAA inset;
}

.div6 {
    background-color: #1C3879;
    height: 20px;
    border-radius: 0 0 20px 20px;
}

/* Inputs area */
.input-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.input-section {
    flex: 1 1 48%;
    min-width: 120px;
    max-width: 100%;
}

input, select {
    font-size: 16px !important;
    padding: 4px;
    height: 30px;
    width: 100%;
    border-radius: 6px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

button {
    font-size: 0.9rem;
    width: 100%;
    height: 36px;
    border-radius: 10px;
    background-color: #363B4E;
    color: white;
    margin-top: 8px;
}

/* Typography */
.labels, .curve-font, .output-curve-font {
    font-size: 0.8rem;
    font-weight: 600;
    word-spacing: normal;
}

h1 {
    font-size: 1.3rem;
    margin: 0.5rem;
}
h2, h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
}
h4 {
    font-size: 0.65rem;
    text-align: right;
    margin: 0;
    padding: 4px;
    color: white;
}

/* Mobile-specific overrides */
@media (max-width: 600px) {
    .input-area {
        flex-direction: column;
    }

    .input-section {
        flex: 1 1 100%;
    }

    button {
        font-size: 1rem;
        height: 42px;
    }

    h1 {
        font-size: 1.1rem;
    }
}

/* Spherical & Toric zone input containers */
.zone-input-row, .toric-zone-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    overflow-x: auto;
    box-sizing: border-box;
}

/* Each individual label+input pair */
.zone-group, .toric-group {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Apply mobile adjustments for tight fit */
@media (max-width: 600px) {
    .zone-input-row, .toric-zone-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .zone-group, .toric-group {
        width: 100%;
    }

    input, select {
        font-size: 1rem !important;
    }

    .curve-font, .output-curve-font, .labels {
        font-size: 0.85rem;
    }
}
