        body {font-family: Segoe UI,Courier, Verdana, Arial, sans-serif; margin: 10px; font-size:12px;  line-height: 1.5;}
        
        h1 { font-size: 18px; font-weight: bold; }
		h2 { font-size: 17px; font-weight: bold; }
		.table 
		{
		    display: table;
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 8px;
        }
        th {
            background-color: #f2f2f2;
        }
        .row { display: table-row; }
        .cell { display: table-cell; border: 1px solid #ddd; padding: 8px; vertical-align: top; }
        .cell h2 { margin-top: 0; }
        .custom-list { padding-left: 20px; list-style-type: none; border: 1px solid #000000; padding: 5px; margin-bottom: 5px; }
        .custom-list li { border: 1px solid #ddd; padding: 5px; margin-bottom: 5px; }
        .nested-list {
            list-style-type: disc;
            padding-left: 20px;
            border: none;
        }
         
         
    h1 {
      text-align: center;
      color: #003366;
    }
    h2 {
      color: #003366;
      border-bottom: 1px solid #ccc;
      padding-bottom: 5px;
      margin-top: 40px;
    }
    
    .funzione {
      margin-bottom: 10px;
	  page-break-before: always;
	  max-width: 800px; 
	  height: auto; 
	  width: auto;	
	  padding-left:10px;
	  padding-right:10px;
      display: flex;
      margin-bottom: 10px;
      max-width: 800px;
      background: linear-gradient(to bottom right, #fefefe, #eaf3f8);
      page-break-before: always;
    }

    .bordo-verticale {
      width: 6px;
    }

   .sommatoria {
      display: inline-block;
      text-align: center;
      margin: 10px 0;
      font-family: "Courier New", monospace;
    }

    .sommatoria-simbolo {
      font-size: 1.2em;
      margin-bottom: 4px;
    }

    .frazione {
      display: inline-block;
      text-align: center;
      vertical-align:middle;
    }

    .numeratore,
    .denominatore {
      display: block;
      padding: 2px 4px;
    }

    .linea {
      border-top: 1px solid black;
      margin: 2px auto;
      width: 100%;
    }
.frazione-inline {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  font-family: "Courier New", monospace;
  margin: 0 2px;
  vertical-align:middle;
}

.frazione-inline .numeratore,
.frazione-inline .denominatore {
  display: block;
  line-height: 1.2;
}

.frazione-inline .linea {
  border-top: 1px solid black;
  margin: 1px auto;
  width: 100%;
}

    /* Gradienti verticali per bordi */
    .colore-purple {  background: linear-gradient(to bottom, #800080, #a64ca6);}
    .colore-blue { background: linear-gradient(to bottom, #003366, #336699);}
    .colore-green {  background: linear-gradient(to bottom, #228B22, #66BB66);}
    .colore-red {  background: linear-gradient(to bottom, #B22222, #DD6666);}
    .colore-orange {  background: linear-gradient(to bottom, #FF8C00, #FFB84D);}
    .colore-cyan {  background: linear-gradient(to bottom, #00bcd4, #80deea);}

    .colore-teal {  background: linear-gradient(to bottom, #008080, #4db6ac);}

    .colore-indigo {  background: linear-gradient(to bottom, #3f51b5, #7986cb);}

    .colore-pink {  background: linear-gradient(to bottom, #e91e63, #f48fb1);}

    .colore-yellow {  background: linear-gradient(to bottom, #fbc02d, #fff176);}

    .colore-gray {  background: linear-gradient(to bottom, #616161, #bdbdbd);}

    .colore-brown {  background: linear-gradient(to bottom, #795548, #a1887f);}

    .colore-lime {  background: linear-gradient(to bottom, #cddc39, #e6ee9c);}

    .colore-deeporange {  background: linear-gradient(to bottom, #ff5722, #ffab91);}

    .colore-cerulean {  background: linear-gradient(to bottom, #007ba7, #5eb3d9);}
   
    .contenuto {
      flex: 1;
      padding-left: 10px;
    }
    .formula,.serie,.stima,.sommatoria {
      font-family: "Courier New", monospace;
      border-radius:3px;
    
	  margin-right:12px;
      display: block;
	  border: 1px solid black;
	
	  height: auto; 
	  width: auto;
    }
	
	.sommatoria{
		background: linear-gradient(to bottom, rgba(215, 235, 255, 0.75), rgba(200, 220, 240, 0.45));
	}
	
	.serie{
		background: linear-gradient(to bottom, rgba(215, 255, 235, 0.75), rgba(200, 240, 220, 0.45));
	}
	
	.stima{
		background: linear-gradient(to bottom, rgba(255, 235, 235, 0.75), rgba(240, 200, 200, 0.45));
	}
	
	.formula{
		background: #f4f4f4;
	}
	
	img {
      max-height: 290px; 
	  height: auto; 
	  width: auto;
      display: block;
      object-fit: contain;

    }
    


/*  Visualizzazione su schermo (desktop e mobile) */

  body {
    font-size: 1rem; /* ≈ 16px, scalabile */
  }

  .custom-list {
    font-size: 1rem;
  }

  .funzione {
    flex-direction: column;
    padding: 8px;
  }

  .contenuto {
    padding-left: 0;
  }
}


@media print {
  body {
    font-size: 12pt; /* tipografia fissa per impaginazione */
  }

  .custom-list {
    font-size: 12pt;
  }

  .grafico {
    display: none; /* evita sforamenti */
  }

  img {
    max-height: 200px;
  }

  .funzione {
    page-break-before: always;
    max-width: 100%;
    padding: 0;
  }
}
