    /* Reset */
    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        line-height: 1.6;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        transition: background 0.3s, color 0.3s;
        background: #f5f6fa;
        color: #333;
    }

    body.dark-mode { background: #111; color: #ccc; }

    header {
    background: linear-gradient(90deg, #4e54c8, #8f94fb);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid; /* Use grid for more precise positioning */
    grid-template-columns: 1fr auto 1fr; /* Creates three columns: left, center, right */
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

    body.dark-mode header { background: linear-gradient(90deg, #222, #444); }
    header h1 { font-size: 1.8rem; }

    /* Dark/Light toggle button */
    #modeToggle {
        cursor: pointer;
        background: #fff;
        color: #333;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-weight: bold;
        transition: background 0.3s, color 0.3s;
    }

 /* Dark/Light toggle button */
    #modeToggle {
        cursor: pointer;
        background: #fff;
        color: #333;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-weight: bold;
        transition: background 0.3s, color 0.3s;
    }

    body.dark-mode #modeToggle {
        background: #333;
        color: #0ff;
    }

    .back-btn {
        margin: 20px 0 0 20px;
        padding: 8px 15px;
        cursor: pointer;
        border-radius: 5px;
        border: 1px solid #ccc;
        background: white;
        font-weight: bold;
    }

    main {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem;
    }

    .button-container {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 20px 0;
        justify-content: center;
    }

    .buttons {
        padding: 10px 24px;
        font-weight: bold;
        border: none;
        border-radius: 8px;
        background: #007BFF;
        color: white;
        cursor: pointer;
        transition: 0.2s;
    }

    .buttons:hover { transform: translateY(-2px); background: #0056b3; }

    /* The Box Container */
    .editor-container {
        width: 100%;
        max-width: 1100px;
        background: #e9e9e9;
        border: 1px solid #d1d1d1;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    }

    body.dark-mode .editor-container { background: #1e1e1e; border-color: #333; }

    .main-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        width: 100%;
    }

    /* Fixed Input/Output Area */
    .inputarea {
        width: 100%;
        height: 400px;
        background: white;
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 15px;
        overflow-y: auto;
        color: #152352;
        outline: none;
        text-align: left;
    }

    /* Placeholder for contenteditable */
    .inputarea:empty:before {
        content: attr(placeholder);
        color: #999;
    }

    body.dark-mode .inputarea { background: #121212; color: #ddd; border-color: #444; }

    footer {
        background: #222;
        color: #ccc;
        text-align: center;
        padding: 1rem;
        width: 100%;
    }

    @media (max-width: 768px) {
        .main-wrapper { grid-template-columns: 1fr; }
    }
/* Dark Mode overrides for the main content areas */
body.dark-mode .maincontent {
    background-color: #1e1e1e; /* Darker gray/black */
    color: #eee;
    border-color: #444;
}

/* Dark Mode for the Step headers */
body.dark-mode .steps {
    background-color: #1a252f; /* Deeper navy/black */
    border-color: #111;
}

/* Dark Mode for the identifiers/subgroups */
body.dark-mode .feature-group, 
body.dark-mode .subgroup,
body.dark-mode #hidden1 {
    background: #252525;
    border-color: #444;
    color: #ccc;
}

/* Fix for Text Inputs in Dark Mode */
body.dark-mode input[type="text"] {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

/* Fix for the Output Area (Step 4) text */
body.dark-mode #builder p {
    color: #bbb;
}

/* Adjusting the section headers (1 Point, 2 Points, etc.) */
body.dark-mode h4, 
body.dark-mode strong {
    color: #007BFF; /* Keeps headers readable or highlighted */
}
/* 3. Force the Nav into the center column */
nav {
    grid-column: 2;
    display: flex;
    justify-content: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    margin: 0; /* Remove left margin since it's centered */
}

/* 4. Position the Toggle in the last column */
#modeToggle {
    grid-column: 3;
    justify-self: end; /* Push to the far right */
}
