    /* 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;
    }

    section {
        margin-bottom: 20px;
    }

    input[type="checkbox"] {
        margin-right: 5px;
        transform: scale(1.1);
        cursor: pointer;
    }

    label {
        margin-right: 15px;
        cursor: pointer;
    }

    input[type="text"] {
        padding: 5px 10px;
        width: 25%;
        border-radius: 5px;
        border: 1px solid #ccc;
        margin-left: 5px;
    }

    /* Buttons */
/* Target the section that contains the buttons */
section:has(.buttons) {
    display: flex;             /* Enables flexible layout */
    justify-content: center;   /* Centers the buttons horizontally */
    align-items: center;       /* Aligns them vertically */
    gap: 10px;                 /* Consistent space between buttons */
    width: 100%;
    margin: 10px 0;            /* Adjusts vertical spacing */
    text-align: center;
}

/* 1. Target the button container to align LEFT */
section:has(.buttons) {
    display: flex;
    justify-content: flex-start; /* Aligns buttons to the left */
    gap: 10px;
    padding: 15px 0; 
    margin: 0;
    width: 100%;
}

.buttons {
    float: none !important;
    width: 150px;
    padding: 10px 0;
    font-weight: bold;
    border: 2px solid #007BFF;
    border-radius: 8px;
    background-color: white;
    color: #007BFF;
    cursor: pointer;
    text-align: center;
}

/* 2. Restore the spacing for Steps 1, 2, and 3 */
.steps {
    display: block;
    width: 100%;
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    box-sizing: border-box;
    margin-top: 20px; /* This restores the gap between blocks */
}

/* 3. Keep Step 4 tight against the buttons only */
section:has(.buttons) + .steps {
    margin-top: 0 !important;
}


details {
    background-color: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

details[open] {
    background-color: #dfe6e9;
}

summary {
    font-weight: bold;
    font-size: 16px;
    padding: 18px 20px;           /* ← bigger hitbox here */
    cursor: pointer;
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

details > .features-container {
    padding: 0 20px 24px 20px;
}


    .features-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    margin: 1.5rem 0;
      }

      .feature-group {
        flex: 1 1 auto;           /* grow & shrink, but respect min-content */
        min-width: 280px;         /* prevents becoming too narrow */
        max-width: 420px;         /* optional – adjust to taste */
        border: 1px solid #ccc;
        border-radius: 6px;
        padding: 1rem 1.25rem;
        background: #fafafa;
      }

      .feature-group legend {
        font-weight: bold;
        font-size: 1.1rem;
        padding: 0 8px;
        color: #333;
      }

      .options-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 5px;
      }

      .options-list label {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        line-height: 1.4;
      }

      .options-list input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: #0066cc;     /* modern checkbox color – optional */
      }

      .title-links {
    width: 100%;             /* Fills the container's width */
    max-width: 100%;         /* Ensures it never overflows the container */
    box-sizing: border-box;  /* Includes padding/border in the width calculation */
}

      /* Optional: make long labels wrap nicely */
      .options-list label span {
        flex: 1;
      }

      @media (max-width: 600px) {
        .feature-group {
          flex: 1 1 100%;
          max-width: none;
        }
      }

      .scroll-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #444;
  color: white;
  font-size: 1.4rem;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s, transform 0.3s;
  transform: scale(0.7);
}

.scroll-to-top.show {
  opacity: 1;
  transform: scale(1);
}


/*  */
/* --- SPACING FIX --- */

#hidden1 {
    display: flex; /* Ensure this is flex */
    justify-content: flex-start !important;
    align-items: flex-start !important; /* Forces cards to hang from the top, not stretch */
    gap: 15px !important; /* Adjust gap to match image */
    margin-top: 10px !important;
    width: 100%;
}
/* Optional: If you want space specifically between the white cards themselves */
.subgroup {
    margin-bottom: 0px;
}

.subgroup {
    display: none;                
    flex-direction: column;
    min-width: 200px;             /* slightly wider for better readability */
    padding: 0.9rem;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.subgroup.active {
    display: flex;                
}

/* Consistent spacing for form elements */
.subgroup > * {
    margin: 0.5rem 0;
}

/* Align checkbox + label nicely on one line */
.subgroup .checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.subgroup input[type="checkbox"] {
    margin: 0;                    /* reset default margin */
}

.subgroup label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.subgroup input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #aaa;
    border-radius: 4px;
    width: 100%; 
    box-sizing: border-box; 
    font-family: inherit;
    margin-left: 0;
}


/* Gray out disabled checkboxes and their labels */
input:disabled,
input:disabled + label {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(100%);
}

/* Ensure users can still type in inputs and textareas */
input, textarea {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Dimmed state for unused text boxes */
.dimmed-input {
    opacity: 0.4;
    pointer-events: none; /* Prevents clicking and typing */
    border-color: #ccc !important;
    transition: all 0.3s ease;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
}

main, .content-wrapper {
    flex: 1;
}

.steps {
    display: block;
    background-color: #2c3e50; 
    color: white;              
    font-size: 1.2rem;         
    font-weight: bold;
    padding: 12px 15px;        
    width: 100%;               
    box-sizing: border-box;
    
    /* 1. Remove bottom radius so it's flat on the bottom */
    border-radius: 5px 5px 0 0; 
    border: 1px solid #2c3e50;
    
    /* 2. Remove bottom margin so the next box touches it */
    margin: 15px 0 0 0; 
}

/* Standard container for all white boxes (Step 3 AND Step 4) */
.maincontent {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #ccc;
    border-top: none; 
    border-radius: 0 0 5px 5px; 
    margin: 0; 
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: 100%;
}

/* Specific logic applied ONLY to the Result area */
.output-area {
    /* INCREASED SIZE */
    min-height: 150px;        /* Taller default workspace */
    max-height: 650px;        /* Higher ceiling before scrolling starts */
    
    /* SCROLLING LOGIC */
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
}


/* Optional: Make the scrollbar look cleaner (Webkit browsers) */
.maincontent::-webkit-scrollbar {
    width: 8px;
}
.maincontent::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 10px;
}

#builder p {
    user-select: text;
    -webkit-user-select: text;
}
