:root {
    --background: #303030;
    --surface: #ffffff;
    --text: #222222;
    --border: #d0d0d0;
    --muted: #666666;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--background);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    padding: 20px;
}

.loading {
    text-align: center;
    color: white;
    padding: 50px;
}


/*********************************************
 * App Container
 *********************************************/

.app-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.app-card {
    background: var(--surface);
    border-radius: 6px;
    padding: 20px;
}

.app-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}


/*********************************************
 * Two Column Layout
 *********************************************/

.app-layout {
    display: grid;
    grid-template-columns:
        minmax(600px, 1fr)
        320px;

    gap: 24px;
    align-items: start;
}

.form-panel {
    max-width: 700px;
}


/*********************************************
 * Form Sections
 *********************************************/

.section-heading {
    margin-top: 20px;
    margin-bottom: 12px;
    color: #303030;
}


/*********************************************
 * Fields
 *********************************************/

.form-row {
    display: grid;
    grid-template-columns:
        240px
        80px
        auto;

    align-items: center;

    gap: 10px;

    margin-bottom: 8px;
}

.form-row label {
    font-size: 14px;
}

.form-row input {

    width: 70px;

    padding: 5px;

    border: 1px solid var(--border);

    border-radius: 4px;

    font-size: 14px;
}

.form-row input:focus {

    outline: none;

    border-color: #888;
}


/*********************************************
 * Pregnancy Section
 *********************************************/

#pregnancyContainer {
    line-height: 1.8;
}

#pregnancyContainer label {
    cursor: pointer;
}


/*********************************************
 * Buttons
 *********************************************/

.buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {

    border: 1px solid #d3d3d3;

    background: #e6e6e6;

    color: #555555;

    padding: 8px 15px;

    border-radius: 4px;

    cursor: pointer;

    font-size: 14px;
}

button:hover {

    background: #dadada;

    color: #212121;
}

button:active {

    transform: translateY(1px);
}


/*********************************************
 * Result
 *********************************************/

#resultContainer {
    margin-top: 10px;
}

#txtResults {

    width: 100%;

    min-height: 350px;

    resize: vertical;

    border: 1px solid var(--border);

    border-radius: 4px;

    padding: 10px;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 14px;
}


/*********************************************
 * Help Panel
 *********************************************/

#helpPanel {

    width: 320px;

    position: sticky;

    top: 20px;

    align-self: start;
}

.help-card {

    background: #fafafa;

    border: 1px solid #dddddd;

    border-radius: 4px;

    padding: 12px;
}

.help-card h4 {

    margin-top: 0;

    margin-bottom: 10px;
}

.help-card p {

    line-height: 1.45;
}

.measurement-image {

    display: block;

    width: 100%;

    max-width: 300px;

    height: auto;

    border: 1px solid #cccccc;

    border-radius: 4px;

    cursor: pointer;
}

.image-caption {

    font-size: 12px;

    color: var(--muted);

    margin-top: 8px;
}


/*********************************************
 * Modal Image Viewer
 *********************************************/

.image-modal {

    display: none;

    position: fixed;

    inset: 0;

    background:
        rgba(
            0,
            0,
            0,
            0.85
        );

    justify-content: center;

    align-items: center;

    z-index: 9999;
}

.image-modal-content {

    max-width: 90%;

    max-height: 90%;

    border-radius: 4px;
}

#imageModalClose {

    position: absolute;

    right: 25px;

    top: 15px;

    color: white;

    font-size: 40px;

    cursor: pointer;
}


/*********************************************
 * Misc
 *********************************************/

.footer {

    font-size: 12px;

    color: var(--muted);
}

.error {

    color: #b00020;

    font-weight: bold;
}

hr {

    border: 0;

    height: 1px;

    background: #303030;

    margin: 18px 0;
}


/*********************************************
 * Mobile
 *********************************************/

@media (max-width: 900px) {

    .app-layout {

        grid-template-columns: 1fr;
    }

    #helpPanel {

        width: 100%;

        position: static;
    }

    .form-row {

        grid-template-columns: 1fr;
    }

    .form-row input {

        width: 120px;
    }
}