body {
  font-family: sans-serif;
  max-width: 500px;
  margin: 30px auto;
  line-height: 1.6;
}

p {
  font-size: 0.9em;
  max-width: 500px;
  color: red ;
  margin-top: 0px;
}

h1 {
  text-align: center;
  font-size: 1.6em;
  margin-bottom: 0px;
}

h2 {
  text-align: center;
  font-size: 1.5em;
  font-weight: normal;
  margin-top: 0;
  margin-bottom: 0px;
}

h3 {
  font-size: 1.5em;
  font-weight: normal;
  margin-top: 20px;
  margin-bottom: 5px;
}

h4 {
  text-align: center;
  font-size: 1em;
  font-weight: normal;
  margin-top: 0px;
  margin-bottom: 20px;
}

fieldset {
  margin-bottom: 15px;
  border: 1px solid #ccc;
  padding: 8px 15px;
  border-radius: 6px;
}

legend {
  font-weight: bold;
}

button {
  padding: 8px 14px;
  font-size: 1em;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Make number inputs narrow and consistent */
input[type="number"] {
  text-align: center;
  direction: rtl;
}

/* Info icon style */
.info-icon {
  display: inline-block;
  margin-left: 5px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 0.8em;
  font-weight: bold;
  border-radius: 50%;
  background: #ddd;
  color: #333;
  cursor: pointer;
  position: relative;
}

/* HTML tooltip container */
.info-icon .tooltip {
  display: none;
  position: absolute;
  bottom: 125%; /* above icon */
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.9em;
  white-space: normal;        /* allow wrapping */
  max-width: 410px;           /* max tooltip width */
  width: max-content;          /* expand to fit content */
  word-break: break-word;      /* break long words */
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 10;
}

/* Small triangle pointer */
.info-icon .tooltip::before {
  content: '';
  position: absolute;
  bottom: -5px; /* points downward */
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

/* Show tooltip on hover */
.info-icon:hover .tooltip {
  display: block;
}
