 body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: radial-gradient(circle at center,#f1f2f6,#dfe3e8);
    margin:0;
    display:flex;
    height:100vh;
    color:#2c2f33;
    overflow:hidden;
  }

  #menu {
    background: linear-gradient(180deg,#f7f8fa 0%,#e9eaee 100%);
    box-shadow:2px 0 10px rgba(0,0,0,0.1);
    width:300px;
    padding:25px;
    display:flex;
    flex-direction:column;
    border-radius:0 16px 16px 0;
  }

  h1 {
    font-size:20px;
    text-align:center;
    margin-bottom:20px;
    color:#2e4a7d;
    border-bottom:2px solid #d1a654;
    padding-bottom:8px;
  }

  #titoloParlamento {
    position: absolute;
    top: 30px;
    width: 100%;
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    color: #2e4a7d;
    letter-spacing: 0.6px;
    text-shadow: 0 2px 3px rgba(0,0,0,0.1);
    user-select: text;
  }

  form {
    display:flex;
    flex-direction:column;
    gap:10px;
    background:#fff;
    padding:15px;
    border-radius:10px;
    box-shadow:0 3px 6px rgba(0,0,0,0.08);
  }

  input, select {
    padding:8px;
    border-radius:6px;
    border:1px solid #ccc;
    font-size:14px;
  }

  button {
    padding:10px;
    background:linear-gradient(90deg,#2e4a7d,#1f345a);
    color:white;
    border:none;
    border-radius:6px;
    cursor:pointer;
    transition:0.3s;
  }

  button:hover { transform:scale(1.02); background:linear-gradient(90deg,#3a5fa2,#2e4a7d); }

  #legenda {
    margin-top:15px;
    overflow-y:auto;
    flex-grow:1;
    font-size:13px;
    max-height: 40vh;
  }

  .colore-box { width: 20px; height: 20px; border-radius: 50%; margin-right: 8px; }
  .partito-info { display:flex; align-items:center; gap:5px; }
  .partito-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* stile base */
.partito-btns button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

/* modifica (matita) */
.partito-btns button:first-child {
  background: #2e4a7d;
}

.partito-btns button:first-child:hover {
  background: #3f66a8;
  transform: scale(1.1);
}

/* elimina (X) */
.partito-btns button:last-child {
  background: rgb(0, 0, 0);
}

.partito-btns button:last-child:hover {
  background: rgb(255, 0, 0);
  transform: scale(1.1);
}

.partito-box {
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:#f4f6f8;
  padding:8px 12px;
  border-radius:8px;
  margin-bottom:6px;
}
.partito-info {
  display: flex;
  align-items: center;
  gap: 10px; /* spazio uniforme */
  flex: 1;
}
.colore-box {
  width: 16px;
  height: 16px;
  min-width: 16px; /* 👈 evita deformazioni */
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ccc; /* bordo elegante */
}
.partito-info span {
  font-size: 13px;
  line-height: 1.2;
}

  #percentuale-riempimento { text-align:center; font-weight:bold; margin-top:10px; }

  #main {
    flex-grow:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    position:relative;
    overflow-x: auto;
  }

  svg {
    margin-top:20px;
    width: 100%;
    height: auto;
  }

  .voto-attivo { animation:votoFlash 0.3s ease-in-out; }
  @keyframes votoFlash { 0% { opacity:1; transform:scale(1); } 50% { opacity:0.3; transform:scale(1.4); } 100% { opacity:1; transform:scale(1); } }

  #btnVota, #btnReset, #btnPdC, #btnCoalizione {
    display:none;
    margin-top:0px;
    padding:14px 26px;
    font-size:16px;
    font-weight:600;
    color:#fff;
    border:2px solid #d1a654;
    border-radius:10px;
    box-shadow:0 4px 10px rgba(0,0,0,0.2);
    cursor:pointer;
    transition:0.2s;
    letter-spacing:0.5px;
    max-width: 100%;
  }

  #btnVota:hover, #btnReset:hover, #btnPdC:hover, #btnCoalizione:hover { transform:scale(1.04); box-shadow:0 6px 12px rgba(0,0,0,0.25); }

  #btnPdC, #btnCoalizione { background:linear-gradient(180deg,#2e4a7d 0%,#22365e 100%); }
  #btnReset { background:linear-gradient(180deg,#c22 0%,#911 100%); }
  #btnVota { background:linear-gradient(180deg,#2e4a7d 0%,#22365e 100%); }

  #presidente, #pdcDiv { font-size:18px; margin-top:15px; color:#2e4a7d; font-weight:600; text-align: center; }
  #editFormContainer{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;

    background:rgba(0,0,0,0.4);

    justify-content:center;
    align-items:center;

    z-index:100;
  }
  .edit-box{
  background:white;
  padding:25px;
  border-radius:12px;
  border:3px solid #2e4a7d;

  width:320px;
  text-align:center;

  box-shadow:0 8px 20px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
  }
  .edit-box form{
    background:transparent;
    box-shadow:none;
    padding:0;
  }

  .edit-box h3{
    color:#2e4a7d;
    margin-bottom:15px;
  }

  .edit-box input,
  .edit-box select{
    width:100%;
    margin-top:10px;
  }
  .edit-box label{
  display:block;
  text-align:left;
  margin-top:12px;
  margin-bottom:4px;
  font-size:13px;
  color:#2e4a7d;
  font-weight:600;
}

