/* ---------- Page background ---------- */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 2rem 1rem;
    background-color: #f3f4f6;
  }
  
  /* ---------- Calculator card ---------- */
  
  #calculator-card {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 1.3rem 2rem;
    max-width: 900px;
    margin: 0 auto 2rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    /* background-color: red; */
  }
  
  /* Title inside the card */
  #calculator-card h1 {
    margin-top: 0rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    /* background-color: red; */
  }


  #title-of-card {
    padding-bottom: 0.5rem;
    color: darkred;
  }
  
  .smallest-font {
    font-size: 11px;
    font-weight: 100;
    margin-top: -10px;
    margin-bottom: 10px;
    font-style: oblique;
  }


  /* ---------- Form ---------- */
  
  form#risk-form {
    margin: 0;
  }
  
  /* ---------- GRID ROWS ---------- */
  /* Left column = legend
     Right column = options */
  
     fieldset {
        display: grid;
        grid-template-columns: 230px 1fr;
        column-gap: 0.75rem;
      
        align-items: stretch;          /* let cells use full row height */
        border: none;
        border-bottom: 1px solid #e5e7eb;
        /* border-top: 1px solid #e5e7eb; */
        /* padding: 0.6rem 0; */
        margin: 0;
        /* background-color: red; */
      }


/* adding 2.23.26 */

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: black;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  /* background-color: red; */
}

.section-divider::before {
  content: none;   /* removes left line */

}

.section-divider::after {
  content: "";
  flex: 1;
  height: 3px;
  background: #e5e7eb;
}

.section-divider span {
  white-space: nowrap;
  padding: 0 4px 0 0;
}

.height-liver {
  height: 4.4rem;
  margin-top: 0.1rem;
}

.height-1 {
        height: 1.4rem;
        margin-top: 0.1rem;
      }

.height-2 {
        height: 2.4rem;
        margin-top: 0.1rem;
      }

.height-3 {
        height: 1.4rem;
        margin-top: 0.1rem;
      }

.height-4 {
        height: 2.4rem;
        margin-top: 0.1rem;
      }

.no-bottom {
  border-bottom: 0px solid #ebe8e5;
  margin-bottom: -0.8rem;
}

      
  /* Legend  */
      legend {
        grid-column: 1;
        display: flex;                 
        align-items: center;          
        padding: 0;                  
        font-weight: 500;
        /* font-size: 0.95rem; */
        font-size: 0.85rem;
        margin-bottom: -100px;
        padding-top: 0.3rem;
        /* background-color: blue; */
      }

    
      /* Options container to the right side */
      .options {
        grid-column: 2;
        display: flex;
        flex-wrap: wrap;
        align-items: center;           
        gap: 0.6rem;
        margin-top: -0.1rem;
        margin-left: .6rem;
        /* background-color: green; */
      }

      .options-title {
        grid-column: 2;
        display: flex;
        flex-wrap: wrap;
        align-items: center;           
        gap: 0.6rem;
        margin-bottom: -1.8rem;
        /* background-color: green; */
      }

  
  /* Button-like radio options */
  .options > label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.6rem;
    background-color: #f3f4f6;
    /* background-color: yellow; */
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    /* font-size: 0.85rem; */
    font-size: 0.75rem;
    min-width: 70px;
    max-width: 240px;
    text-align: center;
    white-space: normal;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
  
  /* Hides native radios but keep them accessible */
  label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  
  /* Selected option */
  .options label:has(input[type="radio"]:checked) {
    /* background-color: #1b8a74;
    border-color: #166356; */

    background-color: darkred;
    opacity: 0.7;
    border-color: black;
    
    color: #ffffff;
  }
  
  /* Hover state */
  .options label:hover {
    background-color: #e5e7eb;
  }
  
  /* ---------- Results section ---------- */
  
  #results-div {
    margin-top: 1rem;
    /* border-top: 2px solid #e5e7eb; */
  }

  #results {
    height: 130px;
    display: block;
    /* margin-top: 1rem; */
    /* margin-left: auto; */
    background-color: white;
    /* background-color:  red; */
    /* padding-left: 30px; */
    /* width: 330px; */
    /* width: 300px; */
    /* border-bottom: 2px solid #e5e7eb; */
    /* border-top: 2px solid #e5e7eb; */
    /* border-left: 2px solid #e5e7eb; */
  }
  
  #results h2 {
    margin-top: 0.5rem;
    /* color: #ffffff; */
    margin-bottom: 0.5rem;
    /* padding: 0.6rem 0.75rem; */
    border-radius: 4px;
    /* font-size: 1rem; */
  }
  
  #results p {
    margin: 0.1rem 0.5rem;
  }
  
  /* Validation message */
  #validation-message {
    font-weight: 500;
    color: #ed5029;
  }

  #validation-message {
    padding-top: 0.5rem;
  }
  
.unbold {
  font-weight: 100;
}

.minimal-space {
  font-size: xx-small;
  margin-top: -5px;
}


.small-space {
  margin-left: -6px;
}

.small-space-2 {
  margin-left: -4px;
}


