#content > #risultati {
	vertical-align: top;
	display: inline-block;
	overflow-x: auto;
	width: 65%;
}

table {
	max-width: 100% !important;
}

@media screen and (max-width: 990px) {
	
	#content > #risultati {
		display: block !important;
		margin-top: 25px;
		width: 100%;
	}
	
	table {
		max-width: 100% !important;
	}
}

#filters .btn-group-sm {
	text-align: center;
	margin-bottom: 15px;
}

.btn-group-sm .btn {
	background-color: #e1e8e8 !important;
	color: black !important;
	border: none;
}

.nav .nav-link.active {
	font-weight: bold;
}

#risultati > .header > div.row {
	margin-right: 10px !important;
}

#risultati > .header > div.row > button {
	margin-right: 5px;
}

table tr.even {
	background: rgba(214, 231, 232, 0.3);
}

table td.spazioMobile {
	display: none;
}

@media (max-width: 950px) {
	#risultati table td.descrizione, #risultati table th.descrizione {
		display: none;
	}
	table td.spazioMobile {
		display: block;
	}
}

@media(max-width: 450px){
	
	#elettori, #votanti, #votiValidi{
		display: none;
	}
}


/*** riepilogo scrutinio ***/

#riepilogoScrutinio {
	margin: 15px auto !important;
	width: 40%;
	border: 1px solid #dee2e6;
}

/*** bottoni relativi a uninominale ***/

#uninominaleButtons {
	display: none;
	text-align: center;
	padding: 5px;
	border-top: 1px solid #dee2e6
}

#uninominaleButtons > button {
	font-size: 11px;
}

#uninominaleButtons > button.active {
/* 	border: none; */
	box-shadow: none;
	color: white;
}

@media (max-width: 300px) {
	#uninominaleButtons {
		display: block;
	}
	
	table.maggioritario thead th:nth-child(4), table.maggioritario thead th:nth-child(5), table.maggioritario thead th:nth-child(6), table.maggioritario thead th:nth-child(7) {
		display: none;
	}
	
	table.maggioritario tbody td:not([rowspan]) {
		display: none;
	}
	
	table.proporzionale thead th:nth-child(1), table.proporzionale thead th:nth-child(2), table.proporzionale thead th:nth-child(3) {
		display: none;
	}
	
	table.proporzionale tbody td[rowspan] {
		display: none;
	}

}

table.maggioritario,
table.uninominale {
  /*   table-layout: fixed; */
}
}

/* loading */

#backdrop {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.25);
	z-index: 9999;
}

#loading {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0,0,0,0.4);
}

.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #3b3b3b; /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    
    position: relative;
	top: 50%;
	margin: auto;
}

td.descCandidato{
	padding-bottom: 55px;
}

td.percCandidato, th.percCandidato{
	padding-right: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*** totale risultati ***/

#totaleRisultati > td {
	background-color: white !important;
    padding: 20px 10px;
    /*color: #5ba1a1;*/
    color: black;
    font-weight: bold;
    border-top: 2px solid black;
}

#totaleRisultati > td[align=right] {
	padding-right: .3rem;
}

#totaleRisultati td:last-child {
  padding-right: 15px;
}

.totaleListeCollegate{
	background: #e1e8e8;
    font-weight: bold;
}

#risultati .messaggio {
	font-size: 11px;
    margin: 10px;
    font-style: italic;
    float: right;
}
@media screen and (max-width: 991px) {
  #tabellaRiepilogoVoti {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important; /* per iOS */
    position: relative;
  }

  #tabellaRiepilogoVoti table {
    min-width: 700px !important;
    white-space: nowrap !important;
  }

  /* Messaggio sticky sopra la tabella */
  #tabellaRiepilogoVoti .scroll-msg {
    position: sticky;
    left: 0; /* resta ferma orizzontalmente */
    top: 0; /* puoi rimuoverlo se non vuoi che resti appiccicata in alto */
    background: white;
    z-index: 0;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
  }
  table tbody tr.sezioni {
    font-size: 10px;
  }
  #tabellaRiepilogoVoti::before {
    display: block;
  }
  table tbody tr.sezioni td:first-of-type {
    padding: 1px 7px;
  }
}
/* Mobile (schermi fino a 600px) */
@media (max-width: 600px) {
  table tbody tr.sezioni {
    font-size: 7px;
  }
}

@media screen and (min-width: 992px) {
  .scroll-msg {
    display: none;
  }
}

/* aggiunto da Tommaso 23/11/25 */
@media screen and (max-width: 990px) {
    html, body {
        height: auto !important;     /* evita blocchi di altezza */
        overflow-y: auto !important; /* forza scroll verticale */
    }

    #content > #risultati {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;  /* scroll orizzontale per tabelle */
        overflow-y: visible !important; /* permette scroll verticale naturale */
    }

    #tabellaRiepilogoVoti {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative;
    }

    /* Evita overlay che blocca lo scroll */
    #loading, #backdrop {
        display: none !important;
    }
}