.edit-box input,
.edit-box select{
  width:100%;
  padding:10px;
  border-radius:8px;
  border:1px solid #ccc;
  font-size:14px;
  transition:0.2s;
}

/* effetto focus più moderno */
.edit-box input:focus,
.edit-box select:focus{
  outline:none;
  border-color:#2e4a7d;
  box-shadow:0 0 0 2px rgba(46,74,125,0.15);
}
#editColore{
  width:60px;
  height:40px;
  padding:2px;
}

  .edit-btns{
    margin-top:15px;
    display:flex;
    justify-content:center;
    gap:10px;
  }
  #coalizioneContainer {
    display:none;
    position:absolute;
    top:50px;
    left:50%;
    transform:translateX(-50%);
    background:white;
    padding:15px;
    border-radius:10px;
    box-shadow:0 4px 10px rgba(0,0,0,0.25);
    z-index:10;
  }
  #coalizioneContainer {
  display: none;
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 2px solid #2e4a7d;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  width: 320px;
  padding: 20px;
  font-family: 'Segoe UI', sans-serif;
  z-index: 20;
}

#coalizioneContainer h3 {
  text-align: center;
  color: #2e4a7d;
  margin-bottom: 15px;
  border-bottom: 2px solid #d1a654;
  padding-bottom: 6px;
}

#coalizioneForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.partito-coalizione {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fc;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px 10px;
}

.partito-coalizione label {
  flex-grow: 1;
  margin-left: 8px;
  color: #2e4a7d;
  font-weight: 500;
}

#coalTot {
  text-align: center;
  margin-top: 10px;
  font-weight: bold;
  font-size: 15px;
  border-top: 1px solid #ddd;
  padding-top: 8px;
}

#confermaCoalizione, #annullaCoalizione {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  color: #fff;
}
/* contenitore lista parlamenti */
#listaParlamenti {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* singolo bottone legislatura */
.parlamento-btn {
  background: linear-gradient(135deg, #f8f9fc, #eef1f6);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: 0.25s;
  position: relative;
  overflow: hidden;
}
.no-azioni-msg {
  display: none;
  text-align: center;
  font-style: italic;
  color: #777;
  margin-top: 8px;
  font-size: 0.9em;
}

/* effetto hover */
.parlamento-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #2e4a7d;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* titolo legislatura */
.parlamento-btn h4 {
  margin: 0;
  color: #2e4a7d;
  font-size: 15px;
}

/* info sotto */
.parlamento-btn small {
  color: #555;
  font-size: 12px;
}

/* effetto click */
.parlamento-btn:active {
  transform: scale(0.98);
}

/* effetto glow elegante */
.parlamento-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(46,74,125,0.15), transparent 60%);
  opacity: 0;
  transition: 0.3s;
}

.parlamento-btn:hover::after {
  opacity: 1;
}

#confermaCoalizione {
  background: linear-gradient(90deg, #2e4a7d, #1f345a);
}

#annullaCoalizione {
  background: linear-gradient(90deg, #911, #c22);
}

#confermaCoalizione:hover, #annullaCoalizione:hover {
  transform: scale(1.03);
}
#btnLegge{
  display:none;
  margin-top:10px;
  padding:14px 28px;
  font-size:16px;
  font-weight:600;
  color:#fff;

  background:linear-gradient(180deg,#6b1d1d,#4a1010);
  border:2px solid #d1a654;
  border-radius:10px;

  box-shadow:0 4px 10px rgba(0,0,0,0.25);
  cursor:pointer;
  transition:0.2s;
}