.liver-definition {
  /* background-color: red; */
  color: black;
  margin-top: 102px;
  font-size: 12px;
  font-style: oblique;
  font-weight: 250;
}

.center-button-label {
  display: flex;
  align-items: center;   /* centers top-to-bottom */
  height: 1.8rem;
}

  /* ---------- Small screen warning ---------- */

@media (max-width: 960px) {
    body::before {
      content: "Screen width too narrow. Increase browser width or use larger display.";
      position: fixed;
      inset: 0;              
      background-color: #f3f4f6;
      color: #111827;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
  
      font-size: 1.1rem;
      font-weight: 500;
      padding: 2rem;
      z-index: 9999;
    }
  
    /* Disable interaction with underlying content */
    body > * {
      pointer-events: none;
      filter: blur(2px);
    }
  }
  


  .small-space {
    height: 0.2rem;
  }

  /* adding override below */

  /* ===== Compact vertical spacing overrides ===== */

/* 1) Reduce page/card vertical padding */
body {
  padding: 0.75rem 1rem;   /* was 2rem 1rem */
}

#calculator-card {
  padding-top: 0.45rem;    /* was 0.8rem */
  padding-bottom: 0.5rem;  /* was 0.8rem */
  margin-bottom: 0.75rem;  /* was 2rem */
}

/* 2) Tighten title spacing */
#calculator-card h1 {
  margin-bottom: 1.2rem;  /* was 1rem */
  font-size: 1.15rem;      /* optional small reduction */
}

#title-of-card {
  padding-bottom: 0.15rem; /* was 0.5rem */
  padding-top: 0.6rem;
  color: darkred;
  /* color: navy; */
    /* background-color: red; */
}

.options-title {
  margin-bottom: -1.1rem;  /* was -1.8rem */
}

/* 3) Tighten section divider spacing */
.section-divider {
  margin: 10px 0 6px;    
  gap: 8px;                /* was 12px */
  font-size: 0.9rem;       /* optional */
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  /* background-color: red; */
}

.section-divider::after {
  height: 2px;             /* was 3px */
}

/* 4) Make the "Closest value..." line tighter */
.smallest-font {
  margin-top: -4px;        /* was -10px */
  margin-bottom: 12px;      /* was 10px */
  line-height: 1.1;
  /* background-color: red; */
}

/* 5) Reduce row heights slightly */
.height-liver { height: 3.7rem; margin-top: 0; }  /* was 4.4rem */
.height-1     { height: 1.2rem; margin-top: 0; }  /* was 1.4rem */
.height-2     { height: 2.05rem; margin-top: 0; } /* was 2.4rem */
.height-3     { height: 1.25rem; margin-top: 0; } /* was 1.4rem */
.height-4     { height: 2.05rem; margin-top: 0; } /* was 2.4rem */

/* 6) Tighten fieldset and legend spacing */
fieldset {
  column-gap: 0.75rem;     /* was 0.75rem */
}

legend {
  font-size: 0.8rem;       /* was 0.85rem */
  padding-top: 0.5rem;    /* was 0.3rem */
  line-height: 1.05;
  /* background-color: red; */
}

/* 7) Tighten option row and buttons (BIG win) */
.options {
  gap: 0.35rem;            /* was 0.6rem */
  margin-top: -0.05rem;    /* was -0.1rem */
}

.options > label {
  padding: 0.18rem 0.45rem; /* was 0.3rem 0.6rem */
  font-size: 0.7rem;        /* was 0.75rem */
  line-height: 1.05;
  min-width: 70px;          /* was 70px */
  border-radius: 3px;       /* optional */
  margin-right: 0.5rem;
  /* padding-right: 0.5rem;
  padding-left: 0.5rem; */
  /* background-color: red; */
}

/* 8) Tighter helper text and liver text */
.liver-definition {
  margin-top: 104px;        /* keep similar positioning; can tweak */
  font-size: 11px;          /* was 12px */
  line-height: 1.1;
}

.center-button-label {
  height: 1.45rem;          /* was 1.8rem */
}

/* 9) Reduce results section height/spacing */

#results-div {
  margin-top: 0rem;   
}

#results {
  height: 102px;        
}

.title-below {
  font-size: medium;
  font-weight: 300;
  margin-left: 0px;
  margin-top: 0px;
  margin-bottom: 20px;
}

.abbrev {
  font-size: 11px;
  margin-top: -5px;
  margin-bottom: 0px;
}

/* #results h2 {
  margin-top: 0.3rem;    
  margin-bottom: 0.25rem;  
  font-size: 1rem;
}  */

/* #results p {
  margin: 0.05rem 0.4rem;  
  line-height: 1.15;
} */


#validation-message {
  padding-top: 0.2rem;      /* was 0.5rem */
}

.minimal-space {
  margin-top: -8px;         /* was -5px (sometimes this can save a line) */
}

.section-divider-results {
  color: black;
  width: 0.8vw;
  /* color: red; */
}

.red-style {
  /* color: rgb(142, 21, 21); */
  color: darkred;
  font-weight: 600;
}

.just-red {
  /* color: rgb(142, 21, 21); */
  color: darkred;
}