body {
  background: #f4f4f4;
  font-family: Arial, sans-serif;
  margin: 20px;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

h1 { margin-bottom: 10px; }

.controls { margin-bottom: 12px; }

/* Botón */                                 
#btnActualizar {
  padding: 10px 20px;
  background: #0078ff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 20px;
}
#btnActualizar:hover {
  background: #005fcc;
}

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 720px;
  background: #fff;
  box-shadow: 0 3px 10px #f3f4f5;
  border-radius: 6px;
  overflow-x: auto;
  display: block;
}

@media (max-width: 768px) {
  table {
    font-size: 14px;
  }

  th, td {
    padding: 8px 4px !important;
  }
}

th {
  background: #0078ff;
  color: white;
  padding: 10px;
}
td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

table th, table td {
  text-align: center;
}

thead {
  background: #fbfafb03;
  font-weight: 700;
}

tr.new-change td { background: #fff7e6; }

/* SVG container sizing */
#viz_container {
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  width: 100% !important;
  max-width: 760px;
  overflow-x: hidden;
}

#chart_div {
  width: 100% !important;
  max-width: 720px;
  height: 380px;
  margin: 18px auto 0 auto;
}

@media (max-width: 768px) {
  body {
    margin: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  #chart_div {
    height: 300px;
  }

  #viz_svg {
    height: 350px !important;
  }
}

/* Tooltip estilo sencillo */
.d3-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.3;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  transition: opacity 120ms ease;
}

/* estilo para burbujas seleccionadas */
.bubble-selected {
  stroke: #222;
  stroke-width: 2.2px;
  opacity: 1 !important;
}

/* cuando hay pocos datos, mantiene buen aspecto */
#viz_svg { width: 100%; height: 420px; display: block; }