#btnLegge:hover{
  transform:scale(1.01);
}
#leggeContainer{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;

  background:rgba(0,0,0,0.4);

  display:flex;
  justify-content:center;
  align-items:center;

  z-index:100;
}

#leggeContainer h3{
  text-align:center;
  color:#2e4a7d;
  margin-bottom:10px;
}

#leggeContainer input,
#leggeContainer select{
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#risultatoLegge{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;

  background:rgba(0,0,0,0.4);

  justify-content:center;
  align-items:center;
  z-index:30;
}
.archivio-box {
  max-height: 420px;
  overflow-y: auto;
}

/* lista leggi */
#listaLeggi {
  margin-top: 10px;
  font-size: 14px;
}

/* blocco legislatura */
.blocco-legislatura {
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
}

.blocco-legislatura h4 {
  margin: 5px 0;
  color: #2e4a7d;
  border-bottom: 1px solid #d1a654;
  padding-bottom: 3px;
}

/* singola legge */
.legge-item {
  background: #f8f9fc;
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 6px;
  border-left: 4px solid #2e4a7d;
}

.legge-item small {
  display: block;
  color: #555;
}
.legge-box{
  background:white;
  padding:25px;
  border-radius:12px;
  border:3px solid #2e4a7d;

  width:320px;
  text-align:center;

  box-shadow:0 8px 20px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}

.legge-box h3{
  color:#2e4a7d;
  margin-bottom:15px;
}

.legge-box input,
.legge-box select{
  width:100%;
  margin-top:10px;
}

.legge-btns{
  margin-top:15px;
  display:flex;
  justify-content:center;
  gap:10px;
}

#risultatoBox{
  background:white;
  padding:30px;
  border-radius:12px;

  border:3px solid #2e4a7d;

  text-align:center;
  width:320px;

  box-shadow:0 8px 20px rgba(0,0,0,0.3);
}

#risultatoBox h3{
  margin-bottom:10px;
  color:#2e4a7d;
}

#chiudiRisultato{
  margin-top:15px;
  padding:8px 18px;
  background:#2e4a7d;
  color:white;
  border:none;
  border-radius:6px;
  cursor:pointer;
}
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  width: 300px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}

.modal-content h3 {
  margin-bottom: 10px;
}

.modal-content button {
  margin-top: 10px;
  padding: 8px 14px;
  border: none;
  background: #2e4a7d;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

@keyframes fadeIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

  /* --- Media Queries per mobile --- */
  @media (max-width: 768px) {
    body { flex-direction: column; height: auto; overflow-y: auto; }
    #menu { width: 80vw; padding:15px; border-radius:0 0 16px 16px; }
    #main { width: 100%; padding: 10px 0; }
    svg { width: 90vw; height: auto; }
    #btnVota, #btnPdC, #btnReset, #btnCoalizione { width: 90%; font-size: 14px; padding:12px; margin-top:10px; }
    #presidente, #pdcDiv { font-size:16px; }
  }
  #azioni {
  background: linear-gradient(180deg,#f7f8fa 0%,#e9eaee 100%);
  box-shadow:-2px 0 10px rgba(0,0,0,0.1);
  width:260px;
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:10px;
  border-radius:16px 0 0 16px;
  overflow-y: auto;
}

#azioni h2 {
  font-size:20px;
  text-align:center;
  margin-bottom:20px;
  color:#2e4a7d;
  border-bottom:2px solid #d1a654;
  padding-bottom:8px;
}

/* blocchi */
.azione-blocco {
  background:#ffffff;
  padding:12px;
  border-radius:10px;
  box-shadow:0 2px 6px rgba(0,0,0,0.08);
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* titoli piccoli */
.azione-blocco h4 {
  margin:0 0 5px 0;
  font-size:13px;
  color:#2e4a7d;
  border-bottom:1px solid #ddd;
  padding-bottom:4px;
}

/* bottoni */
#azioni button {
  width:100%;
  padding:10px;
  font-size:13px;
  font-weight:600;
  border-radius:8px;
  transition:0.2s;
}

#azioni button:hover {
  transform:scale(1.03);
}
#btnArchivioLeggi{
  display: block !important;
}
@media (max-width: 768px) {
  #azioni {
    width: 80vw;
    border-radius:16px;
    margin-top:10px;
  }
}