/* ═══════════════════════════════════════════════
   WIDGET HISTOGRAMME
   ═══════════════════════════════════════════════ */

#histo-panel {
  position: absolute;
  bottom: 20px;
  left: 12px;
  z-index: 1000;
  width: clamp(255px, 28vw, 425px);
  max-height: 80vh;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-sep);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition-std), transform var(--transition-std);
}

#histo-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Titre fixe du widget */
#histo-widget-title {
  flex: 0 0 auto;
  padding: 9px 12px 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

#histo-header {
  flex: 0 0 auto;
  padding: 8px 10px 7px;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg-input);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#histo-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#histo-subtitle {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* Bouton plein écran */
#btn-fullscreen {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-border-sep);
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  cursor: pointer;
  color: var(--color-text-light);
  line-height: 1;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

#btn-fullscreen span.btn-label {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

#btn-fullscreen:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

#histo-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--color-bg-header);
}

#histo-body img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
