/* ===============================
   PORTABLE WIDGET – ISOLATED CSS
   =============================== */

.portable-widget {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  box-sizing: border-box;
  position: relative;
  margin: 25px auto;
  font-family: sans-serif;
}

/* -------------------------------
   CARDS
   ------------------------------- */

.portable-widget .level-cards {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.portable-widget .card {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  color: #222222;
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
  box-sizing: border-box;
}

.portable-widget .card-title {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 4px;
}

/* Gradienti coerenti con la barra */
.portable-widget .card-basso {
  background: linear-gradient(180deg, #b8f5b1, #42b649);
}

.portable-widget .card-medio {
  background: linear-gradient(180deg, #ffe9a3, #ffbf00);
}

.portable-widget .card-alto {
  background: linear-gradient(180deg, #ffb2b2, #f44336);
}

/* -------------------------------
   CANVAS + CHART CONTAINER
   ------------------------------- */

.portable-widget .chart-container {
  width: 100%;
  margin-top: 10px;
  position: relative;
  box-sizing: border-box;
}

.portable-widget .chart-container canvas {
  width: 100%;
  height: auto;
  display: block;
  box-sizing: border-box;
}

/* -------------------------------
   TOOLTIP
   ------------------------------- */

.portable-widget .tooltip {
  position: fixed; /* rimane sulla pagina, non dentro al widget */
  padding: 6px 10px;
  background: rgba(0,0,0,0.85);
  color: white;
  font-size: 13px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease-out;
  z-index: 99999;
  white-space: nowrap;
  font-family: sans-serif;
}
